From fbe7b194b8b6e05bf945aaef67ab3b3789f110fd Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Wed, 16 Sep 2026 20:54:27 -0700 Subject: [PATCH] fix(quality-gate): let the changed-code gate see the focused import plugins (#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. --- config/scripts/check-changed-code-quality.mjs | 11 +++++++++++ config/scripts/check-changed-code-quality.test.mjs | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/config/scripts/check-changed-code-quality.mjs b/config/scripts/check-changed-code-quality.mjs index 1b8a0c4f5e9..a49ad1ddb51 100644 --- a/config/scripts/check-changed-code-quality.mjs +++ b/config/scripts/check-changed-code-quality.mjs @@ -24,6 +24,17 @@ export const OXLINT_SCANS = [ label: 'casting code quality', args: ['--config', 'config/oxlint-code-quality-casting.json'] }, + { + // Why the allow: CI's `audit:code-quality:native` runs before the mobile install, so it can + // never see a cycle inside mobile/ — locally, where mobile/node_modules exists, it would. + label: 'focused plugins', + args: [ + '--config', + 'config/oxlint-code-quality-native-plugins.json', + '--allow', + 'import/no-cycle' + ] + }, { label: 'type-aware code quality', args: ['--type-aware', '--config', 'config/oxlint-code-quality-type-aware.json'] diff --git a/config/scripts/check-changed-code-quality.test.mjs b/config/scripts/check-changed-code-quality.test.mjs index a0bfcd0ecd9..e722acad6ef 100644 --- a/config/scripts/check-changed-code-quality.test.mjs +++ b/config/scripts/check-changed-code-quality.test.mjs @@ -57,6 +57,16 @@ describe('changed-code quality line matching', () => { expect(scan.args).not.toContain('--disable-nested-config') }) + // Why: import/no-duplicates was reachable only through the repo-wide CI audit, so it first + // surfaced after push. The cycle rule stays out because CI's audit runs before the mobile install. + it('runs the focused plugin config the repo-wide audit enforces, minus the cycle rule', () => { + const scan = OXLINT_SCANS.find((candidate) => candidate.label === 'focused plugins') + + expect(scan.args).toContain('config/oxlint-code-quality-native-plugins.json') + expect(scan.args).toContain('import/no-cycle') + expect(scan.args[scan.args.indexOf('import/no-cycle') - 1]).toBe('--allow') + }) + it('leaves Cloud source to the independent Cloud quality checks', () => { expect(isRootCodeQualityPath('cloud/apps/relay/src/index.ts')).toBe(false) expect(isRootCodeQualityPath('src/main/index.ts')).toBe(true)