Refactoring: Describe the repo's components in a module shared by the CI scripts

Merged
PO
14d ago
+315-218

What has been implemented

The CI scripts read the repo's extension, presets and bundles through one shared module, so that the install check and the release build in #30 use the same description of each component.

Before: code dependencies on the manifests

The install check reads the manifests with its own classes, and the other scripts import its helpers.

flowchart LR
	subgraph IC["install_check/"]
		R["repo.py<br>YamlFile, Manifests, SpeckitFloor"]
		C["components.py<br>Extension, Preset, Bundle<br>read their manifest, install, check"]
	end
	A["repo_audit/, audit_repos.py,<br>check_install.py"] --> R
	C --> R
	R --> M[("extension.yml<br>preset.yml<br>bundle.yml")]
	C --> M
	classDef install fill:#ffedd5,stroke:#ea580c,color:#7c2d12
	class R,C install

After: code dependencies on the shared module

One module describes each component. The install check, the audit and the release build in #30 read it.

flowchart LR
	subgraph REPO["repo/"]
		CO["components.py<br>Component: Extension, Preset, Bundle"]
		F["files.py<br>YamlFile, FrontMatter, Snapshot"]
	end
	IC["install_check/<br>ExtensionInstall, PresetInstall, BundleInstall"] --> CO
	A["repo_audit/, check_install.py<br>SpeckitFloor"] --> CO
	D["distribution/ in #30<br>zips and catalogs"] -.-> CO
	CO --> F
	F --> M[("extension.yml<br>preset.yml<br>bundle.yml")]
	classDef shared fill:#dcfce7,stroke:#16a34a,color:#14532d
	class CO,F shared

Structure

Component classes

Component is abstract. Each subclass gives its kind, its manifest key and its commands:

ClassManifestFolderCommands
Extensionextension.ymlthe repo rootprovides.commands
Presetpresets/<id>/preset.ymlpresets/<id>/its templates of type command
Bundlebundles/<id>/bundle.ymlbundles/<id>/none

#30 adds to these classes the files of each zip and what each component provides.

CI

No change of behaviour: the install check installs and checks the same components as before, on the minimum Spec Kit version.

Folders structure

  • .github/scripts/repo/: the component classes and the file readers, new
  • .github/scripts/install_check/: builds its checks from the component classes; SpeckitFloor moves to speckit.py
  • .github/scripts/tests/components/: the tests of Components and Snapshot, new

How to review

Read the commits in order:

  1. 9a25459 moves YamlFile, FrontMatter and Snapshot from install_check/repo.py to repo/files.py, unchanged. To skim.
  2. ac9c76d adds the abstract Component with Extension, Preset and Bundle, and Components, which lists them in a repo. SpeckitFloor now reads these classes. To review closely.
  3. 73b6c2a makes the install check build its checks from these classes, with ExtensionInstall, PresetInstall and BundleInstall, and removes Manifests. To review.

šŸ¤– Generated with Claude Code