Skip to content

Add template-aligned CI and adopt the Whitaker Dylint suite - #9

Merged
leynos merged 5 commits into
mainfrom
adopt-whitaker
Jul 9, 2026
Merged

Add template-aligned CI and adopt the Whitaker Dylint suite#9
leynos merged 5 commits into
mainfrom
adopt-whitaker

Conversation

@leynos

@leynos leynos commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

This pull request retrofits the repository with continuous integration
mirroring the agent-template-python template, and adopts the Whitaker Dylint
suite for the Rust crate as part of the estate-wide rollout tracked in
leynos/netsuke#410.

It adds the template Makefile (adapted for the pycrockford_rs crate and
msgspec_crockford package layout), ports the template's ruff, pylint,
pytest, and dev-dependency configuration into pyproject.toml, and wires a
single CI gate that validates the Makefile with mbake and then runs the
formatting, lint, typecheck, audit, test, and coverage gates.

Making the new gates pass required a small number of code changes. Whitaker's
bumpy_road_function lint flagged CrockfordUUID::new, which now delegates
to three extracted helpers. cargo audit reported RUSTSEC-2025-0020 and
RUSTSEC-2026-0177 against pyo3 0.20, so the crate has been migrated to
pyo3 0.29 (Bound API, PyOnceLock, abi3-py310). The Python package gained
docstrings, exception factory methods, and import aliases to satisfy the
ported ruff and interrogate configuration, and the documentation has been
reformatted for the markdownlint gate.

Review walkthrough

  • Makefile
    — the template target set; RUST_CRATE_DIR defaults to pycrockford_rs
    and PYTHON_TARGETS to msgspec_crockford. The lint-rust target runs
    cargo doc, Clippy, and the Whitaker suite with -D warnings.
  • .github/workflows/ci.yml
    — the CI gate; Whitaker is installed through whitaker-installer via
    cargo binstall, with a cargo install fallback for runners without
    binstall.
  • pyproject.toml
    — template lint and test configuration merged with the existing maturin
    build; manifest-path now names the crate manifest explicitly, and
    requires-python is raised to 3.10 to match the code's use of
    types.UnionType and types.NotImplementedType.
  • pycrockford_rs/src/lib.rs
    — the pyo3 0.29 migration and the CrockfordUUID::new refactoring.
  • msgspec_crockford/
    — docstrings, exception factories, import aliases, and narrowed
    pytest.raises expectations.
  • _pycrockford_rs_bindings.pyi
    — type stub so the ty gate can resolve the compiled module.
  • .github/dependabot.yml
    — adds the github-actions ecosystem now that workflows exist.

Validation

All gates pass locally from a clean virtual environment:

make build check-fmt lint typecheck test markdownlint nixie audit
  • whitaker --all -- --all-targets --all-features with
    RUSTFLAGS="-D warnings": clean after the bumpy_road_function fix.
  • ruff, interrogate (100 %), and pylint (10.00/10): clean.
  • ty check msgspec_crockford: clean.
  • pytest: 17 passed; cargo nextest: 4 passed; doc-tests: clean.
  • markdownlint and nixie: clean.
  • pip-audit and cargo audit: no known vulnerabilities after the pyo3
    upgrade.

Notes

  • The CI mirrors the agent-template-python template's ci.yml; the
    build-wheels and release workflows were deliberately not added.
  • requires-python was raised from 3.8 to 3.10 because the existing code
    already depends on Python 3.10 features; the wheel targets abi3-py310
    accordingly.
  • No ruff rules were relaxed beyond the template's own per-file ignores; no
    dylint.toml exclusions were needed.

leynos added 4 commits July 8, 2026 13:00
Introduce the agent-template-python Makefile, adapted for this
repository's layout (Rust crate in pycrockford_rs, Python package in
msgspec_crockford), covering build, formatting, linting (ruff,
interrogate, pylint, Clippy, and the Whitaker Dylint suite),
typechecking with ty, tests, audits, Markdown lint, and Mermaid
validation.

