build-push: move :latest on workflow_dispatch from main, not just push events#34
Open
stewartshea wants to merge 1 commit into
Open
build-push: move :latest on workflow_dispatch from main, not just push events#34stewartshea wants to merge 1 commit into
stewartshea wants to merge 1 commit into
Conversation
…h events. The tag-set case statement only added the ":latest" alias for `push` events, so manually re-running the workflow on main via workflow_dispatch produced a complete canonical-tagged build but did NOT update the moving ":latest" pointer. Consumers that pull ":latest" were stuck on the most recent automatic push, and the cc-catalog-svc / cc-registry-v2 tag indexers (which use the canonical tag list, not :latest, to pick the freshest build) ended up out of sync with what humans saw at :latest. Fix: merge the push and workflow_dispatch arms so both apply the branch alias and the ":latest" alias (gated on `github.ref_name == "main"` as before). pull_request stays separate so PR builds never move :latest. No behavior change for: push (identical tag set), pull_request (identical tag set), workflow_dispatch off non-main branches (identical tag set — :latest still not applied). The only new behavior is workflow_dispatch on main now updates :latest. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The tag-set case statement in
.github/workflows/build-push.yamlonly added the:latestalias forpushevents. Manually re-running the workflow onmainviaworkflow_dispatchproduced a fully-tagged canonical build but did not update the moving:latestpointer.The bug
Before:
After:
pushandworkflow_dispatchshare an arm, so both apply the branch alias and:latest(gated ongithub.ref_name == "main"as before).pull_requeststays separate.Why it matters
:latestdirectly were stuck on the last automatic push to main.cc-catalog-svcandcc-registry-v2use the canonical tag list (not:latest), so they now report a newer canonical tag while:lateststill points at the older one — an inconsistency that surprised an operator when manually re-running a main build.Compatibility
pushto main<canonical> + :main + :latestpushtofeature-x<canonical> + :feature-xpull_request<canonical> + :pr-Nworkflow_dispatchfrom main<canonical> + :main<canonical> + :main + :latestworkflow_dispatchfromfeature-x<canonical> + :feature-xOnly new behavior:
workflow_dispatchon main now updates:latest.Test plan
workflow_dispatchon main and confirm:latestends up pointing at the freshly-built canonical tag in GHCRmainis unchangedCompanion PRs
This change ships in lockstep across all 6 RunWhen codecollection repos so the registry behaviour is consistent. The catalog-side handling (in
runwhen-contrib/codecollection-registryPR ccv/git-mirror) makes the same fix less critical by sorting canonical tags on realbuilt_attimestamps, but moving:latestcorrectly here is still the right thing to do for directdocker pullusers and for visual consistency in GHCR.Note
Low Risk
Low risk: workflow-only change that adjusts Docker tag aliasing; main impact is which GHCR tags are moved on manual runs.
Overview
Ensures manual
workflow_dispatchbuilds behave likepushbuilds for tag aliasing by sharing the same case arm.When dispatched on
main, the workflow now also updates the moving:latesttag (in addition to the branch alias), preventing:latestfrom drifting behind the newest canonical image after manual rebuilds.Reviewed by Cursor Bugbot for commit 8b4b3c4. Bugbot is set up for automated code reviews on this repo. Configure here.