Post-sync cleanup: dependabot scope, MISRA baseline, openspec paths - #48
Conversation
Upstream owns pyproject.toml, uv.lock, and submodule pins; those update via upstream syncs (upstream runs its own package bot). Fork-local dependabot PRs for them just create divergence — all 8 open ones were superseded by the July 2026 sync and have been closed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- reports/misra-baseline.txt: regenerated with cppcheck 2.21 against the new openpilot/ package paths (37 C++ files, 235 misra-c2012 findings; old baseline had pre-restructure paths so compare-analysis.sh flagged everything as new) - misra.yml: count findings from reports/cppcheck-misra-report.txt — cppcheck writes findings via --output-file, so the console tee the gate previously grepped only ever contained progress lines (gate compared ~0 vs 1050); threshold updated to 250 for the new 235-finding baseline - cppcheck-misra.sh: count and top-10 greps now match the misra-c2012 message ids (old pattern [misra-[a-z]+-...] never matched, so the summary printed empty) - misra-baseline.md: rewritten for the new numbers and layout Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Live documents only (specs/, config.yaml) — archived changes keep their original paths, which were correct when written. Every rewritten path was verified to exist on disk; sync-upstream-2026-07 proposal needed no changes (its old-path mentions are deliberately historical). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR updates the MISRA analysis pipeline to filter findings by misra-c2012 pattern, read from a report file instead of console output, and lowers the CI baseline threshold to 250. It also regenerates the MISRA baseline report, updates various openspec spec paths to use openpilot/-prefixed paths, and narrows dependabot config to only check GitHub Actions. ChangesMISRA Analysis Pipeline Update
Openspec Path Restructure
Dependabot Policy Update
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant CI as GitHub Actions
participant Script as cppcheck-misra.sh
participant Report as cppcheck-misra-report.txt
participant Threshold as MISRA threshold check
CI->>Script: run cppcheck analysis
Script->>Report: write misra-c2012 findings
CI->>Report: grep TOTAL and GENERATED counts
CI->>Threshold: compare TOTAL against BASELINE=250
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Process replay diff reportReplays driving segments through this PR and compares the behavior to master. ✅ 0 changed, 66 passed, 0 errors |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/lint/cppcheck-misra.sh (1)
63-69: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winNormalize the count before comparing it.
grep -calready prints0when there are nomisra-c2012hits, so the|| echo "0"fallback can turnTOTALinto0 0and break the later numeric test. Use a no-match-safe assignment instead.Proposed fix
- TOTAL=$(grep -c "misra-c2012" "$REPORT_FILE" 2>/dev/null || echo "0") + TOTAL=$(grep -c "misra-c2012" "$REPORT_FILE" 2>/dev/null || true) + TOTAL=${TOTAL:-0}🤖 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 `@scripts/lint/cppcheck-misra.sh` around lines 63 - 69, The TOTAL assignment in cppcheck-misra.sh is producing an invalid value when grep finds no matches because the fallback appends an extra zero. Update the counting logic around the TOTAL variable to use a no-match-safe pattern that always yields a single numeric value, so the later [[ "$TOTAL" -gt 0 ]] comparison in the summary block remains valid.
🤖 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 @.github/workflows/misra.yml:
- Around line 41-46: The MISRA summary step in the workflow is deriving
GENERATED from a report that no longer contains generated-code hits, which can
leave the arithmetic expression in ACTIONABLE invalid. In the misra workflow,
update the report parsing around REPORT, TOTAL, GENERATED, and ACTIONABLE so
GENERATED is set directly to 0, and make TOTAL use a no-match-safe pattern that
always yields a numeric value before subtraction.
---
Outside diff comments:
In `@scripts/lint/cppcheck-misra.sh`:
- Around line 63-69: The TOTAL assignment in cppcheck-misra.sh is producing an
invalid value when grep finds no matches because the fallback appends an extra
zero. Update the counting logic around the TOTAL variable to use a no-match-safe
pattern that always yields a single numeric value, so the later [[ "$TOTAL" -gt
0 ]] comparison in the summary block remains valid.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 39fbaf2c-9209-4699-83e1-694b8591c7dd
📒 Files selected for processing (10)
.github/dependabot.yml.github/workflows/misra.ymlopenspec/config.yamlopenspec/specs/code-quality/spec.mdopenspec/specs/dgx-spark-integration/spec.mdopenspec/specs/formal-verification/spec.mdopenspec/specs/misra-analysis/spec.mdreports/misra-baseline.mdreports/misra-baseline.txtscripts/lint/cppcheck-misra.sh
| # Count findings from the report file — cppcheck writes findings via | ||
| # --output-file, so the console tee only carries progress lines | ||
| REPORT=reports/cppcheck-misra-report.txt | ||
| TOTAL=$(grep -c "misra-c2012" "$REPORT" 2>/dev/null || echo "0") | ||
| GENERATED=$(grep "c_generated_code" "$REPORT" 2>/dev/null | grep -c "misra-c2012" || echo "0") | ||
| ACTIONABLE=$((TOTAL - GENERATED)) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win
Don't derive GENERATED from a report that can no longer contain generated-code hits.
This grep will always have no matches now, so the || echo "0" path produces a malformed value and can fail ACTIONABLE=$((TOTAL - GENERATED)). Set GENERATED=0 here, and normalize TOTAL with the same no-match-safe pattern if you keep it as a grep count.
Proposed fix
- GENERATED=$(grep "c_generated_code" "$REPORT" 2>/dev/null | grep -c "misra-c2012" || echo "0")
- ACTIONABLE=$((TOTAL - GENERATED))
+ GENERATED=0
+ ACTIONABLE=$TOTAL🤖 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 @.github/workflows/misra.yml around lines 41 - 46, The MISRA summary step in
the workflow is deriving GENERATED from a report that no longer contains
generated-code hits, which can leave the arithmetic expression in ACTIONABLE
invalid. In the misra workflow, update the report parsing around REPORT, TOTAL,
GENERATED, and ACTIONABLE so GENERATED is set directly to 0, and make TOTAL use
a no-match-safe pattern that always yields a numeric value before subtraction.
Follow-ups after the July 2026 upstream sync (#46).
Changes
openpilot/layout (37 C++ files, 235 actionable findings, was 1,003 pre-restructure). Fixed the CI gate, which grepped the console log for findings that cppcheck writes to--output-file— it was comparing ~0 against 1050. Threshold now 250 against the report file. Also fixed the script's top-10 summary regex, which could never matchmisra-c2012ids.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation
Chores