Unify branch existence validation in prepare-release action - #21334
Conversation
Merge duplicate major/minor branch checks into a single step with release-type-specific error messaging.
🤖 GitHub commentsJust comment with:
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Align branch existence validation with the tag check step.
|
This pull request does not have a backport label. Could you fix it @fr4nc1sc0-r4m0n? 🙏
|
| 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 |
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Hey Nina, I just left a few comments
|
Tick the box to add this pull request to the merge queue (same as
|
Summary
prepare-releaseinto a single stepRELEASE_TYPETest plan
prepare-releasecomposite action YAML is validNotifies https://github.com/elastic/observability-robots/issues/3404