Skip to content

Post-sync cleanup: dependabot scope, MISRA baseline, openspec paths - #48

Merged
montge merged 3 commits into
developfrom
fork/post-sync-cleanup
Jul 17, 2026
Merged

Post-sync cleanup: dependabot scope, MISRA baseline, openspec paths#48
montge merged 3 commits into
developfrom
fork/post-sync-cleanup

Conversation

@montge

@montge montge commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Follow-ups after the July 2026 upstream sync (#46).

Changes

  • dependabot: scoped to fork-owned GitHub Actions workflows only. Upstream owns pyproject/uv.lock/submodule pins — those arrive via upstream syncs (the 8 open dependabot PRs were all superseded by Sync with upstream commaai/openpilot (07ec389f4, 2026-07-02) #46 and have been closed).
  • MISRA baseline: regenerated for the post-restructure 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 match misra-c2012 ids.
  • openspec: live specs and config updated to post-restructure paths (every rewrite verified to exist on disk). Archived changes deliberately untouched — their paths were correct when written.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved MISRA reporting so findings and top rules are counted from the generated report, with updated threshold checks.
    • Aligned MISRA analysis with the current code layout, reducing noisy or outdated baseline comparisons.
  • Documentation

    • Updated spec and configuration references to match the current repository paths and hardware/module naming.
  • Chores

    • Simplified dependency automation to focus on GitHub Actions updates.
    • Regenerated the MISRA baseline with refreshed counts, rules, and CI guidance.

montge and others added 3 commits July 3, 2026 18:02
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>
Copilot AI review requested due to automatic review settings July 3, 2026 22:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

MISRA Analysis Pipeline Update

Layer / File(s) Summary
Script filtering narrowed to misra-c2012
scripts/lint/cppcheck-misra.sh
Counting and top-rules extraction now match only misra-c2012 findings instead of any misra- pattern.
Workflow reads from report file, threshold lowered
.github/workflows/misra.yml
Finding counts and top-10 rules are now derived from reports/cppcheck-misra-report.txt instead of console output; CI baseline threshold lowered from 1050 to 250.
Regenerated baseline report
reports/misra-baseline.md
Full report regenerated with new header metadata, executive summary (235 total violations, 6 unique rules, 37 files), rule/finding tables, exclusion paths, remediation priorities, and a consolidated CI threshold section.

Openspec Path Restructure

Layer / File(s) Summary
openpilot/-prefixed paths across specs
openspec/config.yaml, openspec/specs/code-quality/spec.md, openspec/specs/dgx-spark-integration/spec.md, openspec/specs/formal-verification/spec.md, openspec/specs/misra-analysis/spec.md
Safety constraints, coverage scenarios, hardware detection, formal verification, and MISRA analysis scenarios updated to reference openpilot/-prefixed directory paths instead of unprefixed paths.

Dependabot Policy Update

Layer / File(s) Summary
Restrict Dependabot to GitHub Actions
.github/dependabot.yml
Top comments rewritten to document fork policy; the pip (Python) dependency update block is removed, leaving only GitHub Actions and submodule update configuration.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the changes, but it omits the required Verification section and doesn't use the repository's template headings. Rewrite it using the appropriate template, with clear Description and Verification sections, and briefly note how the changes were tested.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main cleanup around Dependabot, MISRA, and openspec path updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fork/post-sync-cleanup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 66 passed, 0 errors

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Normalize the count before comparing it.

grep -c already prints 0 when there are no misra-c2012 hits, so the || echo "0" fallback can turn TOTAL into 0 0 and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 388d7c4 and 3b3d5ac.

📒 Files selected for processing (10)
  • .github/dependabot.yml
  • .github/workflows/misra.yml
  • openspec/config.yaml
  • openspec/specs/code-quality/spec.md
  • openspec/specs/dgx-spark-integration/spec.md
  • openspec/specs/formal-verification/spec.md
  • openspec/specs/misra-analysis/spec.md
  • reports/misra-baseline.md
  • reports/misra-baseline.txt
  • scripts/lint/cppcheck-misra.sh

Comment on lines +41 to 46
# 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))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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.

@montge
montge merged commit 364f2e0 into develop Jul 17, 2026
24 checks passed
@montge
montge deleted the fork/post-sync-cleanup branch July 17, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants