From 97a4661acde79d692eb44705a6555e3f6573d803 Mon Sep 17 00:00:00 2001 From: Evan Wang Date: Fri, 1 May 2026 23:19:04 +0800 Subject: [PATCH] feat(go): promote Go to MIGRATED_LANGUAGES Go scope resolution is now enabled by default (no REGISTRY_PRIMARY_GO=1 env var required). Legacy parity gate will auto-run Go resolver tests on both paths for every PR. All 116 integration tests pass on both legacy and registry-primary paths. --- .../src/core/ingestion/registry-primary-flag.ts | 1 + gitnexus/test/unit/registry-primary-flag.test.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gitnexus/src/core/ingestion/registry-primary-flag.ts b/gitnexus/src/core/ingestion/registry-primary-flag.ts index 3eaeb4579..713b32c07 100644 --- a/gitnexus/src/core/ingestion/registry-primary-flag.ts +++ b/gitnexus/src/core/ingestion/registry-primary-flag.ts @@ -70,6 +70,7 @@ export const MIGRATED_LANGUAGES: ReadonlySet = new Set { it('isolates flags per-language (one on does not affect others)', () => { process.env['REGISTRY_PRIMARY_PYTHON'] = 'true'; expect(isRegistryPrimary(SupportedLanguages.Python)).toBe(true); - // Java and Go are not in MIGRATED_LANGUAGES — default false stays + // Java is not in MIGRATED_LANGUAGES — default false stays // false regardless of Python's flag. expect(isRegistryPrimary(SupportedLanguages.Java)).toBe(false); - expect(isRegistryPrimary(SupportedLanguages.Go)).toBe(false); }); it('respects a mid-process env-var mutation (no stale cache)', () => { @@ -149,17 +148,18 @@ describe('primaryLanguages', () => { it('returns exactly the flipped languages (env opts in unmigrated, opts out migrated)', () => { // Migrated languages are default-on; each must be opted out here when - // testing explicit env overrides. Go (unmigrated) opts in; Java stays off. + // testing explicit env overrides. Java (unmigrated) opts in; Go stays off. process.env['REGISTRY_PRIMARY_PYTHON'] = 'false'; process.env['REGISTRY_PRIMARY_CSHARP'] = 'false'; process.env['REGISTRY_PRIMARY_TYPESCRIPT'] = 'false'; - process.env['REGISTRY_PRIMARY_GO'] = '1'; + process.env['REGISTRY_PRIMARY_GO'] = 'false'; + process.env['REGISTRY_PRIMARY_JAVA'] = '1'; const enabled = primaryLanguages(); expect(enabled.has(SupportedLanguages.Python)).toBe(false); expect(enabled.has(SupportedLanguages.CSharp)).toBe(false); - expect(enabled.has(SupportedLanguages.Go)).toBe(true); - expect(enabled.has(SupportedLanguages.Java)).toBe(false); - // Only Go is on: migrated defaults overridden off, Go explicitly on. + expect(enabled.has(SupportedLanguages.Go)).toBe(false); + expect(enabled.has(SupportedLanguages.Java)).toBe(true); + // Only Java is on: migrated defaults overridden off, Java explicitly on. expect(enabled.size).toBe(1); });