feat(dev): connect-only sst dev — finish the parked skip-when-unchanged gate#6926
Closed
benderTheCrime wants to merge 1 commit into
Closed
feat(dev): connect-only sst dev — finish the parked skip-when-unchanged gate#6926benderTheCrime wants to merge 1 commit into
sst dev — finish the parked skip-when-unchanged gate#6926benderTheCrime wants to merge 1 commit into
Conversation
…en unchanged Opt-in via SST_DEV_SKIP_UNCHANGED. When the fully-resolved deployment fingerprint matches the last successful deploy, skip the `pulumi up` entirely and reuse the already-deployed stage — cutting `sst dev` startup from minutes to seconds on large stacks (the up is otherwise a full diff over every resource on every startup). - Re-enable the parked skip gate in pkg/project/run.go behind the flag, gated on a per-stage fingerprint persisted next to state. - Fingerprint (devSkipParts) = the config/infra bundle hash plus the env baked into functions that the bundle misses: secrets, _fallback secrets, SST-injected env (excluding the rotating SST_AWS_* credentials), resolved link values, and provider/SST versions. This is the "hash env too" the upstream `&& false` gate was waiting on. - SST_DEV_SKIP_MAX_AGE forces a periodic real up to reconcile out-of-band drift. - Register dev function targets from already-deployed state at the aws runtime's own startup (Project.DevTargets), so a skip still serves GraphQL/Lambda — race-free, vs. the program's AddTarget which the skip avoids. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
e8c4beb to
8bfb96c
Compare
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finish the parked connect-only skip: skip the per-startup
pulumi upwhen nothing changedpkg/project/run.gohas a skip gate that's been disabled in place:This PR finishes it (the "hash env too" part) and wires up the dev side, behind an opt-in flag.
Why. On a large app,
sst devruns a fullpulumi upover every resource on every startup. On a ~3,000-resource app a true no-op startup still spends ~4–5 min in the up (config eval + bootstrap + bridge are <5s; functions build lazily on first invoke). The cost scales with resource count, not with anything the user changed.What it does
Opt-in
SST_DEV_SKIP_UNCHANGED=1: when the fully-resolved deployment fingerprint matches the last successful deploy, skip thepulumi upentirely and reuse the already-deployed stage. Startup drops from minutes to single-digit seconds..sst/skiphash.<stage>).devSkipParts) = the esbuild config/infra bundle hash plus the env that gets baked into functions but isn't in the bundle — the missing "hash env too": secrets,_fallbacksecrets, SST-injected env (excluding the rotatingSST_AWS_*credentials, which otherwise change the hash every run), resolved link values, and provider/SST versions. Per-component, so a declined skip logs exactly what changed.SST_DEV_SKIP_MAX_AGE(seconds) forces a periodic real up to reconcile out-of-band drift, which input-hashing can't detect.Runtime.AddTarget; without them a skip connects the bridge but routes nothing (function not found). So the aws runtime registers targets from already-deployed state at its own startup (Project.DevTargets→ rebuilds aruntime.BuildInputper function from each function's_liveoutput + resolved links + the app-wideLambdaEncryptionKey). Done in the runtime, not published from the skip path, to avoid the race (the runtime subscribes only after blocking on AppSync-readiness).Validation
Built and run against a real ~3,000-resource app:
skipping deploy — deployment fingerprint unchanged.Notes
process.envread directly insst.config.tsand out-of-band drift aren't caught by input-hashing —SST_DEV_SKIP_MAX_AGEis the backstop.v4.14.1(currently 15 commits behinddev, clean ancestor — diff is just the 3 files); happy to rebase ontodev.pkg/project/run.go,pkg/flag/flag.go,cmd/sst/mosaic/aws/function.go.