Repository navigation
ci: add PR CI, title check and manual release workflow - #39
Merged
Merged
Conversation
- ci.yaml: job `test` (manage.py check + pytest), push trigger narrowed to master, workflow_call, concurrency that cannot cancel a release's test run - pr-title.yml: cz check plus bumpability and style rules on the PR title - release.yml: manual Release (test, warn, commitizen bump, deploy the tag) - release-deploy.yaml: workflow_call with a version input; TAG replaces GITHUB_REF_NAME and every checkout uses it - pyproject.toml: post_bump_hooks is an echo; the workflow pushes - CLAUDE.md, docs/RELEASE.md: describe the new flow Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJdTaQX9f79fBVtRXhPJQ7
The Check naming ruleset has no bypass for github-actions[bot] (it cannot be added), so an enforced required_status_checks rule would reject the Release bump commit. Keep that rule off and remove the "required check" and bot-bypass wording from CLAUDE.md and the workflow comments; record why and what enforcing it would take. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJdTaQX9f79fBVtRXhPJQ7
Closed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Sets up the release flow from
release-flow-spec.md(reference:chezhj/weekmenu), adapted to this repo.ci.yaml(edited in place): job renamed totest; addsmanage.py check; push trigger narrowed tomaster; addsworkflow_call;permissions: contents: read; concurrency keyed onevent_nameand only cancelling PR runs, so a push tomastercan never cancel the Release'stest. Thejsjob is kept.pr-title.yml(new):cz check --messageplus extra rules (noMerge*/Revert*/Pull request*/fixup!/squash!, lowercase subject, no trailing period, at most 72 characters). The title only reaches the script through an env var.release.yml(new): manualReleaseworkflow withincrementauto/PATCH/MINOR:test→bump(guard onmaster,fetch-depth: 0, warn-only step for unreadable commits,commitizen-action, "Nothing to release" handling) →deploy.release-deploy.yaml(edited in place, file name kept, display name now "Build & Deploy"): addsworkflow_callwith aversioninput and keeps thev*tag trigger as a manual fallback.TAGreplaces everyGITHUB_REF_NAMEand every checkout usesref: ${{ env.TAG }}.pyproject.toml:post_bump_hooksis now an echo. The oldgit push/git push --tagshooks would have pushed from inside the Actions bump. The message has no quotes or&&(Windowscmd.exewould split on it).CLAUDE.md,docs/RELEASE.md: describe the new flow (the rootCLAUDE.mdsaid deploys come fromcz bumppushing the tag; that is intentionally replaced).Differences from the reference: the
pr-titlepattern is"Merge"*, not"Merge "*, because the reference letMerge: ...through (a real title in this repo's history).The checks are not enforced, on purpose. The spec suggests a ruleset that requires
test+pr-titleand letsgithub-actions[bot]push the bump.github-actions[bot]cannot be added to a ruleset bypass list, and an enforcedrequired_status_checksrule would (per GitHub's branch-protection docs; not verified for rulesets) reject the brand-new, untested bump commit pushed withGITHUB_TOKEN. So the existing "Check naming" ruleset stays without that rule.CLAUDE.md("The checks") says so plainly and records what enforcing would take: a bypass user's token for the bump, and dropping the chaineddeployjob, because a token-pushed tag would also trigger thev*deploy. If the rule is ever enabled, the contexts aretestandpr-title; the ruleset currently listsTests, which no longer exists after the rename.No version bump (
ci:/docs(ci):).Evidence
On GitHub, on this PR's head (
360d851):test(Django system check + pytest, ~100 s),Browser helper unit testsandpr-title(both steps) all completed successfully;pr-titlealso re-ran green after the PR body was edited. The first push (bc1bdef) was green too.Run locally before pushing (commands in the session):
CI steps in a fresh clone of this branch (
poetry install,manage.py check,pytest,npm test):System check identified no issues, 545 passed (105.8 s), JS helper tests 20/20 pass. No frontend build is needed (no Vite in this repo).pr-titlescript (both steps extracted from the YAML and run with the title only inPR_TITLE), 21/21 cases as expected: 5 valid titles pass;Follow-up: fix things, no prefix,Merge branch ...,Merge: ...,Merged ...,fixup! ...,squash! ...,Revert "...",Pull request #12 ..., capitalised subject, trailing period, 73 characters, andtools:type all fail. A title containing$(touch ...), backticks and quotes passes through without executing anything (no files created).Against the last 25 real first-parent titles: 18 pass, 7 fail, all direct commits and not PR titles: 4
Merge...commits,tools: add a dry-run-only prune inspector...(unknown type, 75 chars),fix(maintenance): the dry run under-reported...(73 chars),docs: Phase 7 — README...(capitalised subject). PR-style titles such asfix(idle): keep screen on during the idle page toopass.Warn step (extracted from
release.yml, run in throwaway repos): no tag → "skipping", exit 0; clean range → "all readable", exit 0; mixed range → lists exactly the two bad commits in the step summary and a::warning, exit 0.YAML:
ci.yaml,pr-title.yml,release.yml,release-deploy.yamlparse; exactly one^on:line in each (re-checked after the last commit); triggers as intended (ci: pull_request/push/workflow_call; release: workflow_dispatch; deploy: push tags + workflow_call).cz check: passes for both commit messages and for this PR title;cz check --rev-range d4b5818..HEADpasses.Local
cz bump(throwaway clone with a scratch bare remote): bumps 2.10.2 → 2.10.3, runscheck_content_bump.py(OK), prints the echo, tags locally, and pushes nothing (remote HEAD and tag count unchanged). With no bumpable commit it exits 21 (NO_COMMITS_TO_BUMP).Not verified (can only run after merge, on
master)commitizen-actionpinned at 0.27.1 treating exit 21 as "Nothing to release", the bump/tag push,increment: PATCH|MINOR, and thebumped/tagoutputs.workflow_call(TAG/refwiring, concurrency groupsreleasevsproduction-deploy).check_content_bump.pybehaves in the Actions checkout (it needs the full fixture history; the bump job usesfetch-depth: 0).test,pr-titleand "Nothing to release" on GitHub, with checks unenforced.Manual steps for the repo owner
SSH_HOST,SSH_USER,SSH_PRIVATE_KEY,SSH_KNOWN_HOSTS, optionalSSH_PORT). The v2.10.2 deploy ran green, so they should.required_status_checksrule off (it is currentlydisabled).deletionandnon_fast_forwardare safe to enable; they do not affect the bump push.pr-titlego red, then green after fixing it.increment: autoonce.fix(idle)(fix(idle): keep screen on during the idle page too #38) is already unreleased, so expect a real 2.10.3 bump and deploy rather than "Nothing to release"; take a DB dump first only if migrations are pending.v2.10.3tag, newCHANGELOG.mdsection and the deploy smoke test.🤖 Generated with Claude Code
https://claude.ai/code/session_01YJdTaQX9f79fBVtRXhPJQ7