fix(ci): skip tag/branch creation when MINOR tag already exists#561
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db4a30f76c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [ -z "$DRYRUN" ] && git rev-parse "v_${BASE}" >/dev/null 2>&1; then | ||
| echo "Tag v_${BASE} already exists; skipping tag and release branch creation — will only produce a version-bump PR" | ||
| SKIP_RELEASE_CREATION=true |
There was a problem hiding this comment.
Keep minor reruns consistent with validation
When a minor rerun starts from main still at the already-tagged version, the workflow validation computes the next release version (release-validated.yml lines 102-105) and the non-dry-run summary reports that validated tag/branch as successfully created (lines 216-220). This new branch instead exits the release-creation path as soon as the current tag exists, so the job can succeed after only opening the bump PR and without creating the validated release tag/branch, leaving operators with a false successful-release summary for the next version.
Useful? React with 👍 / 👎.
CI Test ResultsRun: #26636371951 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-05-29 12:24:00 UTC |
What does this PR do?:
In
release.sh, when a MINOR release is triggered and the tag for the current Gradle version already exists (e.g.v_1.43.0), the script now skips tag and release-branch creation and falls through to only produce a version-bump PR. Previously it exited withTag v_X.Y.Z already exists.Motivation:
The
create-releaseCI job was failing with:This happens when a previous release run successfully created the tag and release branch but the version-bump PR was never merged into
main. Re-running the release workflow hit the same wall. The fix recovers automatically: it skips what was already done and creates the missing bump PR so the next release run can proceed normally.Additional Notes:
The
validate-inputsjob inrelease-validated.ymlalready handles this scenario correctly (it computes the next version whenALREADY_RELEASED=true). This PR bringsrelease.shinto alignment with that logic.The
SKIP_RELEASE_CREATIONflag guards only the MINOR/MAJOR path; PATCH and RETAG are unaffected.How to test the change?:
Validated Releaseworkflow as a dry-run (dry_run=true,release_type=minor) on a branch where the current Gradle version's tag already exists — the step should complete without error.dry_run=falsein the same condition — verify a bump PR is opened and no tag or release branch is (re)created.For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.