🐛 fix(thirdparty): prune nested project snapshots

This commit is contained in:
csh
2026-04-01 14:25:25 +08:00
parent a2a697e97b
commit da85d4efbb
4 changed files with 45 additions and 35 deletions
+8 -5
View File
@@ -33,10 +33,10 @@ class ThirdpartySkillsPipelineTests(unittest.TestCase):
self.assertEqual(ui_skill["sync_mode"], "render_codex_skill")
self.assertEqual(ui_skill["snapshot_dir"], "ui-ux-pro-max")
def test_superpowers_manifest_excludes_ui_ux_pro_max_from_copy_mode(self):
def test_superpowers_manifest_prunes_non_superpowers_paths(self):
data = load_manifest()
superpowers = next(item for item in data["sources"] if item["id"] == "superpowers")
self.assertEqual(superpowers["exclude_skill_dirs"], ["ui-ux-pro-max"])
self.assertEqual(superpowers["remove_paths"], ["skills/ui-ux-pro-max"])
def test_workflow_uses_generic_scripts_and_single_serial_job(self):
text = WORKFLOW.read_text(encoding="utf-8")
@@ -90,6 +90,9 @@ class ThirdpartySkillsPipelineTests(unittest.TestCase):
self.assertIn('manifest_copy="$tmp_dir/thirdparty_skills.json"', text)
self.assertIn('cp "$MANIFEST_PATH" "$manifest_copy"', text)
self.assertIn('MANIFEST_PATH="$manifest_copy"', text)
self.assertIn("remove_paths", text)
self.assertIn('remove_snapshot_paths "$snapshot_dir" "$remove_paths"', text)
self.assertIn("- Remove-Paths:", text)
self.assertIn('if ! emit_sources_tsv > "$sources_file"; then', text)
self.assertNotIn("done < <(emit_sources_tsv)", text)
self.assertLess(
@@ -97,13 +100,13 @@ class ThirdpartySkillsPipelineTests(unittest.TestCase):
text.index('git checkout -B "$TARGET_BRANCH" "origin/$TARGET_BRANCH"'),
)
def test_sync_script_uses_non_whitespace_separator_for_optional_fields(self):
def test_sync_script_assumes_thirdparty_snapshot_is_already_clean(self):
text = SYNC_SCRIPT.read_text(encoding="utf-8")
self.assertIn('"\\x1f".join(', text)
self.assertIn("while IFS=$'\\x1f' read -r", text)
self.assertNotIn("while IFS=$'\\t' read -r", text)
self.assertIn("exclude_skill_dirs", text)
self.assertIn('if is_excluded_skill_dir "$name" "$exclude_skill_dirs"; then', text)
self.assertNotIn("exclude_skill_dirs", text)
self.assertNotIn("is_excluded_skill_dir", text)
if __name__ == "__main__":