Skip to content

ci(ci): add pull request checks - #2

Merged
DmitriyG1 merged 6 commits into
mainfrom
ci/add-checks
Nov 17, 2026
Merged

DmitriyG1 merged 6 commits into
mainfrom
ci/add-checks

Conversation

@DmitriyG1

@DmitriyG1 DmitriyG1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

Six commits:

  1. fix(scripts): make the broken json test pass on every python — the test on main fails on Python 3.12 and older: a trailing comma is reported on line 2 by Python 3.13+ and on line 3 by older ones. The test now uses a missing comma, which every version reports the same way. First, so every later commit passes the tests on Python 3.9.
  2. fix(scripts): run the gradle test outside a gradle build — the test looked for gradlew at the root of the Gradle build that holds the skill. There is none in this repository, so with RUN_GRADLE_TESTS=1 it stopped with "cannot find the project root". It now takes $GRADLE (a path, made absolute, or a command name on PATH), then the gradlew of the Gradle build that holds the skill, then gradle on PATH, and fails instead of skipping when no Gradle is found. Test-only, so no release.
  3. ci(ci): add pull request checks — .github/workflows/ci.yml and .github/commitlint.config.mjs, four jobs on every pull request to main:
    • Tests: unittest discover on Python 3.9 (the oldest supported, the python3 of macOS) and on the newest stable Python (3.x), in one job so the check keeps its name.
    • Plugin validation: claude plugin validate . --profile directory (Claude Code 2.1.317, no API key). Fails on ✘ problems, including what the plugin directory refuses; warnings (⚠ CLAUDE.md at the root, no icon) pass.
    • Commit messages: commitlint checks every commit against .github/commitlint.config.mjs (types and scopes from AGENTS.md, scope required, header ≤ 72, lowercase summary, no trailing period); then merge commits and unsquashed fixup!/squash!/amend! commits fail, reported even when commitlint failed.
    • Gradle test: always runs, so it can be a required check. It runs Gradle (JDK 17, Gradle 9.7.1) with RUN_GRADLE_TESTS=1 only when a file the Gradle test depends on changes: audit-facts.init.gradle, facts.py, common.py, tests/test_facts.py, tests/fixtures.py or the workflow itself.
    • Actions are pinned to commit SHAs, with permissions: contents: read and persist-credentials: false.
  4. docs(repo): describe the ci checks in agents.md — .github/ in the layout, Python 3.9 + newest in Scripts, Gradle on PATH or in GRADLE in Tests, the four checks under Pull requests.
  5. docs(docs): require python 3.9 or later — both READMEs, Requirements.
  6. ci(ci): pin the npm tools with lock files and cache them — .github/tools/claude-code/ and .github/tools/commitlint/, each with package.json and package-lock.json (every dependency pinned, with integrity hashes), installed with npm ci; setup-node caches the downloads for later runs of the same PR. Two folders, so Commit messages does not download Claude Code (about 300 MB).

Why