Port the template's ruff, pylint, and pytest configuration into
pyproject.toml, add the dev dependency group, and point maturin at the
crate manifest explicitly. Raise requires-python to 3.10, matching the
code's use of types.UnionType and types.NotImplementedType. Add a type
stub for the compiled _pycrockford_rs_bindings module so the ty gate
can resolve it, commit the uv lockfile, add the markdownlint
configuration, ignore the uv tool caches, and register the
github-actions Dependabot ecosystem now that workflows exist.
Resolve the findings surfaced by the new gates:

- Whitaker's bumpy_road_function flagged CrockfordUUID::new; extract
  from_py_string, from_py_bytes, and from_py_uuid helpers.
- Upgrade pyo3 from 0.20 to 0.29 to clear RUSTSEC-2025-0020 and
  RUSTSEC-2026-0177 from cargo audit, migrating to the Bound API,
  PyOnceLock, and abi3-py310, and replacing once_cell with
  std::sync::LazyLock. The byte-slice conversions now use fallible
  try_into rather than unwrap or unchecked copies.
- Satisfy the ported ruff, interrogate, pylint, and ty configuration:
  add module, class, and function docstrings; alias typing and uuid
  imports to avoid banned from-imports and property shadowing; move
  long exception messages into CrockfordUUIDError factory methods and
  a hook-local helper; expect CrockfordUUIDError in tests instead of
  the over-broad ValueError; and drop the redundant sys.path
  manipulation now that the package is installed into the virtualenv
  by uv.
Run mdformat over the existing documentation and hand-wrap the
remaining over-length lines so the markdownlint gate passes. Convert
the emphasised table caption to plain text, wrap generic type names in
the data-mapping table in code spans, and give the module-structure
listing a text fence language.
Mirror the agent-template-python CI gate: validate the Makefile with
mbake, then run the formatting, lint (including the Whitaker Dylint
suite), typecheck, audit, and coverage gates through the shared
actions. Whitaker is installed through whitaker-installer via cargo
binstall, with a cargo install fallback for runners without binstall,
and cached alongside the other Rust lint and test tools.

@sourcery-ai sourcery-ai Bot 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.

Sorry @leynos, your pull request is larger than the review limit of 150000 diff characters

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 59 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 91423d83-ce84-4e40-9b0d-5045327749a8

📥 Commits

Reviewing files that changed from the base of the PR and between 3431389 and 73faceb.

⛔ Files ignored due to path filters (2)
  • pycrockford_rs/Cargo.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .gitignore
  • .markdownlint-cli2.jsonc
  • AGENTS.md
  • Makefile
  • _pycrockford_rs_bindings.pyi
  • docs/crockford-uuids-with-msgspec-rust.md
  • msgspec_crockford/__init__.py
  • msgspec_crockford/exceptions.py
  • msgspec_crockford/hooks.py
  • msgspec_crockford/types.py
  • msgspec_crockford/unittests/test_hooks.py
  • msgspec_crockford/unittests/test_integration.py
  • msgspec_crockford/unittests/test_types.py
  • pycrockford_rs/Cargo.toml
  • pycrockford_rs/src/lib.rs
  • pyproject.toml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch adopt-whitaker

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a990b7bd52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Outdated
The CodeScene CLI install step piped the downloaded installer straight into
bash and only afterwards ran `sha256sum -c -` against a file the step never
wrote, so the checksum could not gate execution. Download the installer to a
file first, verify it against `CODESCENE_CLI_SHA256` when the variable is set
(failing on mismatch), emit a notice and skip verification when it is unset,
and only then execute the verified script.

Also add `--locked` to the whitaker-installer cargo-binstall invocation so
that binstall's compile fallback resolves dependencies from the published
lockfile, keeping fallback builds reproducible.
@leynos
leynos merged commit 6f584e9 into main Jul 9, 2026
4 checks passed
@leynos
leynos deleted the adopt-whitaker branch July 9, 2026 18:15
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