Repository navigation
fix(ci): run static analysis for every tree the repo-wide audits scan - #20918
Conversation
A mobile-only diff is desktop-irrelevant, so should_run was false and every PR check skipped -- including the audits that do lint mobile/. The violation then landed on main and failed the same gate on every later PR's merge ref. Derive the trigger from the audit commands' own scan roots so the two cannot drift.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe script now derives static-analysis scan roots from the configured Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The updated CI classification correctly includes scanned mobile and repository paths without enabling audits for excluded paths. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description clearly explains the problem, change, rationale, testing, and lack of UI changes. However, it omits required template sections, including the Linked Issue with a ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Derived audit scan roots —
pr-code-change-scope.mjsnow parses the threeSTATIC_ANALYSIS_AUDIT_SCRIPTSout ofpackage.json's argv (oxlintScanRoots) to computeSTATIC_ANALYSIS_SCAN_ROOTS/_PREFIXES, with a fail-closed fallback when no roots parse. static_analysisgate widened pastshould_run—classifyPrJobsORs inchangedFiles.some(isStaticAnalysisScannedPath), so a mobile-only (desktop-irrelevant) diff still runs the always-on static analysis without starting the desktop suite.mobile_dependenciesfollows it — now(shouldRun || jobs.static_analysis) && needsMobileDependencies(changedFiles)so the changed-code pass gets mobile types on mobile-only diffs.- Test updates — re-pointed
mobile_dependenciesexpectations, added a mobile-only classification test, a per-root ratchet overSTATIC_ANALYSIS_SCAN_ROOTS, and a control asserting README/cloud paths stay out.
Verified locally: pnpm test config/scripts/pr-code-change-scope.test.mjs (34 passed) plus the wiring contract tests (pr-e2e-gate-contract, pr-workflow-parallelism, pr-workflow-lint-parity, 61 passed); CLI spot-checks match the PR body (mobile/src/a.ts → static_analysis=true, mobile_dependencies=true, should_run=false, desktop jobs false; cloud/... and README.md unchanged); oxlint/oxfmt --check clean. config/oxlint-code-quality-native-plugins.json includes a mobile/** override, confirming the premise that the audits lint mobile. The mobile-only gap is the only desktop-irrelevant tree any of the static_analysis steps read, so the change closes it fully.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…an-roots-gate-mobile
|
Review status: ready after review; no fixes required.
No scope expansion or production edits were made during review. |
…stablyai#20918) A mobile-only diff is desktop-irrelevant, so should_run was false and every PR check skipped -- including the audits that do lint mobile/. The violation then landed on main and failed the same gate on every later PR's merge ref. Derive the trigger from the audit commands' own scan roots so the two cannot drift.

Problem
A diff touching only
mobile/is classified desktop-irrelevant, soshould_runis false — and every job isshouldRun && (...), so all PR checks skip, including the three inALWAYS_ON_CODE_JOBS. Being "always on" does not surviveshould_runbeing false.But the repo-wide audits lint mobile:
audit:code-quality:nativesrc config tests mobileaudit:anti-slopsrc config tests mobileaudit:code-quality:type-awaresrc config testsSo a mobile-only PR can land a violation that no check ever evaluated, and because CI lints the merge ref, it then fails
static analysison every later PR until someone sweeps it.Mobile Checksdoes not cover the gap: itsLintstep runs withworking-directory: mobile, and mobile's ownlintscript is plainoxlint, without these plugin configs.Measured today — two incidents, both from mobile-only PRs whose
static analysiswas SKIPPED, each blocking the whole queue until a standalone sweep:anti-slop(no-reflect-get), swept by fix(lint): replace Reflect.get with typed property access in mounting substitutes #20874import(no-duplicates)x2, swept by fix(lint): merge duplicate type imports in the mobile RPC recorder adapters #20895What changed
static_analysisis now triggered by whether a changed path falls under a tree the audits actually scan, derived from those commands' own argv inpackage.jsonrather than from a second hand-maintained list.mobile_dependenciesfollows it, because the changed-code pass needs mobile types.should_runis untouched, so a mobile-only diff still skipstypecheck,test,package, e2e and the rest — this adds one job, not the desktop suite.Deriving rather than adding
'mobile/'to a list is the point: the defect is two copies of "which trees the gate reads" disagreeing. Read off the commands, adding a tree to an audit widens the trigger by itself, and a ratchet test asserts exactly that. Parsing that finds no roots fails closed and keeps the gate.Visual Proof
N/A — CI job classification, no runtime or UI change.
Testing
pnpm test config/scripts/pr-code-change-scope.test.mjs— 34 passed.mobile/src/.../adapters/a.ts→static_analysis=true,mobile_dependencies=true,should_run=false,typecheck=false,test=false,package=falsecloud/apps/relay/src/index.ts→static_analysis=false(unchanged)README.md→static_analysis=false(unchanged)oxlintandoxfmt --checkclean on both files.Complementary to #20912, which teaches the changed-code gate the focused import plugins so an author catches these before pushing; that gate is a step inside this same job, so it needed this change to run at all on a mobile-only diff.
Note: this PR's own
static analysiswill fail on main's current tip until #20907 lands — an unrelated duplicate import insrc/shared/agent-status-store-snapshot-budget.ts.