Skip to content

job_runs: add lifecycle.triggers.on_bundle_deploy - #6231

Open
radakam wants to merge 8 commits into
mainfrom
deco-job-runs-lifecycle-on-bundle-deploy
Open

job_runs: add lifecycle.triggers.on_bundle_deploy#6231
radakam wants to merge 8 commits into
mainfrom
deco-job-runs-lifecycle-on-bundle-deploy

Conversation

@radakam

@radakam radakam commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds lifecycle.triggers.on_bundle_deploy: true for experimental job_runs (direct engine): re-fire the run on every bundle deploy.

  • Config: JobRunLifecycle.triggers (same lifecycle-shadow pattern as lifecycle.started on apps).
  • Planning: when armed, PrepareState stores a fresh UUID fingerprint so the existing recreate rule fires every deploy.
  • Validation: on_bundle_deploy must be true when set; incompatible with lifecycle.prevent_destroy.

Without the trigger, behavior is unchanged. Removing the trigger can recreate once while the fingerprint clears.

Why

Users need a declarative “run this every deploy” switch (migrations, seed jobs) without editing run config to force a recreate. A fresh fingerprint each plan is what makes recreate reliable for this mode.

Tests

  • Unit: trigger validation; PrepareState fingerprint only when armed; knownMissingInRemoteType for local-only triggers
  • Acceptance: on_bundle_deploy redeploy with unchanged config plans recreate and issues a second run-now

Let users re-fire a run on every deploy via a trigger fingerprint in
state, so unchanged config still plans recreate. File/value modes are
parsed but rejected until follow-up PRs.
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 2d96f50

Run: 31502121613

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 290 1132 11:35
🔄​ aws windows 1 4 4 291 1130 10:38
💚​ azure linux 4 4 289 1132 10:17
💚​ azure windows 4 4 291 1130 8:47
🔄​ gcp linux 1 1 5 289 1132 12:29
🔄​ gcp windows 1 1 5 291 1130 10:39
11 interesting tests: 4 RECOVERED, 4 SKIP, 3 flaky
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestDashboardAssumptions_WorkspaceImport ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestSyncFullFileSync ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
🔄​ TestSyncIncrementalSyncFileToPythonNotebook ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 18 slowest tests (at least 2 minutes):
duration env testname
8:33 azure windows TestAccept
6:17 gcp windows TestAccept
6:14 aws windows TestAccept
4:09 gcp windows TestFilerWorkspaceFilesExtensionsDelete
3:19 aws linux TestFilerRecursiveDelete/workspace_files
3:12 aws windows TestFilerWorkspaceFilesExtensionsReadDir
3:10 aws linux TestAccept
3:07 azure linux TestAccept
3:01 gcp windows TestFilerWorkspaceFilesExtensionsRead
3:01 gcp linux TestAccept
2:33 gcp linux TestFilerWorkspaceFilesExtensionsStat
2:30 aws windows TestFilerWorkspaceFilesExtensionsStat
2:24 gcp windows TestFilerRecursiveDelete/workspace_files
2:18 azure windows TestFilerWorkspaceFilesExtensionsRead
2:05 gcp windows TestExportDirDoesNotOverwrite
2:04 aws linux TestFilerReadWrite/workspace_files
2:01 aws windows TestExport
2:01 aws windows TestFilerWorkspaceFilesExtensionsRead

Ship only on_bundle_deploy for now; add the other modes when implemented.
Say what the trigger does instead of what it does not.
Trigger fingerprint removal can recreate once; keep the same model for future triggers.
Every-deploy recreate cannot succeed when destroy is forbidden.
Include idempotency_token in on_bundle_deploy output and regenerate refschema fields for JobRunLifecycle triggers.
@radakam
radakam marked this pull request as ready for review August 11, 2026 14:23
@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

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

/bundle/ - needs approval

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

General files (require maintainer)

Files: .nextchanges/bundles/job-runs-on-bundle-deploy.md
Based on git history:

  • @janniklasrose -- recent work in bundle/config/mutator/, bundle/schema/, .nextchanges/bundles/

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

Catch invalid on_bundle_deploy configs at bundle validate, not only
plan/deploy.
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