Skip to content

gha: Add release branch sync workflow#7091

Open
vvoland wants to merge 1 commit into
docker:masterfrom
vvoland:gha-sync-release
Open

gha: Add release branch sync workflow#7091
vvoland wants to merge 1 commit into
docker:masterfrom
vvoland:gha-sync-release

Conversation

@vvoland

@vvoland vvoland commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Add a manually dispatched workflow for maintainers to sync a docker release branch to a selected docker release tag.

The job checks out the requested release branch, merges the tag with git merge --no-ff, checks the worktree content out from that tag, stages the result, and pushes the updated branch.

The actual push is guarded by the docker-releases GitHub environment which requires a manual approval.

@vvoland vvoland added this to the 29.7.0 milestone Jul 8, 2026
@vvoland vvoland self-assigned this Jul 8, 2026
@vvoland vvoland force-pushed the gha-sync-release branch 3 times, most recently from cc66332 to e802815 Compare July 8, 2026 10:04
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🔴 CRITICAL

Two high-severity bugs completely disable the master-branch safety guard in the Validate step (BRANCH vs $branch case mismatch + trailing space in the comparison string). Several medium-severity issues were also found: git checkout -- '*' won't resolve subdirectory conflicts, sed "//q" uses unescaped regex with slash-injection risk, incorrect boolean logic in conflict detection, missing xargs -r guard, and a DRY_RUN check that fires after merges have already been applied.

Comment thread .github/workflows/sync-release-branch.yml Outdated
Comment thread .github/workflows/sync-release-branch.yml Outdated
Comment thread scripts/unmerged-tags Outdated
Comment thread scripts/sync-branch
Comment thread .github/workflows/sync-release-branch.yml
Comment thread scripts/sync-branch
Comment thread .github/workflows/sync-release-branch.yml Outdated
Comment thread .github/workflows/sync-release-branch.yml

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

3 findings in 2 files — 1 high-severity (forced inline), 2 medium-severity (security + logic).

Comment thread scripts/unmerged-tags Outdated
Comment thread .github/workflows/sync-release-branch.yml
Comment thread scripts/unmerged-tags Outdated
@vvoland vvoland force-pushed the gha-sync-release branch from 14b8e3f to 0812cfb Compare July 8, 2026 13:48
@vvoland vvoland requested a review from docker-agent July 8, 2026 14:56

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🔴 CRITICAL

Two confirmed high-severity bugs in new code introduced by this PR.

Findings summary

  1. scripts/unmerged-tags:32 — Plain sort sorts version tags lexicographically, causing wrong tag ordering (e.g. docker-v29.10.0 before docker-v29.9.0). The awk exit-on-target logic then cuts the list at the wrong point, syncing the wrong set of tags.
  2. .github/workflows/sync-release-branch.yml:80scripts/sync-branch (which runs git merge) is called before the DRY_RUN check, so merges always execute even in dry-run mode. The dry_run flag only prevents the push, contradicting the stated intent of "print the tag range without merging or pushing".

Comment thread scripts/unmerged-tags Outdated
Comment thread .github/workflows/sync-release-branch.yml
@vvoland vvoland force-pushed the gha-sync-release branch from 0812cfb to 21f6308 Compare July 8, 2026 15:06
@vvoland vvoland requested a review from docker-agent July 8, 2026 15:08

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

4 medium-severity findings confirmed or likely in the newly added scripts and workflow.

Comment thread scripts/unmerged-tags
Comment thread scripts/unmerged-tags
Comment thread scripts/sync-branch Outdated
Comment thread scripts/sync-branch
Comment thread .github/workflows/sync-release-branch.yml
@vvoland vvoland force-pushed the gha-sync-release branch 2 times, most recently from daa138a to 5123974 Compare July 8, 2026 17:30
@vvoland vvoland requested a review from docker-agent July 8, 2026 17:45

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

One finding requires attention before merge.

Lower-confidence findings (not posted inline)

None.

Dismissed findings

  • scripts/sync-branch:17 — Inverted conflict-check logic (DISMISSED: logic is correct; the OR condition correctly guards the force-checkout path)
  • .github/workflows/sync-release-branch.yml:60 — User-supplied tag input not validated (DISMISSED: workflow_dispatch restricted to maintainers, env var prevents injection, git args are safe)
  • .github/workflows/sync-release-branch.yml:80 — xargs splitting may mishandle special characters (DISMISSED: git tag names cannot contain whitespace by git's own constraints)
  • .github/workflows/sync-release-branch.yml:132 — Push uses mutable FETCH_HEAD ref (DISMISSED: no concurrent fetch between verification and push; FETCH_HEAD is stable in this context)

Comment thread scripts/unmerged-tags
@vvoland vvoland force-pushed the gha-sync-release branch from 5123974 to a24a887 Compare July 8, 2026 17:57
@vvoland vvoland requested a review from docker-agent July 8, 2026 17:58

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

One medium-severity confirmed finding in the new scripts.

Comment thread scripts/unmerged-tags
@vvoland vvoland force-pushed the gha-sync-release branch from a24a887 to 5bdb7da Compare July 8, 2026 18:09
@vvoland vvoland requested a review from docker-agent July 8, 2026 18:09

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

This PR adds a well-structured release-branch sync workflow with good security properties (inputs passed via env vars, manual approval gate, SHA verification before push). Two correctness issues were found in the new scripts.

Comment thread scripts/sync-branch Outdated
Comment thread scripts/unmerged-tags
Comment thread scripts/sync-branch
Add a manually dispatched workflow for maintainers to sync a Docker
release branch to a selected release tag.

The sync-release-branch job checks out the release branch, computes
the list of unmerged tags up to the requested tag via
scripts/unmerged-tags, merges them in order via scripts/sync-branch
using git merge --no-ff (resolving conflicts by taking the tag's
content), then pushes the result to a temporary branch.

The push-release-branch job runs after manual approval via the
docker-releases environment. It verifies that neither the release
branch nor the temporary branch moved since the sync job ran before
force-advancing the release branch and deleting the temporary branch.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland force-pushed the gha-sync-release branch from 5bdb7da to 182f56f Compare July 8, 2026 18:22
@vvoland vvoland requested a review from docker-agent July 8, 2026 18:23

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The new workflow and helper scripts look correct. The sync logic — enumerating unmerged tags via unmerged-tags, sequentially merging them via sync-branch, and guarding the actual push behind the docker-releases environment — is well-structured. Conflict handling (MERGE_HEAD + diff-filter=U check followed by worktree checkout and stage) correctly distinguishes conflict failures from other merge failures. The two-job split (prepare on a temporary branch, then push after human approval) is a sound safety pattern.

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.

3 participants