Repository navigation
Cross-Check Python Directories Against Dependabot's pip and uv Entries - #4460
Conversation
The Dependabot ecosystem check now reads the tree's Python manifests and reports a directory no entry of an ecosystem it implies covers. A uv.lock implies uv and a requirements*.txt implies pip, each for its own directory. A pyproject.toml declaring [project] dependencies beside neither implies pip or uv, unless it is a member of a uv workspace whose root uv.lock is tracked. A config-only pyproject.toml implies nothing. The ecosystem helpers move to spec/audit_dependabot.py, since spec/audit.py sits at its line ceiling, and the new module gets a ceiling of its own. AUDIT.md section 4 and the setup.dependabot.ecosystems assert describe the per-directory check, and AUDIT.md records that a uvx tool pinned to an exact version in a workflow is invisible to Dependabot. Addresses items 2 and 3 of #2286. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dicate Dependabot reads a glob in directories alone, so a directory value now matches only itself. The root-suite check takes the same uv.lock and requirements*.txt predicate the ecosystem check uses, and the shape guards fleet manifests never need are gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active finding remains because non-mapping TOML values can trigger an AttributeError and abort the fleet audit instead of reporting an unreadable dependency declaration.
1 open issue
What changed in this PR
This pull request extends the fleet audit to verify Python dependency manifests against directory-scoped Dependabot entries and documents uvx pin limitations. One issue remains: parseable non-table TOML values can abort the audit instead of being reported.
Changes:
- Add per-directory detection for
uv.lock,requirements*.txt, dependency-bearingpyproject.toml, and uv workspace members. - Extract Dependabot logic into a dedicated module with focused tests and a size ceiling.
- Update audit contracts, documentation, and fixtures.
| File | Description |
|---|---|
| tests/test_audit.py | Updates audit fixtures to provide a parseable configuration-only pyproject.toml by default. |
| tests/test_audit_size.py | Adds a line-count ceiling for the new Dependabot audit module. |
| tests/test_audit_helpers.py | Adds tests for Python manifest inference, Dependabot coverage, workspaces, globs, and unreadable files. |
| spec/project-types.json | Defines the per-directory Python ecosystem coverage contract. |
| spec/audit.py | Integrates Python ecosystem findings and reuses shared manifest detection for root checks. |
| spec/audit_dependabot.py | Implements Dependabot directory matching and Python manifest analysis. |
| AUDIT.md | Documents Python ecosystem coverage checks and exact uvx pin limitations. |
Review effort: Lite
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4460 +/- ##
===========================================
- Coverage 81.60% 79.70% -1.91%
===========================================
Files 26 48 +22
Lines 9070 16475 +7405
===========================================
+ Hits 7402 13132 +5730
- Misses 1668 3343 +1675
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|

Summary
This addresses items 2 and 3 of #2286 only. Item 1 is a
pipentry in KiCadLibrary's.github/dependabot.yml, a write in another repository, so #2286 stays open for that repository's resync.Item 2. The
dependabot.ecosystemscheck now asserts Python's ecosystems per directory, by the rule Audit Cross-Checks No Python Dependabot Ecosystem, and KiCadLibrary's requirements-dev.txt Is Untracked #2286 sets:uv.lockimpliesuvfor its own directory.requirements*.txtimpliespipfor its own directory.pyproject.tomldeclaring[project]dependencies, with neither file beside it, impliespiporuv. It implies nothing when it is a member of a uv workspace whose rootuv.lockis tracked.pyproject.tomlimplies nothing.An entry covers a directory its
directoryvalue names literally, or one adirectoriesglob matches. Apyproject.tomlthe audit cannot read or parse is reported rather than guessed.Item 3.
AUDIT.mdsection 4 records that Dependabot cannot see auvxtool pinned to an exact version in a workflow. The fix is@latest, or a version pinned in a manifest a Dependabot entry tracks.Split.
spec/audit.pysits at its 3000-line ceiling, so the ecosystem helpers move to a newspec/audit_dependabot.py. That module gets a ceiling of its own intests/test_audit_size.py. The root-suite check inspec/audit.pynow uses the sameuv.lock/requirements*.txtpredicate.Docs.
AUDIT.mdsection 4 and thesetup.dependabot.ecosystemsassert inspec/project-types.jsonnow describe the per-directory check. The other language ecosystems (nuget/npm) stay audited by inspection.Tests.
tests/test_audit.py'srun_auditfixture gives its trackedpyproject.tomla config-only text, since the check now parses it.Hub Self-Audit
Under this rule the hub's own audit reports one new DRIFT:
pipis not declared for/teststhoughtests/requirements.txtis present. Nothing gates on it, since no workflow runsspec/audit.pyand a DRIFT does not change its exit status. Whether to track that file or accept the finding is a question for the maintainer, filed as #4459.Verification
python -m unittest discover -s testspassed in full apart from the three fixture tests therun_auditchange fixes, and the audit suites pass after it.ruff (pinned), mypy,
spec/validate.py, and the prose gate are clean.Local strict review: two recorded
agent-skillpasses. The first raised three findings, all on text this change wrote:directoryvalue read as coverage. Fixed.shape()in.github/actions/python-directories/python_directories.pywas declined: it is a separately deployed action the audit mirrors rather than imports, aspython_directory_coversalready does.The second pass, over the full diff, raised none.
🤖 Generated with Claude Code