Skip to content

ci: add README package catalog drift check#111

Merged
markshust merged 1 commit into
developfrom
feature/readme-package-drift-check
Jun 3, 2026
Merged

ci: add README package catalog drift check#111
markshust merged 1 commit into
developfrom
feature/readme-package-drift-check

Conversation

@markshust
Copy link
Copy Markdown
Collaborator

Summary

Prevents the kind of drift that caused #110 — where ~20 packages had shipped through 0.8.0 without ever being added to the root README catalog. Adds a simple guardrail and wires it into CI.

What it does

  • bin/check-readme-packages.sh enumerates every packages/* directory (excluding composer.json type: project, currently only marko/skeleton) and the catalog rows in README.md. Fails with a specific, actionable diff if either side is out of sync.
  • .github/workflows/readme-package-check.yml runs the script on PRs and develop/main pushes that touch packages/, README.md, the script, or the workflow.

Why not autogenerate the catalog?

Considered and rejected. Autogeneration would require adding extra.marko.category (or similar) to all 92 packages, locking the README into a build artifact, and forcing editorial decisions into config. This approach keeps the README hand-authored — the check just asserts the invariant "every module appears somewhere." Predictable, no metadata churn, degrades gracefully.

Verified locally

  • Aligned state: bin/check-readme-packages.sh exits 0 with README.md package catalog is aligned with packages/ (92 modules).
  • Missing row: removing a row produces Packages present under packages/ but missing from README.md: - testing and exit 1
  • Orphan row: adding a ghost row produces Packages referenced in README.md but not present under packages/ ... - ghost and exit 1

Test plan

  • CI workflow runs and passes on this PR
  • Spot-check that the script also runs cleanly on a fresh git clone

Adds bin/check-readme-packages.sh — a simple guardrail that asserts
the root README.md package catalog stays in sync with packages/.
Fails fast if a new package lands without a README row, or if the
README references a package that no longer exists.

The check treats every directory under packages/ as a catalog
candidate except composer.json type: project (currently only
marko/skeleton, which is an application template rather than a
module). Pure shell + jq, no metadata added to package composer.json
files — the README stays hand-authored, the check just enforces
"every module appears somewhere."

Wired into a new readme-package-check workflow that runs on PRs and
develop/main pushes that touch packages/, README.md, the script, or
the workflow itself.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the ci CI/CD pipeline and automation changes label Jun 3, 2026
@markshust markshust merged commit 8522c6f into develop Jun 3, 2026
2 checks passed
@markshust markshust deleted the feature/readme-package-drift-check branch June 3, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD pipeline and automation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant