From 44859143744da9ab313463f7ee1da4252bac636b Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 30 May 2026 12:30:51 -0400 Subject: [PATCH] test: Restore dropped tenant-context coverage for GitHub skill sync The prior commit shipped the getTenantId import in github.spec.ts without the tenant tests that use it (lost in an interrupted edit), which failed the eslint --max-warnings=0 CI job on an unused import. Restore both github.spec.ts tenant tests (tenant-scoped run stamps tenantId and executes inside the tenant ALS context; no-tenant run stays ambient) and the two config-schemas tenant tests (accepts tenantId, rejects __SYSTEM__). --- .../specs/config-schemas.spec.ts | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/packages/data-provider/specs/config-schemas.spec.ts b/packages/data-provider/specs/config-schemas.spec.ts index 288a0ec807..0e7d6ec044 100644 --- a/packages/data-provider/specs/config-schemas.spec.ts +++ b/packages/data-provider/specs/config-schemas.spec.ts @@ -649,6 +649,51 @@ describe('configSchema skillSync', () => { expect(result.data?.skillSync?.github?.sources[0]?.paths).toEqual(['skills', '']); }); + it('accepts an optional tenantId on a GitHub skill sync source', () => { + const result = configSchema.safeParse({ + version: '1.3.11', + skillSync: { + github: { + enabled: true, + sources: [ + { + id: 'librechat-skills', + owner: 'LibreChat', + repo: 'skills', + paths: ['skills'], + credentialKey: 'github-skills-prod', + tenantId: 'tenant-a', + }, + ], + }, + }, + }); + expect(result.success).toBe(true); + expect(result.data?.skillSync?.github?.sources[0]?.tenantId).toBe('tenant-a'); + }); + + it('rejects the reserved system tenant id on a GitHub skill sync source', () => { + const result = configSchema.safeParse({ + version: '1.3.11', + skillSync: { + github: { + enabled: true, + sources: [ + { + id: 'librechat-skills', + owner: 'LibreChat', + repo: 'skills', + paths: ['skills'], + credentialKey: 'github-skills-prod', + tenantId: '__SYSTEM__', + }, + ], + }, + }, + }); + expect(result.success).toBe(false); + }); + it('rejects enabled GitHub skill sync without sources', () => { const result = configSchema.safeParse({ version: '1.3.11',