Skip to content

Skip app drift on deploy-only fields when there is no active deployment#5943

Open
radakam wants to merge 3 commits into
mainfrom
fix-app-config-no-deployment-drift
Open

Skip app drift on deploy-only fields when there is no active deployment#5943
radakam wants to merge 3 commits into
mainfrom
fix-app-config-no-deployment-drift

Conversation

@radakam

@radakam radakam commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Changes

Skip drift reporting on the deploy-only app fields source_code_path, config, and git_source whenever the app has no active deployment, unifying all three under a single ActiveDeployment == nil check (reason: no active deployment). Also fix the test server's stop handler to clear the active deployment for non-scalable apps, matching the real backend, and add a test covering the stopped-app case.

Why

DoRead can only read these fields back from the app's active deployment. An app created without lifecycle.started (the default no_compute case) has none, so the fields read back empty while the bundle sets them — producing a phantom update in bundle plan that can never converge (these fields are excluded from the App Update call and only deploy on start). For non-scalable apps the backend also clears active_deployment on stop (pending_deployment is always cleared; scalable/LIQUID apps retain the active deployment), so the same spurious diff applies there; the previous source_code_path-only check and the "no deployment" wording didn't capture that. Verified against a real workspace: a never-started app and a stopped non-scalable app both return active_deployment: null, while a running app returns it, so real out-of-band drift is still reported once a deployment exists. This is a plan-idempotency fix. A config/git_source change made while the app has no active deployment is applied on the next start (see manageLifecycle), not silently lost — it is deferred, not applied while stopped, because the API neither exposes nor accepts deployed config for a non-running app.

Tests

  • config-no-deployment / git-source-no-deployment: no-op plan on a never-started app.
  • config-drift-stopped: drift is detected while running, then skipped after stop.

This gap was found by fuzz testing.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: c67e7f1

Run: 29574659074

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 227 1123 4:46
💚​ aws windows 4 4 229 1121 6:38
💚​ aws-ucws linux 4 4 316 1039 6:08
💚​ aws-ucws windows 4 4 318 1037 7:36
💚​ azure linux 4 4 227 1122 4:43
💚​ azure windows 4 4 229 1120 7:09
💚​ azure-ucws linux 4 4 318 1036 6:47
💚​ azure-ucws windows 4 4 320 1034 7:50
💚​ gcp linux 4 4 226 1124 4:56
💚​ gcp windows 4 4 228 1122 6:54
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 10 slowest tests (at least 2 minutes):
duration env testname
6:42 azure windows TestAccept
6:29 gcp windows TestAccept
6:24 azure-ucws windows TestAccept
6:17 aws-ucws windows TestAccept
6:11 aws windows TestAccept
3:04 gcp linux TestAccept
2:59 aws linux TestAccept
2:58 azure linux TestAccept
2:48 azure-ucws linux TestAccept
2:47 aws-ucws linux TestAccept

@radakam
radakam force-pushed the fix-app-config-no-deployment-drift branch from 79153bb to 1957de9 Compare July 16, 2026 12:21
The app deploy-only fields (config, git_source) are applied through an app
deployment, which only happens once the app compute is started (manageLifecycle).
Until then DoRead leaves them nil, so an app that set config or git_source
without lifecycle.started=true planned a perpetual update for a field that was
never deployed.

Extend OverrideChangeDesc to skip config and git_source while there is no active
deployment, keying off remote.ActiveDeployment. source_code_path was already
skipped; matching on the top-level field (Prefix(1)) now also catches nested
config diffs. Real out-of-band drift is still reported once a deployment exists.
Adds acceptance tests for the config and git_source cases.
@radakam
radakam force-pushed the fix-app-config-no-deployment-drift branch from 1957de9 to a9a9561 Compare July 16, 2026 12:26
@radakam radakam changed the title Skip app config/git_source drift when the app has no deployment Skip spurious app config/git_source drift when app has no deployment Jul 17, 2026
Unify the deploy-only drift skip (source_code_path, config, git_source) on
ActiveDeployment == nil, which the backend also returns for a stopped app, not
just before the first deploy. Update the reason to "no active deployment" and fix
the test server's stop handler to clear the active deployment so acceptance tests
match cloud behavior. Add config-drift-stopped covering the stopped case.
@radakam radakam changed the title Skip spurious app config/git_source drift when app has no deployment Skip app drift on deploy-only fields when there is no active deployment Jul 17, 2026
The active deployment is cleared on stop only for non-scalable apps; scalable
apps retain it (pending is always cleared). Soften the OverrideChangeDesc and
test-server comments accordingly. Comment-only, no behavior change.
@radakam
radakam marked this pull request as ready for review July 17, 2026 10:51
@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

18 files changed
Suggested: @andrewnester
Also eligible: @denik, @pietern, @janniklasrose, @shreyas-goenka, @anton-107, @lennartkats-db

/bundle/ - needs approval

Files: bundle/direct/dresources/app.go
Suggested: @andrewnester
Also eligible: @denik, @pietern, @janniklasrose, @shreyas-goenka, @anton-107, @lennartkats-db

General files (require maintainer)

Files: libs/testserver/apps.go
Based on git history:

  • @andrewnester -- recent work in bundle/direct/dresources/, libs/testserver/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants