PH0.6 — CI pipeline #61

Open
bart wants to merge 6 commits from feature/ci-pipeline into main
Collaborator

Description

Sets up automated checks that run on every pull request, so problems get caught before merge instead of after: backend and frontend code style/type/test checks, a check that generated files (API spec, lockfiles) are actually kept up to date, a check that we never end up with two conflicting database migrations in flight at once, and a check that commit messages follow our conventions. The same checks can also be run locally before committing.

Closes #8 (PH0.6).

Type of Change

  • New feature
  • Chore / build / CI
  • Bug fix
  • Refactor / cleanup (no behaviour change)
  • Documentation
  • Breaking change

Breaking Changes

None.

Test Plan

Every check was verified against its actual failure case, not just the happy path (e.g. confirmed the freshness check fails when a generated file is stale, confirmed the migration-heads check fails on a real conflicting pair, confirmed commitlint flags real non-compliant commit messages). What I can't confirm from here: whether this Forgejo server currently has a runner registered to actually execute these checks — they dispatch correctly when a PR opens, but nothing picked up the work during testing. Someone with admin access needs to check the runner registration, otherwise these checks will sit pending rather than passing or failing.

Checklist

  • Conventional commit(s), one logical change per commit
  • Tests added/updated and passing (verified failure-case behaviour for each check)
  • docs/ updated for any behavioural change
  • No hard deletes; no direct status updates outside polaris.domain
  • No business logic in routers/components
  • Migration included if the schema changed — n/a
  • No new dependency without a reason in the commit body

Additional Context

None beyond the runner-registration note above.

🤖 Generated with Claude Code

https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM

## Description Sets up automated checks that run on every pull request, so problems get caught before merge instead of after: backend and frontend code style/type/test checks, a check that generated files (API spec, lockfiles) are actually kept up to date, a check that we never end up with two conflicting database migrations in flight at once, and a check that commit messages follow our conventions. The same checks can also be run locally before committing. ## Related Issues Closes #8 (PH0.6). ## Type of Change - [ ] New feature - [x] Chore / build / CI - [ ] Bug fix - [ ] Refactor / cleanup (no behaviour change) - [ ] Documentation - [ ] Breaking change ## Breaking Changes None. ## Test Plan Every check was verified against its actual failure case, not just the happy path (e.g. confirmed the freshness check fails when a generated file is stale, confirmed the migration-heads check fails on a real conflicting pair, confirmed commitlint flags real non-compliant commit messages). What I can't confirm from here: whether this Forgejo server currently has a runner registered to actually execute these checks — they dispatch correctly when a PR opens, but nothing picked up the work during testing. Someone with admin access needs to check the runner registration, otherwise these checks will sit pending rather than passing or failing. ## Checklist - [x] Conventional commit(s), one logical change per commit - [x] Tests added/updated and passing (verified failure-case behaviour for each check) - [x] `docs/` updated for any behavioural change - [x] No hard deletes; no direct status updates outside `polaris.domain` - [x] No business logic in routers/components - [ ] Migration included if the schema changed — n/a - [x] No new dependency without a reason in the commit body ## Additional Context None beyond the runner-registration note above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM
Adds .forgejo/workflows/backend.yml (PH0.6, docs/12-implementation-plan.md):
ruff check, ruff format --check, mypy --strict, pytest, `uv lock --check`,
openapi.json freshness against `polaris openapi`, and an alembic-heads
count check, each as its own job for fast independent feedback.

tests/conftest.py (sealed, PH0.2) launches its own Postgres via
testcontainers rather than reading a DATABASE_URL, so the pytest job needs
a live Docker daemon reachable from the runner (Docker-in-Docker, or the
host socket passed through) rather than a `services:` Postgres sidecar —
noted in-file since whether this Forgejo instance's runners expose Docker
to the job is a runner-level setting this session could not verify.

Also adds a local composite action (.forgejo/actions/setup-uv) shared by
every job in this workflow, installing uv via the official script instead
of a marketplace action whose availability on this instance is unverified.

Refs: #8

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM
Adds .forgejo/workflows/frontend.yml (PH0.6): eslint, the vitest unit
suite (`ng test --watch=false`), the i18n key-parity script, and a build
job that runs api:gen then `ng build`. `npm ci` in every job doubles as
the package-lock.json/package.json reproducibility check the ticket asks
for — it fails outright on a lockfile that doesn't satisfy package.json,
so no separate step is needed.