PRs are rebase-merged, so every commit reaches main and has to be checked one by one. The ruleset main now requires the four job names as status checks (added after this PR's first run; nothing else in the ruleset changed).

How it was tested

  • Unit tests on every commit of the branch: 87 run, 1 skipped, on Python 3.9.6; the final commit also on 3.14. With RUN_GRADLE_TESTS=1 and Gradle 9.7.1: 87 run, 0 skipped, also with a relative GRADLE=./gradle. With no Gradle: fails with "no Gradle"; with a GRADLE that does not exist: fails with GRADLE=<value>: no such file or command.
  • CI: Tests on 3.9.25 and 3.15.2; Gradle test ran Gradle (87 run, none skipped).
  • claude plugin validate . --profile directory (2.1.317), run locally with an empty HOME and no credentials: exit 0 with 2 warnings. On a copy without README.md: exit 1 (without --profile directory it was exit 0).
  • commitlint 21.2.4 with this config: all commits on main and on this branch pass. Wrong type, missing or unknown scope, capitalized summary, trailing period, header over 72, fixup! and merge messages all fail.
  • Agent: Claude Code (Claude Opus 5.5).

Review history

The review fixes were made as fixup! commits and folded into the commits above before merging. The branch as it was before folding is kept as archive/pr-2-review (482320c):

TODO (not in this PR)

  • Minimum Python version. Done in this PR after review: Python 3.9 or later (the python3 of macOS), stated in both READMEs and AGENTS.md; Tests runs on 3.9 and the newest Python.
  • Dependabot for the pinned actions. Actions in ci.yml are pinned to commit SHAs (with the tag in a comment), so they never update by themselves. Add .github/dependabot.yml with the github-actions ecosystem (e.g. monthly): it opens PRs that bump the SHA and the comment together. Its commit messages must pass the Commit messages check (commit-message: prefix: "ci", include: scope gives ci(deps), so add a scope it can use, e.g. ci(ci), or allow deps in .github/commitlint.config.mjs and AGENTS.md). Also add the npm ecosystem for directories: ["/.github/tools/claude-code", "/.github/tools/commitlint"], so the npm tools and their lock files are bumped too.
  • npm lock file and cache. Done in this PR (commit 6).

🤖 Generated with Claude Code

@DmitriyG1 DmitriyG1 added the ai AI-assisted change label Nov 17, 2026
@DmitriyG1 DmitriyG1 self-assigned this Nov 17, 2026
@DmitriyG1 DmitriyG1 changed the title ci(ci): add pull request checks Draft: ci(ci): add pull request checks Nov 17, 2026
@DmitriyG1
DmitriyG1 marked this pull request as draft November 17, 2026 11:39

@DmitriyG1 DmitriyG1 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review of this PR (/code-review medium, Claude Code). Findings are inline:

  • 🔴 a required check can pass while the thing it checks is broken; fix before merging
  • 🟠 wrong behavior in a narrower case; fix in this PR
  • 🟢 minor or already decided/tracked; no change needed now

Summary: 1 🔴, 2 🟠, 5 🟢.

Comment thread .github/workflows/ci.yml Resolved
Comment thread skills/android-upstream-audit/README.md Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread AGENTS.md Resolved
DmitriyG1 and others added 6 commits November 17, 2026 21:09
Python 3.13+ reports a trailing comma on its own line, older versions on
the next one, so the test failed on Python 3.12 in CI. It now breaks the
JSON with a missing comma, which every version reports at the same place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The init script test looked for gradlew at the root of the Gradle build
that holds the skill. In this repository there is none, so the test
stopped with "cannot find the project root". It now takes $GRADLE, then
gradle on PATH, then that gradlew, and fails instead of skipping when
RUN_GRADLE_TESTS=1 is set and no Gradle is found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four jobs on every pull request to main: the unit tests, claude plugin
validate (fails on what the plugin directory refuses, not on warnings),
commitlint on every commit with the rules of AGENTS.md plus a check for
merge and unsquashed fixup commits, and the Gradle test when the init
script changes. Actions are pinned to commit SHAs, packages to exact
versions, and the token can only read contents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Python 3.9 is the python3 of macOS (Command Line Tools), and the tests
pass on it. State it in both READMEs and in AGENTS.md, so code does not
start to need a newer Python by accident; CI tests 3.9 and the newest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code and commitlint were installed by version, but their own
dependencies were ranges (commitlint asks for ^21.2.3 and so on), so a
new or compromised dependency release reached CI without review. Each
tool now has a package.json and package-lock.json under .github/tools/,
installed with npm ci; setup-node caches the downloads. Two folders, so
the commit message job does not download Claude Code (about 300 MB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DmitriyG1
DmitriyG1 marked this pull request as ready for review November 17, 2026 17:17
@DmitriyG1
DmitriyG1 merged commit 3aaaf99 into main Nov 17, 2026
4 checks passed
@DmitriyG1
DmitriyG1 deleted the ci/add-checks branch November 17, 2026 17:17
@DmitriyG1 DmitriyG1 changed the title Draft: ci(ci): add pull request checks ci(ci): add pull request checks Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai AI-assisted change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant