From bee202e9f5fcfa6c7cc63fbd5998f16388b8789d Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Sun, 4 Oct 2026 15:28:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A4=20test:=20Cover=20Alias=20Frontmat?= =?UTF-8?q?ter=20Keys=20in=20the=20Skill=20Sync=20Skip=20(#16725)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: Cover Alias Frontmatter Keys in the Skill Sync Skip * test: Assert the Alias Frontmatter Rerun Succeeds Without Skips --- packages/api/src/skills/sync/github.spec.ts | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/api/src/skills/sync/github.spec.ts b/packages/api/src/skills/sync/github.spec.ts index d3fe5eb4c5..1063d3bb4b 100644 --- a/packages/api/src/skills/sync/github.spec.ts +++ b/packages/api/src/skills/sync/github.spec.ts @@ -3900,6 +3900,33 @@ describe('steady-state sync of an unchanged source', () => { expect((await getMirror()).version).toBe(before.version); }); + it.each([ + ['canonical', 'always-apply: true'], + ['camelCase alias', 'alwaysApply: true'], + ['both spellings', 'always-apply: true\nalwaysApply: true'], + ['placeholder canonical with alias', 'always-apply:\nalwaysApply: false'], + ['placeholder alias with canonical', 'always-apply: false\nalwaysApply:'], + ['mixed-case', 'Always-Apply: true\nAllowed-Tools: [Read]\nLicense: MIT'], + ])('skips an unchanged skill whose frontmatter uses %s keys', async (_label, frontmatter) => { + const repo = createRepo({ + 'skills/research/SKILL.md': { + content: `---\nname: research\ndescription: Research things\n${frontmatter}\n---\nBody`, + }, + }); + await seed(repo); + const before = await getMirror(); + + const deps = createDbDeps(repo); + const result = await createGitHubSkillSyncRunner(deps).runOnce(); + + expect(result.sources[0]).toEqual( + expect.objectContaining({ status: 'succeeded', syncedSkillCount: 1, skippedSkillCount: 0 }), + ); + expect(repo.fetchFileContent).not.toHaveBeenCalled(); + expect(deps.updateSkill).not.toHaveBeenCalled(); + expect((await getMirror()).version).toBe(before.version); + }); + it('downloads SKILL.md and updates the skill when its blob changes', async () => { const repo = createRepo(baseRepo()); await seed(repo);