Refs: #8

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM
commitlint.config.js at the repo root encodes CLAUDE.md's Conventional
Commit rules (the eleven allowed types, the fifteen allowed scopes,
72-char header limit, no trailing full stop). Verified against this
repo's own commit history and against the exact examples in CLAUDE.md's
Git section before committing: mixed-case identifiers like PKCE, RFC 9457
and CLAUDE.md in a subject are not flagged (only sentence-/start-/pascal-/
upper-case subjects are, matching @commitlint/config-conventional's actual
default rather than a blanket lower-case rule, which would have false-
positived on this repo's own acronym-heavy commit style).

.forgejo/workflows/commitlint.yml lints both the PR title and every commit
in the PR's range on each pull_request event.

Refs: #8

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM
.pre-commit-config.yaml runs the same checks as .forgejo/workflows/
backend.yml and frontend.yml locally: ruff check, ruff format --check,
mypy --strict, eslint, the i18n parity script, and commitlint on
commit-msg. Uses local/system hooks that shell out to `uv run` / `npm
run` rather than pre-commit's own mirrored-tool repos, so the tool
versions stay pinned to backend/uv.lock and frontend/package-lock.json —
the ones CI actually installs — instead of a second independent pin.

Refs: #8

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM
cliff.toml, per docs/10-dev-workflow.md ("CHANGELOG.md generated from
Conventional Commits (git-cliff)"). Config only, not wired into a
workflow: changelog generation happens at release/tag time, which PH0.6
(every-PR checks) doesn't cover.

Refs: #8

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM
docs: correct PH0.6's CI path from .github to .forgejo
Some checks failed
backend / mypy (pull_request) Failing after 31s
backend / pytest (pull_request) Failing after 37s
backend / uv-lock-check (pull_request) Failing after 35s
backend / openapi-freshness (pull_request) Failing after 31s
backend / alembic-single-head (pull_request) Failing after 31s
frontend / eslint (pull_request) Failing after 31s
frontend / vitest (pull_request) Failing after 44s
frontend / build (pull_request) Failing after 31s
frontend / i18n-parity (pull_request) Failing after 1s
commitlint / commitlint (pull_request) Failing after 41s
backend / ruff (pull_request) Failing after 37s
74f341bd7d
This repo is hosted on Forgejo (CLAUDE.md's Tickets section), not GitHub.
Forgejo Actions is GitHub-Actions-syntax-compatible but only discovers
workflow files under .forgejo/workflows/, not .github/workflows/. Fixes
the stale wording in the PH0.6 row of docs/12-implementation-plan.md and
in docs/10-dev-workflow.md's repo-layout comment — both written before the
project moved off GitHub-flavoured assumptions.

Two other .github references remain in docs/12-implementation-plan.md
(the PH1 "sealed after PH1" file list, and the PH6.5/e2e row) — out of
PH0.6's explicit scope per this ticket's own brief, left for whoever
touches those rows next; flagged on issue #8.

Refs: #8

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM
Some checks failed
backend / mypy (pull_request) Failing after 31s
backend / pytest (pull_request) Failing after 37s
backend / uv-lock-check (pull_request) Failing after 35s
backend / openapi-freshness (pull_request) Failing after 31s
backend / alembic-single-head (pull_request) Failing after 31s
frontend / eslint (pull_request) Failing after 31s
frontend / vitest (pull_request) Failing after 44s
frontend / build (pull_request) Failing after 31s
frontend / i18n-parity (pull_request) Failing after 1s
commitlint / commitlint (pull_request) Failing after 41s
backend / ruff (pull_request) Failing after 37s
This pull request has changes conflicting with the target branch.
  • docs/12-implementation-plan.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/ci-pipeline:feature/ci-pipeline
git switch feature/ci-pipeline

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feature/ci-pipeline
git switch feature/ci-pipeline
git rebase main
git switch main
git merge --ff-only feature/ci-pipeline
git switch feature/ci-pipeline
git rebase main
git switch main
git merge --no-ff feature/ci-pipeline
git switch main
git merge --squash feature/ci-pipeline
git switch main
git merge --ff-only feature/ci-pipeline
git switch main
git merge feature/ci-pipeline
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
patrick/Polaris!61
No description provided.