Skip to content

ci(extensions): gate hook and template contracts - #3634

Closed
tang-vu wants to merge 1 commit into
Osmantic:mainfrom
tang-vu:ci/extension-hook-template-contracts
Closed

tang-vu wants to merge 1 commit into
Osmantic:mainfrom
tang-vu:ci/extension-hook-template-contracts

Conversation

@tang-vu

@tang-vu tang-vu commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Why this matters

Extension lifecycle hooks and the 13 user-facing service templates are shipped release assets. Their contract suites existed, but neither make test nor any GitHub workflow ran them. A broken hook precedence rule, invalid template YAML, duplicate template ID, or reference to a missing service could therefore merge without a release signal.

The hook suite also could not serve as a gate as written: it exported an EXTENSIONS_DIR fixture that service-registry.sh immediately overwrites while loading. Against current main, the documented command reported 2 passed / 2 failed without exercising either hook-resolution path.

The preserved invariant is that hooks.post_install wins over legacy setup_hook, legacy-only manifests still resolve, traversal is rejected, and every shipped template parses with a unique ID and references real bundled/library services.

What changed

  • point the hook test's public SCRIPT_DIR input at its isolated fixture root so the real registry loader reads the fixture manifests
  • add the hook and template contract suites to make test
  • add both suites to the Linux manifest-validation job, where PyYAML is explicitly installed

No production runtime behavior or shipped manifest is changed.

Overlap check

Searched open and closed PRs by test-hooks.sh, test-templates.sh, hook/template CI, and all changed files. The historical PRs that introduced these suites are closed; no open PR wires either suite into a release gate or repairs the fixture root. #2909 validates dependency graphs and #3387 runs Python service suites; neither changes these tests or their contracts.

Regression boundary

Both tests execute the repository-owned public boundaries rather than inspecting implementation text:

  • test-hooks.sh loads fixture manifests through lib/service-registry.sh and asserts the resolved hook paths
  • test-templates.sh parses all shipped template YAML and service manifests, then checks IDs and references across bundled and library catalogs

Validation

  • pre-change bash tests/test-hooks.sh — reproduced 2 passed, 2 failed
  • post-change bash tests/test-hooks.sh — 4 passed, 0 failed, 0 skipped
  • bash tests/test-templates.sh — 27 passed, 0 failed
  • bash -n tests/test-hooks.sh tests/test-templates.sh — passed
  • parsed .github/workflows/test-linux.yml with PyYAML — passed
  • git diff --check — passed

Tradeoffs and rollback

The Linux gate already installs pinned PyYAML, so these checks run rather than skip there. On an ad-hoc host without Python/PyYAML, the suites retain their existing explicit skip behavior. Reverting this commit only removes the gate and restores the broken fixture input; it has no runtime state or migration impact.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. We're closing outside-contributor pull requests that have had no activity for 14 days or more, so the queue reflects work that can still land. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and reopen it or open a focused PR. See #7253 for details and the contribution policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants