Repository navigation
fix(maintainability): keep --policy-file inside the --repo directory - #886
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
Reviewer's GuideThe checker now prevents path traversal through --policy-file by resolving symlinks and requiring the final path to remain under --repo, with regression tests for direct and symlinked external files and updated developer documentation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
26d0094 to
dcb3a6d
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |



Summary
The SonarCloud quality gate on
mainhas failed on every commit since #792 (2026-09-30). Its only open finding ispythonsecurity:S8707, a path traversal through LLM-supplied CLI arguments:read_policy()inscripts/check_maintainability.pyopens any--policy-filepath. That code has not changed since #733. SonarCloud began reporting this rule after #733 merged, and PR analysis looks only at changed lines, so every PR passed the required Sonar check whilemainstayed red.read_policy()now resolves--policy-fileand the--reporoot withrealpath, which follows symlinks. If the policy file is outside the repository, the checker stops with a plain-language error and exit code 2.docs/DEVELOPMENT.mdnow says where the external policy file must be.Scope
maingate stays red until SonarCloud analyzesmainafter this merges and closes the issue. Nothing alerts anyone when themaingate fails, so that is worth a separate follow-up.Checklist
README.mdordocs/updated if install, deployment, config, or user-facing behavior changedCHANGELOG.mdedit needed outside release prepTest plan
tests/run-all.sh: N/A - change is confined to the maintainability checkerFocused test(s):
python -m pytest tests/test_python_maintainability*.py(158 passed)python -m py_compile scripts/check_maintainability.pyruff checkon touched filesDocker or Compose validation, if container behavior changed: N/A