Fix release tag lifecycle - #346
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79c4560e-6adc-4983-92af-3d1eb1ea8ab2
There was a problem hiding this comment.
Pull request overview
This PR updates the release preparation workflow and documentation to enforce an immutable release-tag lifecycle: tags are no longer created or force-moved pre-merge, and maintainers are guided to create the package-scoped tag only after the release PR is merged, pointing at the exact merged main commit.
Changes:
- Removed pre-merge tag creation and force-push behavior from
Prepare Release; the workflow now only creates/pushes the release branch. - Added post-merge, non-force tagging instructions that verify the merged commit and package version before creating the tag.
- Tightened publishing guidance to require the official build to use the exact tagged merged commit (not a later
maincommit).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/prepare-release.yaml |
Stops creating/moving tags during preparation; updates summary output with safe post-merge tagging guidance. |
doc/release_process.md |
Documents post-merge tagging and aligns publishing steps with immutable tag + exact-commit build requirements. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79c4560e-6adc-4983-92af-3d1eb1ea8ab2
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/workflows/prepare-release.yaml:162
grep -v "^${TARGET_TAG}$"treats${TARGET_TAG}as a regex, so tag characters like.or+can match other tags and accidentally filter the wrong baseline. Use fixed-string + whole-line matching when excluding the target tag from the tag list.
LATEST_TAG=$(git -c versionsort.suffix=- tag -l "${TAG_PREFIX}*" --sort=-v:refname | \
grep -v "^${TARGET_TAG}$" | head -n 1)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79c4560e-6adc-4983-92af-3d1eb1ea8ab2
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/workflows/prepare-release.yaml:162
- The exclusion filter for the target tag uses a regex (
grep -v "^${TARGET_TAG}$"). Because tag names contain.(and potentially other regex metacharacters), this can exclude the wrong tag(s) and produce an incorrectLATEST_TAGbaseline for the changelog. Use a fixed-string, full-line match instead.
grep -v "^${TARGET_TAG}$" | head -n 1)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79c4560e-6adc-4983-92af-3d1eb1ea8ab2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79c4560e-6adc-4983-92af-3d1eb1ea8ab2
Summary
What changed?
maincommit without force, and required the official build to use that exact commit.eng/ci/code-mirror.ymlwhile preserving the existingmaintrigger, so each newly-created post-merge package tag uses the shared mirror template's dedicated tag path immediately.Why is this change needed?
mainpush, whose normal branch mirror path pushes--tagsand can fail on an existing mismatched destination tag.Issues / work items
Project checklist
CHANGELOG.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
.github/workflows/prepare-release.yaml,eng/ci/code-mirror.yml,doc/release_process.mdAI verification (required if AI was used):
Testing
Automated tests
mainand include all tags; rendered Summary shell syntax/content checks enforce the exact mirrored-commit and re-lock gate; existing/unused remote-tag guard cases pass; exact target-tag filtering uses fixed-string whole-line matching; forbidden tag-mutation assertions,git diff --check, andnpm run lintpass.Manual validation (only if runtime/behavior changed)
eng/ci/code-mirror.ymland asserted its branch filter remains exactlymainwhile its tag filter includes*.MERGED_COMMITand is locked.Notes for reviewers
eng/ci/code-mirror.ymlextendsci/code-mirror.yml@eng. For tag refs, that shared engineering template dispatches toci/internal/code-mirror-tag.yml, which compares the destination tag, deletes the stale ADO tag with the mirror identity when needed, pushes the canonical GitHub tag, and re-locks it. The new tag trigger activates that existing reconciliation path; it does not mutate the canonical GitHub tag.azuremanaged-v0.4.0ref atd447907899830e47b9af0eb3994e01e0a5d69beb. That event should trigger the shared compare/delete/push/re-lock path under the mirror service identity. No separate ADO privilege intervention is expected if the shared template behaves as specified.