-
Notifications
You must be signed in to change notification settings - Fork 3
ci: harden and document the release procedure #268
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
Open
Kyleasmth
wants to merge
18
commits into
main
Choose a base branch
from
ks/YPE-2486-release-hardening
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f36c871
chore: add release runbook, hardening plan, and commit-lint
Kyleasmth a632f78
fix: pin commitlint to v19 for Node 20 compatibility
Kyleasmth f0c6ada
ci: anchor commitlint range at merge-base with full main fetch
Kyleasmth a8b7376
fix: use per-package tags in runbook and tighten release-commit ignore
Kyleasmth 70ff2cc
Merge branch 'main' into ks/YPE-2486-release-hardening
jhampton 854cb99
docs: add open-decisions record for release hardening
Kyleasmth 11c1080
ci: enforce conventional PR titles, drop commitlint ticket prefix
Kyleasmth 4747b00
chore: run git hooks via corepack pnpm with a pnpm fallback
Kyleasmth 448c0da
ci: require a changeset on every PR
Kyleasmth 2e46be2
ci: document the intentional per-workflow Node version split
Kyleasmth bf5512a
docs: record release-hardening decisions and add greptile/AGENTS guar…
Kyleasmth a379ee7
chore: add empty changeset for release-hardening (no release)
Kyleasmth 3c348c6
docs: record Decision 3 Node floor at 22.13, resolved by main's pnpm …
Kyleasmth 045cd27
Merge origin/main; align release-hardening to pnpm 11 / Node 24 (floo…
Kyleasmth 7f7ece4
ci: ignore merge commits in commitlint config
Kyleasmth c0cd9c6
Merge branch 'main' into ks/YPE-2486-release-hardening
jhampton 3131679
Merge remote-tracking branch 'origin/main' into ks/YPE-2486-release-h…
Kyleasmth 97d82b7
Merge branch 'main' into ks/YPE-2486-release-hardening
jhampton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| --- | ||
|
|
||
| Release-process hardening: CI guardrails (conventional PR titles, required | ||
| changesets), corepack-aware git hooks, documented Node policy, and review | ||
| rules. No package changes — intentionally empty (no release). |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: Changeset | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| require-changeset: | ||
| name: Require Changeset | ||
| runs-on: ubuntu-latest | ||
| # The Changesets "version packages" PR (branch changeset-release/main) | ||
| # consumes changesets and legitimately contains none — exempt it. | ||
| if: github.head_ref != 'changeset-release/main' | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| # Fail the PR unless it adds a changeset. Every PR needs one; for a genuine | ||
| # no-release change (CI, docs, tooling) add an intentional empty changeset | ||
| # with `pnpm changeset --empty`, which still writes a .changeset/*.md file | ||
| # and satisfies this gate. See docs/release-hardening-decisions.md (Decision 4). | ||
| # | ||
| # We check for an added changeset file directly rather than using | ||
| # `changeset status --since`: in the pinned @changesets/cli that command | ||
| # exits 0 even when no changeset exists, so it cannot gate. | ||
| - name: Require a changeset | ||
| env: | ||
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| run: | | ||
| set -euo pipefail | ||
| git fetch --no-tags origin main:refs/remotes/origin/main | ||
| base=$(git merge-base origin/main "$HEAD_SHA") | ||
| changed=$(git diff --name-only --diff-filter=d "$base".."$HEAD_SHA" -- .changeset \ | ||
| | grep -E '\.changeset/.+\.md$' \ | ||
| | grep -vE '\.changeset/README\.md$' || true) | ||
| if [ -z "$changed" ]; then | ||
| echo "::error::No changeset found on this PR. Run 'pnpm changeset' to describe the release, or 'pnpm changeset --empty' for a no-release change (CI/docs/tooling)." | ||
| exit 1 | ||
| fi | ||
| echo "Changeset(s) detected:" | ||
| echo "$changed" |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Commitlint | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| commitlint: | ||
| name: Lint Commit Messages | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| # Node 24 LTS, matching the rest of CI (pnpm 11 floor is Node 22.13). | ||
| # See docs/release-hardening-decisions.md (Decision 3). | ||
| node-version: 24 | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| # Lint only the commits this branch adds, using the merge-base with the | ||
| # live origin/main as the lower bound (not the PR's recorded base SHA, | ||
| # which goes stale as main moves forward). The merge-base is robust even | ||
| # when the branch is behind main: it always resolves to the point where | ||
| # this branch diverged, so the range is exactly the new commits. | ||
| # | ||
| # main MUST be fetched with full history (no --depth). A shallow fetch | ||
| # hides the merge-base, so `git log <main>..HEAD` can no longer exclude | ||
| # shared history and the range balloons to include unrelated historical | ||
| # commits. See docs/release-hardening-plan.md (AC6). | ||
| - name: Resolve lint range | ||
| id: range | ||
| env: | ||
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| run: | | ||
| set -euo pipefail | ||
| git fetch --no-tags origin main:refs/remotes/origin/main | ||
| base=$(git merge-base origin/main "$HEAD_SHA") | ||
| echo "base=${base}" >> "$GITHUB_OUTPUT" | ||
| echo "Linting ${base}..${HEAD_SHA}" | ||
|
|
||
| - name: Lint commits | ||
| run: pnpm exec commitlint --from ${{ steps.range.outputs.base }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: PR Title | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| lint-pr-title: | ||
| name: Lint PR Title | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # We squash-merge, so the PR title becomes the landing commit on main and | ||
| # must be Conventional Commits. Ticket references (YPE-1234) belong in the | ||
| # branch name / PR body, not the title. This is the real commit-format | ||
| # gate; the per-commit husky/commitlint hook is only a local dev aid. | ||
| # See docs/release-hardening-decisions.md (Decision 1). | ||
| - uses: amannn/action-semantic-pull-request@v6 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Prefer corepack so the repo-pinned pnpm (packageManager in package.json) runs | ||
| # regardless of what's on PATH. Fall back to pnpm directly where corepack isn't | ||
| # available — Node 25+ no longer bundles it, and nvm/global-pnpm setups may lack | ||
| # it. See docs/release-hardening-decisions.md (Decision 2). | ||
| if command -v corepack >/dev/null 2>&1; then | ||
| corepack pnpm exec commitlint --edit "$1" | ||
| else | ||
| pnpm exec commitlint --edit "$1" | ||
| fi |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,9 @@ | ||
| pnpm lint-staged | ||
| # Prefer corepack so the repo-pinned pnpm (packageManager in package.json) runs | ||
| # regardless of what's on PATH. Fall back to pnpm directly where corepack isn't | ||
| # available — Node 25+ no longer bundles it, and nvm/global-pnpm setups may lack | ||
| # it. See docs/release-hardening-decisions.md (Decision 2). | ||
| if command -v corepack >/dev/null 2>&1; then | ||
| corepack pnpm lint-staged | ||
| else | ||
| pnpm lint-staged | ||
| fi |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.