-
Notifications
You must be signed in to change notification settings - Fork 101
docs(adr): add ADR for dispatch version-skew resolution #2453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
|
rh-hemartin marked this conversation as resolved.
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| --- | ||
| title: "62. Resolving per-repo dispatch version skew" | ||
| status: Accepted | ||
| relates_to: | ||
| - agent-infrastructure | ||
| topics: | ||
|
rh-hemartin marked this conversation as resolved.
|
||
| - versioning | ||
| - workflows | ||
| - per-repo | ||
| - dispatch | ||
| --- | ||
|
|
||
| # 62. Resolving per-repo dispatch version skew | ||
|
|
||
| Date: 2026-06-25 | ||
|
|
||
| ## Status | ||
|
|
||
| Accepted | ||
|
rh-hemartin marked this conversation as resolved.
|
||
|
|
||
| ## Context | ||
|
|
||
| [ADR 48](0048-automatic-updates.md) decided that Fullsend offers two tags to | ||
| track updates: version (`vMAJOR.MINOR.PATCH`) and moving (`latest`). During | ||
| its implementation a major problem was found: in per-repo mode | ||
| `reusable-dispatch.yml` has hardcoded references to `reusable-<stage>.yml` | ||
| at `v0`. This is what we call "version skew". The version skew does not happen | ||
| on per-org mode, as organizations reference `reusable-<stage>.yml` directly. | ||
|
|
||
| This ADR presents a few options to solve this problem and recommends a solution. | ||
|
|
||
| ## Options | ||
|
|
||
| ### A. Re-introduce `reusable-dispatch.yml` to the user repository | ||
|
|
||
| Move `reusable-dispatch.yml` back into the enrolled repo so the `uses:` ref | ||
| can be templated at install time by the CLI. | ||
|
|
||
| **Rejected** We extracted dispatch specifically to reduce update noise in | ||
| user repos. Re-introducing it undoes that benefit. | ||
|
|
||
| ### B. Convert dispatch to a composite action | ||
|
|
||
| Replace the dispatch workflow with a composite action that handles routing | ||
| and agent execution in a single job. | ||
|
|
||
| **Rejected** Composite actions cannot spawn separate jobs, so it is not | ||
| possible. | ||
|
|
||
| ### C. Release branches with ref rewriting | ||
|
|
||
| Change the release process to create a release branch where `@v0` references | ||
| in `reusable-dispatch.yml` are rewritten to `@vX.Y.Z` before tagging. | ||
|
|
||
| 1. Branch from `main`. | ||
| 2. Rewrite all `uses: ...@v0` to `uses: ...@vX.Y.Z` in `reusable-dispatch.yml`. | ||
| 3. Update default values for `fullsend_version`, etc. | ||
| 4. Commit, tag the branch with `vX.Y.Z` and `latest`. | ||
|
|
||
| **Rejected** Introduces significant repository-level complexity. | ||
|
|
||
| ### D. Merge stage workflows into dispatch | ||
|
|
||
| Inline all six stage workflows as conditional jobs directly inside | ||
|
rh-hemartin marked this conversation as resolved.
|
||
| `reusable-dispatch.yml`. The `uses:` lines to stage workflows disappear | ||
| entirely. | ||
|
|
||
| This impacts per-org mode as its workflows reference directly `reusable-<stage>.yml`. | ||
|
|
||
| **Accepted** Removes the problem completely at the cost of a large file. This file | ||
| can be eventually simplified to make it easier to handle. | ||
|
|
||
| ## Decision | ||
|
|
||
| The decision is to merge the stage workflows into the dispatch workflow to avoid the | ||
| version skew it introduced in the first place. | ||
|
|
||
| However, as per-org mode is deprecated (see ADR 44), | ||
| `reusable-<stage>.yml` will be kept to allow per-org mode to continue to work. When | ||
| per-org mode is removed, then `reusable-<stage>.yml` files will be removed. During | ||
|
rh-hemartin marked this conversation as resolved.
|
||
| the deprecation period `reusable-<stage>.yml` files need to be in sync | ||
| with the merged `reusable-dispatch.yml`. | ||
|
|
||
| ## Implementation | ||
|
rh-hemartin marked this conversation as resolved.
rh-hemartin marked this conversation as resolved.
rh-hemartin marked this conversation as resolved.
|
||
|
|
||
| See [merge-stage-workflows plan](../plans/merge-stage-workflows.md). | ||
|
rh-hemartin marked this conversation as resolved.
|
||
|
|
||
| ## Consequences | ||
|
|
||
| * `reusable-<stage>.yml` stage logic is inlined into `reusable-dispatch.yml`; standalone files are retained until per-org mode is removed per ADR 44. | ||
|
rh-hemartin marked this conversation as resolved.
|
||
| * `reusable-dispatch.yml` grows significantly in size. | ||
| * `reusable-dispatch.yml` and `reusable-<stage>.yml` must stay in sync during the deprecation period. | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # ADR 62: Inline stages into reusable-dispatch.yml (per-repo only) | ||
|
|
||
| ## Context | ||
|
|
||
| Per-repo mode has a version skew problem: `reusable-dispatch.yml` references `reusable-{stage}.yml@v0` via | ||
| hardcoded `uses:` lines. During development/testing, changes to stage workflows aren't picked up because `@v0` points | ||
| to the released version. ADR 62 decides to inline all stage logic into `reusable-dispatch.yml`, eliminating | ||
| the second `uses:` hop. | ||
|
|
||
| Per-org mode is unaffected (its flow goes through scaffold `dispatch.yml` → `gh workflow run` → | ||
| thin callers → `reusable-{stage}.yml@v0`) and must not change. `reusable-{stage}.yml` files stay for | ||
| per-org until it's removed per ADR 44. | ||
|
|
||
| ## Plan | ||
|
|
||
| Branch from main. Per-org scaffold files stay untouched — only `reusable-dispatch.yml` and the new composite | ||
| action are changed. | ||
|
|
||
| ### 1. Inline stage logic into reusable-dispatch.yml | ||
|
|
||
| Inline each `reusable-{stage}.yml` job directly into `reusable-dispatch.yml`, eliminating the | ||
| `uses: reusable-{stage}.yml@v0` hop. Verify: | ||
| - Route job logic matches main (no unintended routing changes) | ||
| - Each inlined stage job matches its corresponding `reusable-{stage}.yml` (same steps, permissions, concurrency) | ||
| - `uses: reusable-{stage}.yml@v0` lines are gone | ||
| - Secrets (`FULLSEND_GCP_WIF_PROVIDER`, `FULLSEND_GCP_PROJECT_ID`) declared in `on.workflow_call.secrets` | ||
|
|
||
| ### 2. Create prepare-workspace composite action | ||
|
|
||
| Add `.github/actions/prepare-workspace/action.yml` to DRY up workspace setup across the six inlined stage jobs. | ||
|
rh-hemartin marked this conversation as resolved.
|
||
|
|
||
| ### 3. Sync check: inlined stages vs reusable-{stage}.yml | ||
|
|
||
| For each stage (triage, code, review, fix, retro, prioritize), verify the inlined job in `reusable-dispatch.yml` matches the standalone `reusable-{stage}.yml`: | ||
| - Same permissions | ||
| - Same concurrency group pattern (agent-scoped) | ||
| - Same steps (checkout, prepare-workspace, mint-token, setup-gcp, setup-agent-env, run agent) | ||
| - Same stage-specific logic (fix: fork check, eligibility, review body; code: validation, bot identity; review: prior | ||
| review; prioritize: no mint, no checkout) | ||
|
|
||
| Key difference allowed: inlined jobs use `prepare-workspace` composite action while standalone files have inline bash. The behavior must be equivalent. | ||
|
|
||
| ### 4. Verify scaffold tests pass | ||
|
|
||
| Run `go test ./internal/scaffold/...` — scaffold files are unchanged so tests must still pass. | ||
|
|
||
| ### 5. Verify workflow lint | ||
|
|
||
| Run any workflow linting (`actionlint` or similar) on both `reusable-dispatch.yml` and the restored `reusable-{stage}.yml` files. | ||
|
|
||
| ## Files changed | ||
|
|
||
| | File | Action | | ||
| |------|--------| | ||
| | `.github/workflows/reusable-dispatch.yml` | Modify (inline stage jobs) | | ||
| | `.github/workflows/reusable-{code,fix,review,triage,retro,prioritize}.yml` | Unchanged (kept for per-org) | | ||
| | `.github/actions/prepare-workspace/action.yml` | New (composite action) | | ||
| | `internal/scaffold/...` | Unchanged (per-org untouched) | | ||
|
|
||
| ## Verification | ||
|
|
||
| 1. `go test ./...` — full test suite passes | ||
| 2. Diff each inlined stage job against its `reusable-{stage}.yml` counterpart to confirm sync | ||
| 3. Manual review: per-org flow unchanged (shim → dispatch.yml → thin callers → reusable-{stage}.yml) | ||
| 4. Manual review: per-repo flow works without version skew (shim → reusable-dispatch.yml with inlined stages) | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.