Skip to content

ci: run type, template and migration checks - #234

Closed
JediBrooker wants to merge 1 commit into
markbeep:mainfrom
JediBrooker:ci/run-types-and-migration-checks
Closed

JediBrooker wants to merge 1 commit into
markbeep:mainfrom
JediBrooker:ci/run-types-and-migration-checks

Conversation

@JediBrooker

Copy link
Copy Markdown

What

The workflow is named Test types but only runs just test_format. just types and just test_jinja are both defined in the justfile with nothing calling them, so a type error or a template that fails to render can reach main.

This wires up what's already there and adds the migration check CONTRIBUTING asks contributors to run by hand.

Changes

Runs the existing recipes

  • just typesbasedpyright, which the justfile already defines
  • just test_jinjaapp/util/test_jinjax.py, likewise

New check_migrations recipe

check_migrations:
    uv run alembic upgrade heads
    uv run alembic check

CONTRIBUTING already says "Ensure there are no missing migrations: uv run alembic check", so this just stops it being a thing people have to remember. Needs ABR_APP__CONFIG_DIR set, which the workflow does; alembic/env.py already creates the directory, so no setup step is needed.

Fixes when the workflow runs

  • Adds a pull_request trigger. build.yaml has one and this workflow didn't, so none of these checks ran on a pull request at all — only on pushes to branches in this repo. Same path list as the push trigger, matching how build.yaml does it.
  • Adds **.jinja to the paths. Template changes didn't trigger the workflow before, despite templates being the main thing test_format checks.
  • Adds justfile and uv.lock, since changes to either can break the checks.

Renamed the job to Format, types and migrations so the name matches what it does.

Checked

Ran all four steps against a clean checkout of main:

Step Result
just test_format djlint 0 files would be updated, ruff 88 files already formatted
just types 0 errors, 0 warnings, 0 notes
just test_jinja Tested 63 templates, 0 failed
just check_migrations No new upgrade operations detected

So this shouldn't turn anything red on merge — it's all currently passing, just not being run.

Written with AI assistance.

The workflow was named "Test types" but only ran `just test_format`, so
`just types` and `just test_jinja` existed in the justfile without
anything calling them. A type error or a template that fails to render
could reach main.

Adds both to the workflow, plus a new `check_migrations` recipe that runs
`alembic upgrade heads` followed by `alembic check`, which CONTRIBUTING
already asks contributors to run by hand.

Also fixes when the workflow runs:

- adds a `pull_request` trigger. build.yaml has one, this workflow did
  not, so none of these checks ran on a pull request at all.
- adds `**.jinja`, `justfile` and `uv.lock` to the paths. Template changes
  did not trigger the workflow before, despite being what `test_format`
  mainly checks.
@markbeep

Copy link
Copy Markdown
Owner

All the necessary checks are already performed in the build(/test) pipeline: https://github.com/markbeep/AudioBookRequest/blob/main/.github/workflows/build.yaml

This change is not necessary.

@markbeep markbeep closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants