Compare commits

...
Author SHA1 Message Date
james.maesandClaude Opus 5.5 1b2e22fb29 fix: refuse release candidate tag builds instead of incrementing the RC (#20)
An RC tag build was treated as a release/X.Y branch build, so
handle_release_branch incremented the pom's RC and mvn_publish deployed
the tagged code under the next RC number (qbit-sql-workbench 1.0.0-RC.3,
qbit-assistant 0.1.0-RC.2). RC tags are bookkeeping only; RCs publish
from release/* branch builds. Exit non-zero with a clear message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:05:30 -05:00
3 changed files with 37 additions and 3 deletions

No files matched your search

+3
View File
@@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for `[major]` and `[minor]` commit keywords to control version bumps (default: patch)
- Security scanning job with Gitleaks, Semgrep, OWASP Dependency Check, and CycloneDX SBOM
### Fixed
- `calculate_version.sh` now refuses (exits non-zero) on a release candidate tag build (`vX.Y.Z-RC.N`) instead of treating it as a release branch, which incremented the RC and republished the tagged code under the next RC number (#20)
## [0.6.2] - 2026-01-30
### Fixed
+10 -3
View File
@@ -78,9 +78,16 @@ if [[ "$CURRENT_BRANCH" == "HEAD" ]]; then
echo "This is a production release tag, treating as main branch"
CURRENT_BRANCH="main"
elif [[ "$CURRENT_TAG" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)-RC\.[0-9]+$ ]]; then
echo "This is a release candidate tag, treating as release branch"
CURRENT_BRANCH="release/${CURRENT_TAG#v}"
CURRENT_BRANCH="release/${CURRENT_BRANCH%-RC.*}"
########################################################################
## RC tags are bookkeeping only: release/* branch builds publish RCs. ##
## Treating the tag as a release branch would increment the pom's RC ##
## and republish the tagged code under the next RC number (GH-20). ##
########################################################################
echo "ERROR: Refusing to calculate a version for release candidate tag: $CURRENT_TAG"
echo "RC tags are bookkeeping only; release candidates are published by release/* branch builds."
echo "A tag build would increment the RC and republish this code under the next RC number."
echo 'Restrict the publish workflow tag filter to GA tags, for example: /^v\d+\.\d+\.\d+$/'
exit 1
elif [[ "$CURRENT_TAG" =~ ^publish- ]]; then
echo "This is a publish tag for feature branch, treating as feature branch"
CURRENT_BRANCH=$(find_original_feature_branch)
+24
View File
@@ -457,6 +457,30 @@ test_edge_cases() {
TESTS_FAILED=$((TESTS_FAILED + 1))
fi
#################################################################
## Test 1b: RC tag build must refuse, never increment (GH-20) ##
#################################################################
echo "🧪 Test: RC tag build refuses instead of incrementing (should fail)"
TESTS_RUN=$((TESTS_RUN + 1))
create_test_pom "1.5.0-RC.2"
create_test_branch "HEAD" "v1.5.0-RC.2"
cd "$TEST_DIR"
exit_code=0
output=$(cd "$TEST_DIR" && POM_FILE=pom.xml "$CALCULATE_VERSION_SCRIPT" --dry-run 2>&1) || exit_code=$?
if [[ $exit_code -ne 0 ]] \
&& [[ "$output" == *"Refusing to calculate a version for release candidate tag: v1.5.0-RC.2"* ]] \
&& [[ "$output" != *"1.5.0-RC.3"* ]]; then
echo " ✅ PASSED: Script refused the RC tag build"
TESTS_PASSED=$((TESTS_PASSED + 1))
else
echo " ❌ FAILED: Script should refuse RC tag builds (exit $exit_code)"
echo " Output: $output"
TESTS_FAILED=$((TESTS_FAILED + 1))
fi
#################################
## Test 2: Unknown branch type ##
#################################