chore(coderabbit): slop_detection + project finishing-touches recipes#62
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideUpdates the CodeRabbit configuration on dev by enabling slop detection, expanding finishing-touches to cover unit tests, and adding four project-specific review recipes, without altering existing structure, filters, or ignore rules. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 security issue, and left some high level feedback:
Security issues:
- Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections. (link)
General comments:
- The
no-hardcoded-ratesrecipe is quite broad ("flag any literal c/kWh number that looks like a tariff rate") and may generate a lot of noise; consider scoping it to specific paths/modules or explicitly excluding tests/docs/config examples to keep the signal high. - For
scrub-secrets, you might want to include brief examples or patterns for Amber API keys, HA LLATs, and JWTs (e.g., prefixes/lengths) so the detector guidance is more precise and less likely to flag benign strings. - The
dashboard-protocol-safetyinstructions currently apply globally; if this rule only makes sense forcustom_components/pricehawk/www/dashboard.html, consider adding or documenting path scoping so it doesn't trigger on unrelated HTML/JS files in future.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `no-hardcoded-rates` recipe is quite broad ("flag any literal c/kWh number that looks like a tariff rate") and may generate a lot of noise; consider scoping it to specific paths/modules or explicitly excluding tests/docs/config examples to keep the signal high.
- For `scrub-secrets`, you might want to include brief examples or patterns for Amber API keys, HA LLATs, and JWTs (e.g., prefixes/lengths) so the detector guidance is more precise and less likely to flag benign strings.
- The `dashboard-protocol-safety` instructions currently apply globally; if this rule only makes sense for `custom_components/pricehawk/www/dashboard.html`, consider adding or documenting path scoping so it doesn't trigger on unrelated HTML/JS files in future.
## Individual Comments
### Comment 1
<location path=".coderabbit.yaml" line_range="51" />
<code_context>
ws://. Token must come from URL params or postMessage, never
</code_context>
<issue_to_address>
**security (javascript.lang.security.detect-insecure-websocket):** Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections.
*Source: opengrep*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| instructions: | | ||
| custom_components/pricehawk/www/dashboard.html MUST use | ||
| location.protocol for WebSocket URL detection. Never hardcode | ||
| ws://. Token must come from URL params or postMessage, never |
There was a problem hiding this comment.
security (javascript.lang.security.detect-insecure-websocket): Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections.
Source: opengrep
Summary
Bring CodeRabbit
slop_detection+ 4 PriceHawk-specific finishing-touchesrecipes from
phase-3-multi-plan/phase-3-1-prep-eme-refdata2back todevso future feature PRs targetingdevget richer review immediately,decoupled from PR #28's merge timing.
What was broken
.coderabbit.yamlondev(andmain) is the older 145-line version. Itlacks:
slop_detection(flags low-quality AI-generated PRs withsloplabel)finishing_touches.unit_testsscrub-secrets— audits for hardcoded Amber API keys, HA LLATs, JWTsno-hardcoded-rates— flags literal c/kWh tariff values in sourceamber-api-limits— flags loops that exceed Amber's 50 req/5min budgetdashboard-protocol-safety— enforceslocation.protocol+ non-hardcodedtokens in
dashboard.htmlFeature branches based on
devget the older review profile until #28merges, which means any in-flight PR misses the project-specific guardrails
PriceHawk has already validated on the stacked-PR branches.
What this fixes
devand every branch downstream of it (PRs from contributors, securityfixes, dashboard work, etc.) immediately benefit from the richer review
configuration without waiting for the v1.5.0 stack (#28 / #54) to land.
Test plan
python -c "import yaml; yaml.safe_load(open('.coderabbit.yaml'))"passesgit diff origin/dev -- .coderabbit.yamlshows only the +29-line additionuntouched)
Changes
Cherry-picked commit
4223ff2fromphase-3-multi-plan:All additions live under existing
reviews:keys — no structural changes,no path filter changes, no ignore rule changes.
Why
The richer yaml was authored and validated on the PR #28 stack. Waiting
for #28 to merge before propagating means weeks of feature work on
devwithout project-specific CR coverage. Splitting it out as its own tiny PR:
preserved)
Breaking Changes
None. Configuration-only change. CodeRabbit re-reads
.coderabbit.yamlonnext PR event.
Files Changed
.coderabbit.yaml(+29 lines)🤖 Generated with Claude Code
Summary by Sourcery
Update CodeRabbit review configuration to enable stricter, project-specific automated review checks.
Enhancements: