Repository navigation
fix(build): backport prepare-deploy.sh hardening to release/2.1.x - #3533
Merged
Merged
Conversation
Backport of PR #3406 (d2736f3), merged to main 2026-07-24 but never backported. Without it, release.yml's Maven Build step crashes on this branch: the old script picked the highest-versioned tag across ALL branches containing a historical db-change commit (v2.2.0-M2, not v2.1.3), then used 'set -e' with a bare 'git diff --quiet' outside any if-condition, so the nonzero exit from a real diff aborted the script before the intended if-check ran. Found during dry-run for the 2.1.4 release.
Contributor
There was a problem hiding this comment.
Pull request overview
Backports hardening to the release-branch prepare-deploy.sh helper so the release.yml Maven Build step no longer fails due to set -e short-circuiting and incorrect “last release tag” resolution across branches.
Changes:
- Determine the last release tag from tags reachable from
HEAD(git tag --merged HEAD) to avoid selecting tags from other branches. - Wrap
git diff --quietin anifconditional soset -edoesn’t abort the script when differences exist. - Add an explicit “no release tag found” guard to keep the workflow proceeding and allow SQL script deployment by default.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
mainon 2026-07-24, never backported) torelease/2.1.x.release.yml's Maven Build step crashes on this branch. The old script'sLAST_RELEASE_TAGwas computed viagit tag --contains <historical db commit>across all branches, which now resolves tov2.2.0-M2(higher version, also descends from that commit) instead ofv2.1.3. It then rangit diff --quiet $LAST_RELEASE_TAG -- <db dir>as a bare statement underset -e; since that diff is non-empty, the nonzero exit aborted the script before theif [ $? -eq 0 ]check ever ran.git tag --merged HEAD(ancestors of the current branch only → correctly resolves tov2.1.3) and wraps the diff directly in anifsoset -edoesn't short-circuit it.Found via the dry-run (
dry_run=true) release.yml run for 2.1.4: https://github.com/operaton/operaton/actions/runs/32453987314Test plan
release.ymlwithdry_run=trueonrelease/2.1.xafter merge and confirm the Maven Build step completes