Repository navigation
fix(quality-gate): let the changed-code gate see the focused import plugins - #20912
Conversation
…lugins import/no-duplicates was reachable only through the repo-wide CI audit, so an author's first signal was a red static analysis job after push.
📝 WalkthroughWalkthroughThe change adds a focused Oxlint scan to Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The focused scan is wired correctly, with only a recommended test improvement to protect its runtime execution and filtering. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the problem, fix, scope, and verification, but it does not follow the repository template. It omits the required Linked Issue, Visual Proof or explicit N/A, Testing section format, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. Resolution Update the description to include all required template sections. Add the linked issue number, write Visual Proof as N/A with a reason if applicable, preserve testing details in the Testing section, complete or mark the remaining checklist sections, and provide the required Agent skill upstream boundary and Notes information. ✨ Finishing Touches📝 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.
🧹 Nitpick comments (1)
config/scripts/check-changed-code-quality.test.mjs (1)
60-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExercise the focused scan through the changed-code quality entry point. The current test only inspects
OXLINT_SCANS. It does not exercisemain, which iterates the scans, forwardsscan.argsthroughrunOxlintScan, and appliesdiagnosticTouchesAddedLinesto each scan's diagnostics. The test can therefore pass if the focused scan is omitted, its arguments are lost, or changed-line filtering is bypassed. Add a focused integration test with a stubbed Oxlint result that asserts invocation and ignores diagnostics outside added lines.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 0ad06e20-fa18-438d-be59-a35d3167b4ca
📒 Files selected for processing (2)
config/scripts/check-changed-code-quality.mjsconfig/scripts/check-changed-code-quality.test.mjs
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — one defer-able observation inline.
Reviewed changes
- Focused-plugin scan added to the changed-code gate —
config/scripts/check-changed-code-quality.mjs:27-37adds afocused pluginsscan socheck:code-quality:changedrunsconfig/oxlint-code-quality-native-plugins.json, the same config CI'saudit:code-quality:nativeenforces, withimport/no-cycleallowed. - Scan-shape test —
config/scripts/check-changed-code-quality.test.mjs:60-68pins the scan's config path and its--allow import/no-cyclewiring.
Independently verified: audit:code-quality:native (pr.yml:140) does precede Install mobile dependencies (pr.yml:154) and check:code-quality:changed (pr.yml:165); without mobile/node_modules the cycle rule resolves nothing even for two internal mobile/src files importing each other, while the same relative-import cycle in src/ is detected with root node_modules — so the allow's premise holds. --allow import/no-cycle drops exactly that rule (number_of_rules 16→15) and import/no-duplicates still fires; the gate passes on this PR's own diff (all buckets 0) and the 18 gate tests pass. Repo-wide the audit shows the single expected pre-existing finding, so the stated blast radius is accurate.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| '--config', | ||
| 'config/oxlint-code-quality-native-plugins.json', | ||
| '--allow', | ||
| 'import/no-cycle' |
There was a problem hiding this comment.
The allow is global, so this also turns import/no-cycle off for root src/ files, where CI's repo-wide audit does enforce it — the gate can now pass locally while static analysis fails on a root-file cycle. That's not a regression (the gate had no import rules before), but if the intent is mobile-only parity, scoping the allow to mobile files would keep root coverage intact.
Technical details
# Scope the `import/no-cycle` allow to the mobile dependency state
## Affected sites
- `config/scripts/check-changed-code-quality.mjs:34-35` — `--allow import/no-cycle` applies to every file the scan is handed, root included.
- `config/scripts/check-changed-code-quality.mjs:395-411` (`runOxlintScan`) — one invocation over one `files` list, so a single CLI `--allow` cannot express the split.
## Required outcome
- Root-file cycles that `audit:code-quality:native` would fail stay caught locally; mobile files keep the allow because CI's audit runs before `mobile/node_modules` exists.
## Suggested approach (optional)
- Give a scan an optional file predicate (or split the focused scan into a root invocation with no allow and a mobile invocation with `--allow import/no-cycle`) so the allow is scoped to `mobile/**`.
- Alternatively, leave as-is and accept that CI is the only `no-cycle` gate for root files — that is a reasonable call, hence informational.…gate-sees-import-plugin
…ntroduced main's #20912 let the changed-code gate see the focused import plugins, which surfaced eight import(no-duplicates) findings across seven of this branch's files. Same bindings, one specifier each.
…lugins (stablyai#20912) import/no-duplicates was reachable only through the repo-wide CI audit, so an author's first signal was a red static analysis job after push.

Problem
import/no-duplicateslives only inconfig/oxlint-code-quality-native-plugins.json, which only the repo-wide CI jobaudit:code-quality:nativeloads. Nothing an author runs before pushing evaluates it:oxlint(lint-staged pre-commit)check:code-quality:changedaudit:code-quality:nativestatic analysisMeasured with a deliberate three-import probe file. So the first signal is a red
static analysisjob after push — and because CI lints the merge ref, one such warning onmain's tip redsstatic analysisandverifyon every open PR.This is the second occurrence of the identical rule and shape (PR #18776, and now the file #20717 added, fixed standalone in #20907).
Fix
Add the focused-plugin config to
OXLINT_SCANS, so the changed-code gate evaluates the same rules CI does.import/no-cycleis allowed in this scan on purpose. Inpr.yml,audit:code-quality:nativeis step 6 and "Install mobile dependencies" is step 8, so the repo-wide audit structurally cannot resolve a cycle insidemobile/. The changed-code gate is step 9 — after that install. Without the allow, the same rule would be evaluated under two different dependency states in one workflow, and locally it would report findings CI cannot reproduce.Blast radius
Zero, beyond the violation already fixed in #20907. Repo-wide under this scan's config there is exactly one finding across
src config tests mobile, and it is that one. The scan is changed-lines scoped, so no existing branch inherits anything else.Verification
focused plugins: 1 new finding(s), gate exit 1.pnpm test config/scripts/check-changed-code-quality.test.mjs→ 18 passed (adds one scan-shape test).