Skip to content

fix(ci): skip tag/branch creation when MINOR tag already exists#561

Merged
jbachorik merged 1 commit into
mainfrom
fix/release-skip-existing-tag
May 29, 2026
Merged

fix(ci): skip tag/branch creation when MINOR tag already exists#561
jbachorik merged 1 commit into
mainfrom
fix/release-skip-existing-tag

Conversation

@jbachorik
Copy link
Copy Markdown
Collaborator

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 with Tag v_X.Y.Z already exists.

Motivation:
The create-release CI job was failing with:

Error: Tag v_1.43.0 already exists

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-inputs job in release-validated.yml already handles this scenario correctly (it computes the next version when ALREADY_RELEASED=true). This PR brings release.sh into alignment with that logic.

The SKIP_RELEASE_CREATION flag guards only the MINOR/MAJOR path; PATCH and RETAG are unaffected.

How to test the change?:

  1. Trigger the Validated Release workflow 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.
  2. Trigger with dry_run=false in the same condition — verify a bump PR is opened and no tag or release branch is (re)created.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.
  • JIRA: [JIRA-XXXX]

@jbachorik jbachorik added the AI label May 29, 2026
@jbachorik jbachorik marked this pull request as ready for review May 29, 2026 12:07
@jbachorik jbachorik requested a review from a team as a code owner May 29, 2026 12:07
@jbachorik jbachorik merged commit 41e2743 into main May 29, 2026
19 of 55 checks passed
@jbachorik jbachorik deleted the fix/release-skip-existing-tag branch May 29, 2026 12:08
@github-actions github-actions Bot added this to the 1.44.0 milestone May 29, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +56 to +58
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 29, 2026

CI Test Results

Run: #26636371951 | Commit: 41e2743 | Duration: 11m 57s (longest job)

All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - -
8-ibm - - -
8-j9 - -
8-librca - -
8-orcl - - -
11 - - -
11-j9 - -
11-librca - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
21 - -
21-graal - -
21-librca - -
25 - -
25-graal - -
25-librca - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-05-29 12:24:00 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant