Skip to content

fix(release): use 3-pass commit chain to fully pin self-refs#198

Merged
derekmisler merged 1 commit intodocker:mainfrom
docker-agent:fix/release-3-pass-commit-chain
May 8, 2026
Merged

fix(release): use 3-pass commit chain to fully pin self-refs#198
derekmisler merged 1 commit intodocker:mainfrom
docker-agent:fix/release-3-pass-commit-chain

Conversation

@docker-agent
Copy link
Copy Markdown
Contributor

Problem

The 2-pass release commit chain had a broken self-ref resolution path. When a consumer used the tagged RELEASE_SHA's reusable workflow, GitHub would resolve:

  • RELEASE_SHA's .github/workflows/review-pr.ymluses: docker/cagent-action/review-pr@TEMP_SHA
  • TEMP_SHA's review-pr/action.ymluses: docker/cagent-action@c22076b # v1.5.0
  • v1.5.0's action.yml reads DOCKER_AGENT_VERSION = v1.54.0

TEMP_SHA (Pass 1, dist/-only commit) inherited main's YAML files which still contained the old self-refs. Only the final RELEASE_SHA commit had its YAML pinned, but TEMP_SHA's sub-action YAML was never updated. This caused the beta pr-review.yaml (which requires docker-agent ≥ v1.57.0 for hooks.before_llm_call) to invoke v1.54.0 instead.

Fix: 3-pass commit chain

Introduces a third commit pass so the chain correctly bottoms out at PREP_SHA (which carries the freshly-built dist/ and current DOCKER_AGENT_VERSION from main):

Pass Commit YAML self-refs Content
1 PREP_SHA old (inherited from main — never resolved directly) dist/ only
2 TEMP_SHA pinned → PREP_SHA YAML files updated
3 RELEASE_SHA pinned → TEMP_SHAtagged YAML files updated

Resolution chain when a consumer uses RELEASE_SHA:

  • RELEASE_SHA's review-pr.ymluses: …@TEMP_SHA
  • TEMP_SHA's review-pr/action.ymluses: docker/cagent-action@PREP_SHA
  • PREP_SHA has DOCKER_AGENT_VERSION = v1.57.0 (from main) ✅

Changes

  • .github/workflows/release.yml: renamed TEMP_SHAPREP_SHA (Pass 1), RELEASE_SHATEMP_SHA (Pass 2), and added Pass 3 that re-pins PREP_SHA refs → TEMP_SHA, creating the final RELEASE_SHA that gets tagged.
  • Each pass has its own verification step to catch any refs that weren't updated.
  • The sha output emitted to $GITHUB_OUTPUT continues to point to RELEASE_SHA (Pass 3).

Validation

  • pnpm build
  • biome ci . ✅ (no new violations)
  • tsc --noEmit
  • actionlint -shellcheck= .github/workflows/release.yml ✅ (zero errors on changed file; pre-existing node24 warnings in other files are unchanged)

@docker-agent docker-agent requested a review from a team as a code owner May 8, 2026 14:56
@docker-agent docker-agent requested a review from derekmisler May 8, 2026 14:56
@docker-agent
Copy link
Copy Markdown
Contributor Author

PR Review Failed — The review agent encountered an error and could not complete the review. View logs.

The 2-pass approach had a bug: TEMP_SHA (dist/ only) still contained
old self-refs in its YAML files (inherited from main). When consumers
used RELEASE_SHA's reusable workflow, GitHub would resolve:

  RELEASE_SHA: review-pr.yml → uses: docker/cagent-action/review-pr@TEMP_SHA ✅
  TEMP_SHA: review-pr/action.yml → uses: docker/cagent-action@c22076b # v1.5.0 ❌
  v1.5.0: DOCKER_AGENT_VERSION = v1.54.0 ❌ (missing before_llm_call support)

Fix: add a third pass so the chain correctly bottoms out at PREP_SHA
(the new dist/ + DOCKER_AGENT_VERSION from main):

  Pass 1 (PREP_SHA): stage dist/ only, inherit main's YAML
  Pass 2 (TEMP_SHA): sed all self-refs → PREP_SHA in YAML files
  Pass 3 (RELEASE_SHA): sed all self-refs PREP_SHA → TEMP_SHA in YAML files

With this 3-pass chain:
  RELEASE_SHA: review-pr.yml → uses: …@TEMP_SHA ✅
  TEMP_SHA: review-pr/action.yml → uses: docker/cagent-action@PREP_SHA ✅
  PREP_SHA: DOCKER_AGENT_VERSION = v1.57.0 (from main) ✅

Variable rename: TEMP_SHA → PREP_SHA (Pass 1), RELEASE_SHA → TEMP_SHA
(Pass 2), and RELEASE_SHA is now the Pass 3 commit that gets tagged.
@docker-agent docker-agent force-pushed the fix/release-3-pass-commit-chain branch from f9eff9c to 7c3aeef Compare May 8, 2026 15:03
@derekmisler derekmisler merged commit 44e7f94 into docker:main May 8, 2026
8 checks passed
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