fix(ci): improve versioning and error handling
Addresses remaining high-priority code review feedback: VERSIONING SCHEME FIXES: - Helm chart: Changed from pep440 to semver (correct for Helm) - Astrolabe: Changed from pep440 to semver (correct for Nextcloud apps) - MCP server: Remains pep440 (correct for Python packages) Helm charts must use semantic versioning per Helm specification. Nextcloud apps use semantic versioning in info.xml and package.json. ENHANCED ERROR HANDLING IN BUMP SCRIPTS: All three bump scripts now include: - Comprehensive validation checks * Tool availability (uv) * Directory structure (must run from repo root) * Required files exist (Chart.yaml, info.xml, package.json) - Better error messages * Stderr output for errors * Captured commitizen output on failure * Common failure causes listed - Success confirmation * Clear indication of what was updated * Next steps guidance (git push --follow-tags) - Robust shell options (set -euo pipefail) Scripts now provide helpful guidance when: - No conventional commits found - No commits with required scope - Git working directory not clean - Required dependencies missing
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
name = "cz_conventional_commits"
|
||||
version = "0.53.0"
|
||||
tag_format = "nextcloud-mcp-server-$version"
|
||||
version_scheme = "pep440"
|
||||
version_scheme = "semver"
|
||||
update_changelog_on_bump = true
|
||||
major_version_zero = true
|
||||
|
||||
|
||||
@@ -1,17 +1,56 @@
|
||||
#!/bin/bash
|
||||
# Bump Astrolabe app version
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
# Validate dependencies
|
||||
command -v uv >/dev/null 2>&1 || { echo "Error: uv not found. Install from https://docs.astral.sh/uv/"; exit 1; }
|
||||
command -v uv >/dev/null 2>&1 || {
|
||||
echo "❌ Error: uv not found" >&2
|
||||
echo " Install from https://docs.astral.sh/uv/" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Validate Astrolabe directory exists
|
||||
if [ ! -d "third_party/astrolabe" ]; then
|
||||
echo "❌ Error: Must run from repository root (third_party/astrolabe not found)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd third_party/astrolabe
|
||||
|
||||
echo "Bumping Astrolabe version..."
|
||||
uv run cz --config .cz.toml bump --yes
|
||||
# Validate required files exist
|
||||
if [ ! -f "appinfo/info.xml" ]; then
|
||||
echo "❌ Error: appinfo/info.xml not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✓ Astrolabe version bumped"
|
||||
echo " - Updated: appinfo/info.xml, package.json"
|
||||
echo " - Tag format: astrolabe-v\${version}"
|
||||
if [ ! -f "package.json" ]; then
|
||||
echo "❌ Error: package.json not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Bumping Astrolabe version..."
|
||||
|
||||
# Run commitizen bump and capture output
|
||||
if ! output=$(uv run cz --config .cz.toml bump --yes 2>&1); then
|
||||
cd ../..
|
||||
echo "❌ Error: Version bump failed" >&2
|
||||
echo "$output" >&2
|
||||
echo "" >&2
|
||||
echo "Common causes:" >&2
|
||||
echo " - No commits with scope 'astrolabe' since last version" >&2
|
||||
echo " - No conventional commits found (use feat(astrolabe):, fix(astrolabe):, etc.)" >&2
|
||||
echo " - Git working directory not clean" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$output"
|
||||
echo ""
|
||||
echo "✓ Astrolabe version bumped successfully"
|
||||
echo " Updated: appinfo/info.xml, package.json"
|
||||
echo " Tag format: astrolabe-v\${version}"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " cd ../.."
|
||||
echo " git push --follow-tags"
|
||||
|
||||
cd ../..
|
||||
|
||||
+42
-8
@@ -1,18 +1,52 @@
|
||||
#!/bin/bash
|
||||
# Bump Helm chart version
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
# Validate dependencies
|
||||
command -v uv >/dev/null 2>&1 || { echo "Error: uv not found. Install from https://docs.astral.sh/uv/"; exit 1; }
|
||||
command -v uv >/dev/null 2>&1 || {
|
||||
echo "❌ Error: uv not found" >&2
|
||||
echo " Install from https://docs.astral.sh/uv/" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Validate Helm chart directory exists
|
||||
if [ ! -d "charts/nextcloud-mcp-server" ]; then
|
||||
echo "❌ Error: Must run from repository root (charts/ not found)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd charts/nextcloud-mcp-server
|
||||
|
||||
echo "Bumping Helm chart version..."
|
||||
uv run cz --config .cz.toml bump --yes
|
||||
# Validate Chart.yaml exists
|
||||
if [ ! -f "Chart.yaml" ]; then
|
||||
echo "❌ Error: Chart.yaml not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✓ Helm chart version bumped"
|
||||
echo " - Updated: Chart.yaml:version"
|
||||
echo " - Tag format: nextcloud-mcp-server-\${version}"
|
||||
echo " - Note: appVersion stays at MCP server version"
|
||||
echo "Bumping Helm chart version..."
|
||||
|
||||
# Run commitizen bump and capture output
|
||||
if ! output=$(uv run cz --config .cz.toml bump --yes 2>&1); then
|
||||
cd ../..
|
||||
echo "❌ Error: Version bump failed" >&2
|
||||
echo "$output" >&2
|
||||
echo "" >&2
|
||||
echo "Common causes:" >&2
|
||||
echo " - No commits with scope 'helm' since last version" >&2
|
||||
echo " - No conventional commits found (use feat(helm):, fix(helm):, etc.)" >&2
|
||||
echo " - Git working directory not clean" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$output"
|
||||
echo ""
|
||||
echo "✓ Helm chart version bumped successfully"
|
||||
echo " Updated: Chart.yaml:version"
|
||||
echo " Tag format: nextcloud-mcp-server-\${version}"
|
||||
echo " Note: appVersion stays at MCP server version"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " cd ../.."
|
||||
echo " git push --follow-tags"
|
||||
|
||||
cd ../..
|
||||
|
||||
+32
-6
@@ -1,13 +1,39 @@
|
||||
#!/bin/bash
|
||||
# Bump MCP server version
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
# Validate dependencies
|
||||
command -v uv >/dev/null 2>&1 || { echo "Error: uv not found. Install from https://docs.astral.sh/uv/"; exit 1; }
|
||||
command -v uv >/dev/null 2>&1 || {
|
||||
echo "❌ Error: uv not found" >&2
|
||||
echo " Install from https://docs.astral.sh/uv/" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Validate we're in the repository root
|
||||
if [ ! -f "pyproject.toml" ]; then
|
||||
echo "❌ Error: Must run from repository root (pyproject.toml not found)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Bumping MCP server version..."
|
||||
uv run cz bump --yes
|
||||
|
||||
echo "✓ MCP server version bumped"
|
||||
echo " - Updated: pyproject.toml, Chart.yaml:appVersion"
|
||||
echo " - Tag format: v\${version}"
|
||||
# Run commitizen bump and capture output
|
||||
if ! output=$(uv run cz bump --yes 2>&1); then
|
||||
echo "❌ Error: Version bump failed" >&2
|
||||
echo "$output" >&2
|
||||
echo "" >&2
|
||||
echo "Common causes:" >&2
|
||||
echo " - No commits since last version" >&2
|
||||
echo " - No conventional commits found (use feat:, fix:, etc.)" >&2
|
||||
echo " - Git working directory not clean" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$output"
|
||||
echo ""
|
||||
echo "✓ MCP server version bumped successfully"
|
||||
echo " Updated: pyproject.toml, Chart.yaml:appVersion"
|
||||
echo " Tag format: v\${version}"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " git push --follow-tags"
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
name = "cz_conventional_commits"
|
||||
version = "0.1.0"
|
||||
tag_format = "astrolabe-v$version"
|
||||
version_scheme = "pep440"
|
||||
version_scheme = "semver"
|
||||
update_changelog_on_bump = true
|
||||
major_version_zero = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user