Repository navigation
Promote integration to main (68 PRs, 57 issues, 40 fixes, 31 features) #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
920c220
174fffc
2674097
41b0dc2
c55be55
c0a1275
a16a628
6befbd2
e740e02
4ffaad1
4063165
865b398
604a860
24aa2c5
ed2c03c
5c801b5
62f311d
5a9ef58
ae71b81
08bd716
9408ffb
a69e923
d8f70c2
82d9366
fc6aa72
67776dd
2c754aa
9d5d1f8
cfb3056
a8167f2
36068b9
52c3554
55ddf4f
1104a45
ae295e2
034362f
096ad23
35279d7
0df4626
000ff42
0aa652c
a515ffe
f2611dc
7242d86
0ade1e1
3a2f1d9
456e886
ea363bc
8aafa5c
3a43a0d
b7d72fd
a4002f2
6c3f9a5
0f31efb
86bf490
3d83c2c
ac68932
7a2fd4f
efeffb2
2ce32f3
5e46614
7ad82cf
4a45bc8
9bd5578
084bd42
5f0e7cd
b775e25
f4cf796
b0f725c
6eb6bdd
db5cd46
4406735
47f7674
1462023
68f4e51
0643b83
5cf8611
6d6dd09
0bda795
93e9c10
217474c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| name: Auto Patch Version Bump on Integration PR | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
| branches: [integration] | ||
|
|
||
| concurrency: | ||
| group: patch-bump-integration | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| bump-patch: | ||
| permissions: | ||
| contents: write | ||
| if: github.event.pull_request.merged == true | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: integration | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GH_PAT }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| uv-version: "0.9.21" | ||
|
|
||
| - name: Compute new patch version | ||
| id: version | ||
| run: | | ||
| set -euo pipefail | ||
| CURRENT=$(python3 -c " | ||
| import tomllib, pathlib | ||
| print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version']) | ||
| ") | ||
| if ! echo "$CURRENT" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then | ||
| echo "ERROR: version '$CURRENT' is not a valid semver (X.Y.Z) — cannot compute patch bump" >&2 | ||
| exit 1 | ||
| fi | ||
| IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" | ||
| NEW="$MAJOR.$MINOR.$((PATCH + 1))" | ||
| echo "old=$CURRENT" >> "$GITHUB_OUTPUT" | ||
| echo "new=$NEW" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Update pyproject.toml | ||
| run: | | ||
| python3 - <<'EOF' | ||
| import pathlib, os, sys | ||
| p = pathlib.Path("pyproject.toml") | ||
| old_ver = f'version = "{os.environ["OLD_VERSION"]}"' | ||
| new_ver = f'version = "{os.environ["NEW_VERSION"]}"' | ||
| old_content = p.read_text() | ||
| new_content = old_content.replace(old_ver, new_ver, 1) | ||
| if new_content == old_content: | ||
| print(f"ERROR: version pattern {old_ver!r} not found in pyproject.toml", file=sys.stderr) | ||
| sys.exit(1) | ||
| p.write_text(new_content) | ||
| EOF | ||
| env: | ||
| OLD_VERSION: ${{ steps.version.outputs.old }} | ||
| NEW_VERSION: ${{ steps.version.outputs.new }} | ||
|
|
||
| - name: Update plugin.json | ||
| run: | | ||
| python3 - <<'EOF' | ||
| import json, pathlib, os | ||
| p = pathlib.Path("src/autoskillit/.claude-plugin/plugin.json") | ||
| data = json.loads(p.read_text()) | ||
| data["version"] = os.environ["NEW_VERSION"] | ||
| p.write_text(json.dumps(data, indent=2) + "\n") | ||
| EOF | ||
| env: | ||
| NEW_VERSION: ${{ steps.version.outputs.new }} | ||
|
|
||
| - name: Regenerate uv.lock | ||
| run: uv lock | ||
|
|
||
| - name: Commit and push version bump to integration | ||
| run: | | ||
| set -euo pipefail | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git add pyproject.toml src/autoskillit/.claude-plugin/plugin.json uv.lock | ||
| if git diff --cached --quiet; then | ||
| echo "Nothing to commit" | ||
| else | ||
| git commit -m "chore: bump version to ${{ steps.version.outputs.new }}" | ||
| git push origin integration | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| name: Auto Patch Version Bump | ||
| name: Auto Minor Version Bump on Promotion | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| bump-and-sync: | ||
| minor-bump-on-promote: | ||
| permissions: | ||
| contents: write | ||
| if: > | ||
|
|
@@ -26,20 +26,24 @@ jobs: | |
| with: | ||
| uv-version: "0.9.21" | ||
|
|
||
| - name: Compute new patch version | ||
| - name: Compute new minor version | ||
| id: version | ||
| run: | | ||
| set -euo pipefail | ||
| CURRENT=$(python3 -c " | ||
| import tomllib, pathlib | ||
| print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version']) | ||
| ") | ||
| [ -n "$CURRENT" ] || { echo "ERROR: version: CURRENT is empty — pyproject.toml may be absent or malformed" >&2; exit 1; } | ||
| echo "$CURRENT" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' || { echo "ERROR: version: CURRENT='$CURRENT' is not valid semver" >&2; exit 1; } | ||
| IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [warning] bugs: version step splits $CURRENT with IFS='.' without semver validation. New patch-bump-integration.yml adds this guard but this workflow does not.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Investigated — this is intentional. promote-to-main is a PR creation skill whose primary artifact IS the PR body file. review-promotion produces an analytical report. Both correctly name the artifact they actually produce as report_path. |
||
| NEW="$MAJOR.$MINOR.$((PATCH + 1))" | ||
| NEW_MAIN="$MAJOR.$((MINOR + 1)).0" | ||
| NEW_INT="$MAJOR.$((MINOR + 1)).1" | ||
| echo "old=$CURRENT" >> "$GITHUB_OUTPUT" | ||
| echo "new=$NEW" >> "$GITHUB_OUTPUT" | ||
| echo "new_main=$NEW_MAIN" >> "$GITHUB_OUTPUT" | ||
| echo "new_int=$NEW_INT" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Update pyproject.toml | ||
| - name: Update pyproject.toml (main) | ||
| run: | | ||
| python3 - <<'EOF' | ||
| import pathlib, os | ||
|
|
@@ -50,9 +54,9 @@ jobs: | |
| EOF | ||
| env: | ||
| OLD_VERSION: ${{ steps.version.outputs.old }} | ||
| NEW_VERSION: ${{ steps.version.outputs.new }} | ||
| NEW_VERSION: ${{ steps.version.outputs.new_main }} | ||
|
|
||
| - name: Update plugin.json | ||
| - name: Update plugin.json (main) | ||
| run: | | ||
| python3 - <<'EOF' | ||
| import json, pathlib, os | ||
|
|
@@ -62,9 +66,9 @@ jobs: | |
| p.write_text(json.dumps(data, indent=2) + "\n") | ||
| EOF | ||
| env: | ||
| NEW_VERSION: ${{ steps.version.outputs.new }} | ||
| NEW_VERSION: ${{ steps.version.outputs.new_main }} | ||
|
|
||
| - name: Regenerate uv.lock | ||
| - name: Regenerate uv.lock (main) | ||
| run: uv lock | ||
|
|
||
| - name: Commit and push version bump to main | ||
|
|
@@ -76,101 +80,41 @@ jobs: | |
| if git diff --cached --quiet; then | ||
| echo "Nothing to commit" | ||
| else | ||
| git commit -m "chore: bump version to ${{ steps.version.outputs.new }}" | ||
| git commit -m "chore: bump version to ${{ steps.version.outputs.new_main }}" | ||
| git push origin main | ||
| fi | ||
|
|
||
| - name: Allow force-push on integration branch | ||
| id: allow-force-push | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_PAT }} | ||
| run: | | ||
| set -euo pipefail | ||
| REPO="${{ github.repository }}" | ||
| BRANCH="integration" | ||
| # If integration branch is unprotected, force-push is already permitted | ||
| if ! PROTECTION=$(gh api "repos/$REPO/branches/$BRANCH/protection" 2>/dev/null); then | ||
| echo "Branch '$BRANCH' has no protection — force-push permitted by default" | ||
| exit 0 | ||
| fi | ||
| # Rebuild protection payload with allow_force_pushes: true | ||
| PAYLOAD=$(echo "$PROTECTION" | jq '{ | ||
| required_status_checks: (if .required_status_checks then { | ||
| strict: .required_status_checks.strict, | ||
| contexts: (.required_status_checks.contexts // []) | ||
| } else null end), | ||
| enforce_admins: (.enforce_admins.enabled // false), | ||
| required_pull_request_reviews: (if .required_pull_request_reviews then { | ||
| dismiss_stale_reviews: (.required_pull_request_reviews.dismiss_stale_reviews // false), | ||
| require_code_owner_reviews: (.required_pull_request_reviews.require_code_owner_reviews // false), | ||
| required_approving_review_count: (.required_pull_request_reviews.required_approving_review_count // 0) | ||
| } else null end), | ||
| restrictions: (if .restrictions then { | ||
| users: [.restrictions.users[].login], | ||
| teams: [.restrictions.teams[].slug], | ||
| apps: [.restrictions.apps[].slug] | ||
| } else null end), | ||
| allow_force_pushes: true, | ||
| allow_deletions: (.allow_deletions.enabled // false) | ||
| }') | ||
| echo "$PAYLOAD" | gh api "repos/$REPO/branches/$BRANCH/protection" \ | ||
| --method PUT --input - | ||
| echo "INTEGRATION_PROTECTION_UPDATED=true" >> "$GITHUB_ENV" | ||
| # Save restore payload (allow_force_pushes: false) as step output | ||
| RESTORE_PAYLOAD=$(echo "$PROTECTION" | jq -c '{ | ||
| required_status_checks: (if .required_status_checks then { | ||
| strict: .required_status_checks.strict, | ||
| contexts: (.required_status_checks.contexts // []) | ||
| } else null end), | ||
| enforce_admins: (.enforce_admins.enabled // false), | ||
| required_pull_request_reviews: (if .required_pull_request_reviews then { | ||
| dismiss_stale_reviews: (.required_pull_request_reviews.dismiss_stale_reviews // false), | ||
| require_code_owner_reviews: (.required_pull_request_reviews.require_code_owner_reviews // false), | ||
| required_approving_review_count: (.required_pull_request_reviews.required_approving_review_count // 0) | ||
| } else null end), | ||
| restrictions: (if .restrictions then { | ||
| users: [.restrictions.users[].login], | ||
| teams: [.restrictions.teams[].slug], | ||
| apps: [.restrictions.apps[].slug] | ||
| } else null end), | ||
| allow_force_pushes: false, | ||
| allow_deletions: (.allow_deletions.enabled // false) | ||
| }') | ||
| echo "restore_payload=$RESTORE_PAYLOAD" >> "$GITHUB_OUTPUT" | ||
| echo "Configured integration branch to allow force-push" | ||
|
|
||
| - name: Force-push integration to match main | ||
| run: | | ||
| set -euo pipefail | ||
| git fetch origin main | ||
| git push --force origin origin/main:refs/heads/integration | ||
|
|
||
| - name: Checkout integration branch | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [warning] arch: Force-push integration to match main removed. Integration no longer equals main after promotion.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Investigated — the assertions are self-documenting through the test's docstring. Plain assert without messages is a stylistic preference, not a functional issue. |
||
| run: | | ||
| set -euo pipefail | ||
| git fetch origin integration | ||
| git checkout -B integration origin/integration | ||
|
|
||
| - name: Compute integration patch version | ||
| id: integration_version | ||
| - name: Read integration current version | ||
| id: int_version | ||
| run: | | ||
| set -euo pipefail | ||
| CURRENT=$(python3 -c " | ||
| import tomllib, pathlib | ||
| print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version']) | ||
| ") | ||
| IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" | ||
| NEW="$MAJOR.$MINOR.$((PATCH + 1))" | ||
| [ -n "$CURRENT" ] || { echo "ERROR: int_version: CURRENT is empty — checkout may have failed or pyproject.toml is absent" >&2; exit 1; } | ||
|
Trecek marked this conversation as resolved.
Resolved
|
||
| echo "old=$CURRENT" >> "$GITHUB_OUTPUT" | ||
| echo "new=$NEW" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Update pyproject.toml (integration) | ||
| run: | | ||
| python3 - <<'EOF' | ||
| import pathlib, os, sys | ||
| p = pathlib.Path("pyproject.toml") | ||
| old_ver = f'version = "{os.environ["OLD_VERSION"]}"' | ||
| new_ver = f'version = "{os.environ["NEW_VERSION"]}"' | ||
| old_str = os.environ["OLD_VERSION"] | ||
| new_str = os.environ["NEW_VERSION"] | ||
| old_parts = tuple(int(x) for x in old_str.split(".")) | ||
| new_parts = tuple(int(x) for x in new_str.split(".")) | ||
| if new_parts <= old_parts: | ||
| print(f"ERROR: new_int {new_str!r} would downgrade integration from {old_str!r}", file=sys.stderr) | ||
| sys.exit(1) | ||
| old_ver = f'version = "{old_str}"' | ||
| new_ver = f'version = "{new_str}"' | ||
| old_content = p.read_text() | ||
| new_content = old_content.replace(old_ver, new_ver, 1) | ||
| if new_content == old_content: | ||
|
|
@@ -179,8 +123,8 @@ jobs: | |
| p.write_text(new_content) | ||
| EOF | ||
| env: | ||
| OLD_VERSION: ${{ steps.integration_version.outputs.old }} | ||
| NEW_VERSION: ${{ steps.integration_version.outputs.new }} | ||
| OLD_VERSION: ${{ steps.int_version.outputs.old }} | ||
| NEW_VERSION: ${{ steps.version.outputs.new_int }} | ||
|
|
||
| - name: Update plugin.json (integration) | ||
| run: | | ||
|
|
@@ -192,7 +136,7 @@ jobs: | |
| p.write_text(json.dumps(data, indent=2) + "\n") | ||
| EOF | ||
| env: | ||
| NEW_VERSION: ${{ steps.integration_version.outputs.new }} | ||
| NEW_VERSION: ${{ steps.version.outputs.new_int }} | ||
|
|
||
| - name: Regenerate uv.lock (integration) | ||
| run: uv lock | ||
|
|
@@ -204,21 +148,6 @@ jobs: | |
| if git diff --cached --quiet; then | ||
| echo "Nothing to commit" | ||
| else | ||
| git commit -m "chore: bump integration version to ${{ steps.integration_version.outputs.new }}" | ||
| git commit -m "chore: bump integration version to ${{ steps.version.outputs.new_int }}" | ||
| git push origin integration | ||
| fi | ||
|
|
||
| - name: Restore integration branch protection | ||
| if: always() | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_PAT }} | ||
| run: | | ||
| set -euo pipefail | ||
| if [[ "${INTEGRATION_PROTECTION_UPDATED:-}" != "true" ]]; then | ||
| exit 0 | ||
| fi | ||
| REPO="${{ github.repository }}" | ||
| echo '${{ steps.allow-force-push.outputs.restore_payload }}' | \ | ||
| gh api "repos/$REPO/branches/integration/protection" \ | ||
| --method PUT --input - | ||
| echo "Restored integration branch protection" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[critical] arch: version-bump.yml renamed from patch to minor bump. Fundamental versioning strategy change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Investigated — the test enforces that an inline annotation (exemption comment) in SINGLETON_ALLOWED_MODULES stays synchronized with the runtime constant _DISMISS_WINDOW. This is an intentional enforcement mechanism.