Repository navigation
Conversation
A push now redeploys only the services whose own policy does not ignore every changed file. Skipped services keep their current image; settled, healthy rows of those services are left out of the source intent's stamp. Pending, failed, or never-deployed rows are always stamped, so a replaced intent's work is carried forward. Adds a service-level includeFiles (watch paths) option and gates the per-service skip behind a new ignoreFilesPerService flag (dry-run logs when off).
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.
feat(push): redeploy only services whose files changed
https://goodrx-dev.atlassian.net/browse/DEVT-3120
Problem
shouldSkipPushDeployis all-or-nothing per build: the push is skipped only if every changed file is ignoredby every affected service. In a monorepo with several services from one repo, a change that one service ignores
still rebuilds all of them. Image tags are
lfc-<shortSha>-<envVarsHash>, so every service rebuilds on everycommit. In one production monorepo only about 5% of pushes skip, and about 37% of app image builds are for
services whose dependency closure did not change.
Change
shouldSkipPushDeployevaluates each service policy separately and returnsskipServiceswhen some, but not all, services ignore every changed file. Full-skip behaviour and reasons areunchanged.
enqueueResolveAndDeployBuildacceptsskipServicesand stores it onrepository-scoped
sourceintents only (target: 'all'intents ignore it).stampDeploysForIntentandadoptDeploysForIntentexclude a row onlywhen its service is in
skipServices, it is settled (observedGeneration >= desiredGeneration), and its statusis READY, DEPLOYED or BUILT. Pending rows (including rows a replaced intent stamped), failed rows and
never-deployed rows are always stamped, so coalesced pushes cannot strand work. The fenced pass already builds
and applies manifests only for rows at the run's generation, so skipped services keep their image and release.
includeFiles(watch paths). New service-level option. A file is ignored for a service if it matchesignoreFilesor falls outside a non-emptyincludeFiles. Glob ignore lists cannot express "everything exceptmy dependency closure"; an include list can. Cap is 200 patterns (ignoreFiles keeps 50). Glob matchers are now
compiled once per policy instead of once per file.
features.ignoreFilesand a newfeatures.ignoreFilesPerService. With the new flag off, Lifecycle logsPush: dry-run would skip services reason=ignoreFileswith the service list and redeploys everything.Preserved
lifecycle.yaml/.lifecycle.ymlchange never skips.ignoreFilesfeature flag gate.Known limitation
findOrCreateDeploysstill advancesdeploys.shafor skipped rows in the pushed repository and branch, so theUI and status comment show the new SHA for a service that is still running the previous image. Under the
service's own policy the content is equivalent. Keeping the old SHA would mean passing the skip set into
findOrCreateDeploys; happy to do that here or in a follow-up.Tests
src/server/lib/__tests__/pushIgnoreFiles.test.ts: partial skip list, missing policy plus skip, includeFilessemantics, includeFiles-only policy, includeFiles validation and cap, config change with includeFiles.
src/server/lib/deploymentReconciliation/__tests__/mailbox.test.ts: skip filter applied to the stamp;not applied for an empty list or
target: 'all'.src/server/services/__tests__/build.test.ts:skipServiceskept on repository-scoped push intents only.src/server/services/__tests__/github.test.ts: partial skip enqueuesskipServiceswith both flags on;dry-run with either flag off.
Results: the 8 related suites (push ignore, mailbox, build, github, github.behavior, githubAutoTrack,
YamlService, yamlSchemas) pass with
.env.ciloaded. Fulljestrun: 10,053 passed, 1 failed; the failure isapi-keys/route.test.tsreadingOPENAI_API_KEYfrom the local shell and passes with it unset.eslintis cleanon changed files.
pnpm run generate:schemasreproduces the JSON schema and YAML docs byte for byte.ts-check(disabled in CI) reports no new errors on changed source lines.Rollout
ignoreFilesPerServiceunset and watch the dry-run log for wrong skips.ignoreFilesPerService.