Skip to content

Unify branch existence validation in prepare-release action - #21334

Merged
fr4nc1sc0-r4m0n merged 2 commits into
mainfrom
ci/unify-prepare-release-branch-validation
Jul 29, 2026
Merged

Unify branch existence validation in prepare-release action#21334
fr4nc1sc0-r4m0n merged 2 commits into
mainfrom
ci/unify-prepare-release-branch-validation

Conversation

@fr4nc1sc0-r4m0n

@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Merge the duplicate major and minor branch-existence checks in prepare-release into a single step
  • Keep release-type-specific error messaging via RELEASE_TYPE
  • Step title clarifies it runs for major or minor releases only

Test plan

  • Verify prepare-release composite action YAML is valid
  • Confirm major/minor release workflows still invoke the action unchanged

Notifies https://github.com/elastic/observability-robots/issues/3404

Merge duplicate major/minor branch checks into a single step with
release-type-specific error messaging.
@fr4nc1sc0-r4m0n
fr4nc1sc0-r4m0n requested review from a team as code owners July 3, 2026 10:14
@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n self-assigned this Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@prodsecmachine

prodsecmachine commented Jul 3, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Align branch existence validation with the tag check step.
@mergify

mergify Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @fr4nc1sc0-r4m0n? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8.19 is the label to automatically backport to the 8.19 branch.
  • backport-9./d is the label to automatically backport to the 9./d branch. /d is the digit.
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

FAILURE_MESSAGE='Branch already exists. This is not a minor release.'
FAILURE_MESSAGE="Branch already exists. This is not a ${RELEASE_TYPE} release."
echo "FAILURE_MESSAGE=${FAILURE_MESSAGE}" >> "$GITHUB_ENV"
echo "::error::${FAILURE_MESSAGE}" ; exit 1

@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@v1v @ninalee12 Taking into account that the release process should be idempotent as defined in https://docs.google.com/document/d/1VxKftPLqC3EtkxtjWpkbHqfP0Oen9142Piri-yviTVw/edit?tab=t.0, should be manage these errors in a different way?

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.

Hey @fr4nc1sc0-r4m0n, Sorry I saw this late!

I think for error messages, we can log them however if the branch was already created, we should exit 0 instead of exit 1.

From the recent minor bump 9.5.0 we saw that when re-running the centralized pipeline, a team may have already created their branch and completed their bump. When the pipeline is re-run, this step will fail if we exit 1 and block any downstream dependent teams. Since an existing branch in this context means "step already completed successfully," exiting 0 with a warning message is the safer, idempotent behavior.

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.

I created a new PR on top of this branch to add in additional checks for idempotency as it's out of scope for this PR.

#21555

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey Nina, I just left a few comments

@mergify

mergify Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@fr4nc1sc0-r4m0n
fr4nc1sc0-r4m0n added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 97b23fa Jul 29, 2026
23 checks passed
@fr4nc1sc0-r4m0n
fr4nc1sc0-r4m0n deleted the ci/unify-prepare-release-branch-validation branch July 29, 2026 10:51
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.

5 participants