Skip to content

feat(pr-checks): fix-has-test fails a fix that changes no test, unless it's visual with screenshots - #26

Draft
PiquelChips wants to merge 1 commit into
feat/pr-check-co-authorsfrom
feat/pr-check-fix-has-test
Draft

PiquelChips wants to merge 1 commit into
feat/pr-check-co-authorsfrom
feat/pr-check-fix-has-test

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

What and why

The standard says a fix comes with a test that fails without it, and a visual fix with before and after screenshots. Nothing checked either. This adds fix-has-test (MT8) to the pull request checks of #21.

  • Which pull requests: only those whose title has the type fix, as pr-title parses it. Every other type passes.
  • What counts as a test: a changed file that isn't deleted and either:
    • is a test file: under a tests/ or test/ directory, a sibling tests.rs, or another language's _test, .test, .spec or test_*.py file;
    • or adds a test attribute beside the code: #[test], #[tokio::test], #[rstest], #[test_case(…)]. The changed files come from pulls.listFiles, paginated.
  • A visual fix carries the visual label and an image in its description: Markdown, <img>, or a pasted user-attachments link. A labelled fix with no image fails and is told to add before and after screenshots. Labelling re-runs the checks, since the caller workflow listens for labeled and unlabeled.
  • Not checked: that the test fails without the fix, which would need a job that reverts the rest of the diff.
  • The crate's README lists the check. No new input.

Testing

  • 5 new Node tests (31 in all):
    • other types pass;
    • each kind of test path passes;
    • each test attribute added in a patch passes;
    • a deleted test, or a removed #[test], doesn't count;
    • a visual fix passes with each kind of image and fails without one.
  • just check-changed origin/feat/pr-check-co-authors passes.
  • Dogfood: this pull request's own PR run, whose feat title passes the check.

Checklist

  • The crate's README (its documentation on docs.rs) shows the change, and a repository's xtask can still follow it.
  • A change to the public API is noted for the next release, with what each repository's xtask must change. (No API change.)
  • just check-changed passes.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@PiquelChips
PiquelChips force-pushed the feat/pr-check-co-authors branch from d55c68a to 456981e Compare November 22, 2026 20:25
@PiquelChips
PiquelChips force-pushed the feat/pr-check-fix-has-test branch from 1982583 to e0508d2 Compare November 22, 2026 20:25
…s it's visual with screenshots

fix-has-test (MT8) reads a fix's changed files through the API: a test
file, or an added #[test] beside the code, passes, and so does the visual
label with an image in the description.
@PiquelChips
PiquelChips force-pushed the feat/pr-check-co-authors branch from 456981e to cc8bda1 Compare November 22, 2026 22:13
@PiquelChips
PiquelChips force-pushed the feat/pr-check-fix-has-test branch from e0508d2 to fc5d60b Compare November 22, 2026 22:13
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.

1 participant