Normalize OWASP cheat sheet references#954
Conversation
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughChangesCheat sheet registration
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
7f640f4 to
aac9e3b
Compare
aac9e3b to
79cab23
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
application/tests/cheatsheets_parser_test.py (1)
81-102: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover clone fallback and duplicate merging.
The new test covers supplemental loading only. Add cases where
git.clonefails but a seeded supplemental entry is still returned, and where repository/supplement entries share(section, hyperlink)and their CRE links are merged. This protects both new parse paths.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@application/tests/cheatsheets_parser_test.py` around lines 81 - 102, Add test cases alongside test_register_supplemental_cheatsheets covering clone failure with a seeded supplemental entry still returned, and repository/supplement entries sharing the same (section, hyperlink) with their CRE links merged. Configure the git.clone failure through the existing test seam and assert both fallback retention and deduplicated combined links.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@application/utils/external_project_parsers/parsers/cheatsheets_parser.py`:
- Around line 57-61: Restrict the exception handler around the OWASP
CheatSheetSeries clone in the parser to expected process and OS failures raised
by git.clone(), such as subprocess and operating-system errors. Do not catch
arbitrary Exception, so parser and configuration defects propagate normally
while the existing warning and supplemental-cheat-sheets fallback remain
unchanged for those failures.
---
Nitpick comments:
In `@application/tests/cheatsheets_parser_test.py`:
- Around line 81-102: Add test cases alongside
test_register_supplemental_cheatsheets covering clone failure with a seeded
supplemental entry still returned, and repository/supplement entries sharing the
same (section, hyperlink) with their CRE links merged. Configure the git.clone
failure through the existing test seam and assert both fallback retention and
deduplicated combined links.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: d61289eb-2550-49a5-9d56-a8af8cd692f9
📒 Files selected for processing (3)
application/tests/cheatsheets_parser_test.pyapplication/utils/external_project_parsers/data/owasp_cheatsheets_supplement.jsonapplication/utils/external_project_parsers/parsers/cheatsheets_parser.py
Summary
This PR is split out from the larger issue-471 review flow to make review smaller and more focused.
It normalizes OWASP cheat sheet references by:
Issue reference:
Problem Fixed
The earlier cheat sheet references review became too large because it was mixed with unrelated importer-stack work.
For this part of the work, the useful standalone contribution is:
Solution
This PR updates the cheat sheet parser to:
This PR also adds:
Files in scope:
application/utils/external_project_parsers/parsers/cheatsheets_parser.pyapplication/utils/external_project_parsers/data/owasp_cheatsheets_supplement.jsonapplication/tests/cheatsheets_parser_test.pyTests
Reviewer Notes
This PR is intentionally narrow because it was split to reduce review size:
This PR is meant to be reviewed as a standalone cheat sheet reference normalization change.