Skip to content

ci: stabilise the lint job names and modernise the publish workflow - #361

Open
hf-kklein wants to merge 2 commits into
mainfrom
ci/stable-lint-job-names
Open

ci: stabilise the lint job names and modernise the publish workflow#361
hf-kklein wants to merge 2 commits into
mainfrom
ci/stable-lint-job-names

Conversation

@hf-kklein

@hf-kklein hf-kklein commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The problem

GitHub appends unnamed matrix values to a job's name, so the lint jobs report as:

Python Code Quality and Lint (linting, uv run ruff check src/mypackage unittests
)

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 merge to go on.

The fix

name: "Python Code Quality and Lint (${{ matrix.linter-env }})"

Contexts become ... (linting) / (type_check) / (spell_check) and stay stable across future edits to any
lint command. Verified on a repo already running it — the command string is no longer appended.

Also in here

  • README: the release environment needs a tag rule. A release deploys from refs/tags/vX.Y.Z, not a
    branch, so an environment restricted to main rejects every publish — and the job fails having run zero
    steps
    , with no log to read.
  • python-publish.yml on Python 3.14 (was 3.13 for tests, 3.12 for build-and-publish).
  • Removed the stray [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 the
stable names above? You set up the rulesets, so you also know which repos actually have them 😉

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ruff in uv.lock and remove an ineffective/misspelled stray [mypy] table from pyproject.toml.
  • Update the commented Python version examples in the python-publish.yml workflow 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.

Comment on lines +9 to +13
# 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>
@hf-kklein

Copy link
Copy Markdown
Contributor Author

On Copilot's point about matrix.commands still being appended to the check name — I checked this against reality rather than reasoning about it, and it does not happen. GitHub only auto-generates the (value, value) suffix when a job has no explicit name; once name is set, that string is used verbatim, matrix context included.

Observed check-run names on two repositories already running this change, both of which still have commands in the matrix:

Python Code Quality and Lint (linting)
Python Code Quality and Lint (type_check)
Python Code Quality and Lint (spell_check)

So the contexts are stable without restructuring the matrix into conditional steps. Keeping commands in the matrix is also what makes adding a linter a two-line change, which seems worth preserving.

@hf-kklein
hf-kklein requested a review from hf-krechan August 21, 2026 17:54
@hf-kklein
hf-kklein marked this pull request as ready for review August 21, 2026 17:54
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.

3 participants