Skip to content

fix(build): backport prepare-deploy.sh hardening to release/2.1.x - #3533

Merged
kthoms merged 1 commit into
release/2.1.xfrom
backport/prepare-deploy-fix-2.1.x
Aug 21, 2026
Merged

kthoms merged 1 commit into
release/2.1.xfrom
backport/prepare-deploy-fix-2.1.x

Conversation

@kthoms

@kthoms kthoms commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Backports fix(build): Harden prepare-deploy.sh #3406 (merged to main on 2026-07-24, never backported) to release/2.1.x.
  • Without this, release.yml's Maven Build step crashes on this branch. The old script's LAST_RELEASE_TAG was computed via git tag --contains <historical db commit> across all branches, which now resolves to v2.2.0-M2 (higher version, also descends from that commit) instead of v2.1.3. It then ran git diff --quiet $LAST_RELEASE_TAG -- <db dir> as a bare statement under set -e; since that diff is non-empty, the nonzero exit aborted the script before the if [ $? -eq 0 ] check ever ran.
  • The fixed script scopes the tag lookup to git tag --merged HEAD (ancestors of the current branch only → correctly resolves to v2.1.3) and wraps the diff directly in an if so set -e doesn'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/32453987314

Test plan

  • Re-run release.yml with dry_run=true on release/2.1.x after merge and confirm the Maven Build step completes

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.
Copilot AI lite review requested due to automatic review settings August 21, 2026 07:26
@github-actions github-actions Bot added the scope:ci Changes to the CI, e.g. GitHub workflows label Aug 21, 2026

Copilot AI left a comment

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.

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 --quiet in an if conditional so set -e doesn’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.

@kthoms
kthoms merged commit 22c26df into release/2.1.x Aug 21, 2026
8 checks passed
@kthoms
kthoms deleted the backport/prepare-deploy-fix-2.1.x branch August 21, 2026 07:31
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

scope:ci Changes to the CI, e.g. GitHub workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants