Skip to content

feat!: facade API (gate.yml + security.yml) — the plug-and-play CI contract - #25

Open
CMaintz wants to merge 1 commit into
mainfrom
feat/facade-api-v2
Open

CMaintz wants to merge 1 commit into
mainfrom
feat/facade-api-v2

Conversation

@CMaintz

@CMaintz CMaintz commented Sep 26, 2026

Copy link
Copy Markdown
Owner

The v2.0.0 foundation. Makes foundry genuinely plug-and-play: consumers pin two stable facades and pass their stack, instead of knowing which per-stack workflow files exist.

The API

jobs:
  gate:     { uses: CMaintz/foundry/.github/workflows/gate.yml@v2,     with: { stack: java, working_directory: backend } }
  security: { uses: CMaintz/foundry/.github/workflows/security.yml@v2, with: { ruleset_paths: '<repo regex>' } }
  • gate.yml dispatches by stack (ts/java/php) to the internal per-stack gate (+ smells; Java adds opt-in spotbugs). Monorepo → call once per package.
  • security.yml runs secrets + ruleset-guard + SAST in one call.
  • Each exposes a stable gate-ok / security-ok aggregate → the only required checks; their names never churn when a stack is added or an internal is renamed.

How it works

Per-stack + guards + semgrep are now _-prefixed internals (_java/_ts/_php/_guards/_semgrep). The facades reach them via nested local uses: ./.github/workflows/_X.yml, which GitHub resolves to foundry at the ref the consumer pinned — so there's no cross-repo pin to keep in sync, and the internals can be reorganized freely behind the facade. web/bootstrap/ratchet-report/autofix stay public (called directly).

foundry-init now emits facade-callers; README/FEATURES/OVERVIEW/DESIGN updated.

⚠️ BREAKING → v2.0.0 (release-please will propose it): the CI API is now the two facades. @v1 stays frozen with the old per-stack names; adopt the facades at @v2.

Validation: foundry's own actionlint (lint-workflows) checks the YAML/expressions here. The full runtime behavior (dispatch + aggregate + nested-reusable resolution) gets its first real exercise when jobbuddy migrates to consume these facades — PR2, which lands after this merges + v2 is cut (jobbuddy pins @v2). If the nested-resolution behaves unexpectedly, it surfaces there and I fix it in v2.0.1.

Consumers pin two stable facades instead of per-stack files:
  gate:     uses gate.yml with {stack, working_directory}  # -> _java/_ts/_php
  security: uses security.yml                              # -> _guards + _semgrep
The per-stack + guards + semgrep workflows are _-prefixed to mark them internal; facades
reach them via nested local 'uses: ./.github/workflows/_X.yml', which GitHub resolves to
foundry at the consumer's pinned ref (no cross-repo pin). Each facade exposes one stable
*-ok aggregate check, so required-check names don't churn when a stack is added or an
internal renamed. foundry-init emits facade-callers; README/FEATURES/OVERVIEW/DESIGN updated.

BREAKING CHANGE: the CI API is now gate.yml + security.yml. Direct references to
java.yml/ts.yml/php.yml/tier0.yml/semgrep.yml must move to the facades. @v1 keeps the old
names frozen; adopt the facades at @v2.
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.

1 participant