ci: stabilise the lint job names and modernise the publish workflow - #361
ci: stabilise the lint job names and modernise the publish workflow#361hf-kklein wants to merge 2 commits into
Conversation
GitHub appends unnamed matrix values to a job's name, so the lint jobs were
called "Python Code Quality and Lint (linting, uv run ruff check src/mypackage
unittests)". Repositories built from this template use those strings as required
status checks in their branch ruleset - which means the moment they rename the
package away from mypackage, as every repository built from this template must,
the required checks can never report again and every pull request is blocked
permanently. Naming the jobs after the matrix key alone keeps the contexts stable
across any future edit to a lint command.
Also bumps the (commented out) publishing workflow to Python 3.14 - it pinned
3.13 for tests and 3.12 for build-and-publish, both behind the interpreters the
template already claims - and drops the stray [mypy] table, whose key was both
misspelled ("truethy-bool") and in a section mypy never reads.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adjusts CI and project configuration to make lint-related GitHub Actions check names stable across template consumers, refreshes tooling, and updates the (commented) publish-workflow example to a newer Python version.
Changes:
- Set an explicit matrix-based job name for the lint workflow to prevent required status check names from depending on template-specific paths/commands.
- Bump
ruffinuv.lockand remove an ineffective/misspelled stray[mypy]table frompyproject.toml. - Update the commented Python version examples in the
python-publish.ymlworkflow file.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| uv.lock | Updates locked ruff version from 0.16.0 to 0.16.3. |
| pyproject.toml | Removes an unused/misspelled stray [mypy] table, keeping only [tool.mypy]. |
| .github/workflows/pythonlint.yml | Changes the lint matrix job name to include matrix.linter-env for stable check contexts. |
| .github/workflows/python-publish.yml | Updates commented example python-version values to 3.14. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # the name must not depend on the commands below: repositories built from this template use it as a | ||
| # required status check in their branch ruleset, and GitHub would otherwise append the whole command | ||
| # string - so renaming the package, or any edit to a lint invocation, silently makes the required | ||
| # check unreportable and blocks every pull request | ||
| name: "Python Code Quality and Lint (${{ matrix.linter-env }})" |
A release event deploys from refs/tags/vX.Y.Z, so an environment whose deployment branch policy only allows 'main' rejects every publish. The job then fails with zero steps executed and no log, which is close to undebuggable without knowing where to look. Hit while setting up Hochfrequenz/feldstecher. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
On Copilot's point about Observed check-run names on two repositories already running this change, both of which still have So the contexts are stable without restructuring the matrix into conditional steps. Keeping |
The problem
GitHub appends unnamed matrix values to a job's name, so the lint jobs report as:
Repos built from this template use those strings as required status checks. Renaming
src/mypackage—which every such repo must do — changes the check names, so the required contexts can never report again and
every PR is blocked permanently, with only
the base branch policy prohibits the mergeto go on.The fix
Contexts become
... (linting)/(type_check)/(spell_check)and stay stable across future edits to anylint command. Verified on a repo already running it — the command string is no longer appended.
Also in here
releaseenvironment needs a tag rule. A release deploys fromrefs/tags/vX.Y.Z, not abranch, so an environment restricted to
mainrejects every publish — and the job fails having run zerosteps, with no log to read.
python-publish.ymlon Python 3.14 (was 3.13 for tests, 3.12 for build-and-publish).[mypy]table — misspelled key (truethy-bool) in a section mypy never reads.A favour to ask 🙏
@hf-krechan — this fixes new repos, but existing ones need their ruleset updated by hand: the old contexts
are unsatisfiable, so no PR there can merge until someone with admin rights swaps them. Could you go through
the repos built from this template and replace the three
Python Code Quality and Lint (...)contexts with thestable names above? You set up the rulesets, so you also know which repos actually have them 😉