Skip to content

feat(ci): add samples build validation gate#674

Merged
tamirdresher merged 5 commits intobradygaster:devfrom
diberry:squad/103-samples-ci-upstream
Mar 29, 2026
Merged

feat(ci): add samples build validation gate#674
tamirdresher merged 5 commits intobradygaster:devfrom
diberry:squad/103-samples-ci-upstream

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Mar 29, 2026

Part 3: Repo Health -- Samples Build CI Gate

What

Adds a samples-build job to squad-ci.yml that validates all sample projects still compile and pass tests when SDK source files change.

Why

The 11 sample projects in samples/ ship with zero CI coverage. SDK changes can silently break samples, which users discover only when they try to follow a tutorial. This gate catches breakage at PR time, not after release.

Issue: #103
Gate 3 tracking: #104

How

  • New samples-build job in .github/workflows/squad-ci.yml
  • Only triggers on pull requests (same as changelog-gate and exports-map-check)
  • Only runs when files in packages/squad-sdk/src/ are changed (three-dot diff)
  • Feature-flagged: gate is ENABLED by default; set vars.SQUAD_SAMPLES_CI to false to disable
  • Skip label: skip-samples-ci (uses github.event.pull_request.labels per Copilot review lesson)
  • Installs root dependencies and builds the SDK first (samples reference SDK via file: links)
  • Loops through each samples/*/ directory:
    • Skips samples without package.json
    • Skips samples with no build or test scripts
    • Runs npm install, then npm run build and/or npm run test as applicable
  • Reports a summary with pass/fail/skip counts per sample
  • Uses GitHub Actions annotations (::error::, ::notice::) for clear CI output

Samples Inventory

Sample Build Test SDK Dep
autonomous-pipeline tsc vitest npm
azure-function-squad tsc tsx dry-run file:
cost-aware-router tsc vitest npm
hello-squad -- vitest file:
hook-governance -- vitest file:
knock-knock -- -- file:
rock-paper-scissors -- -- file:
skill-discovery -- vitest file:
storage-provider-azure N/A N/A N/A
storage-provider-sqlite N/A N/A N/A
streaming-chat tsc --noEmit vitest file:

Related Issues

Testing

  • npm run build -- passes
  • npm test -- 173 suites pass; 11 failures are pre-existing vitest worker timeouts unrelated to this YAML-only change
  • YAML change reviewed for correct indentation and step conditional logic
  • Feature flag and skip label patterns match existing changelog-gate and exports-map-check gates

Breaking Changes

None. This is an additive CI gate. It does not block existing jobs and can be disabled via feature flag or skip label.

Waivers

None requested.

Preflight

  • npm run build -- passes
  • npm test -- 173 suites pass, 11 pre-existing timeout failures (vitest worker resource exhaustion on Windows)

@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 29, 2026

@bradygaster Part 3 of the repo health series (after #672 PR requirements and #673 CI completeness gates). This adds CI coverage for all 11 sample projects -- SDK changes that break samples are now caught at PR time. CI green and ready to merge.

@diberry diberry marked this pull request as ready for review March 29, 2026 01:57
Copilot AI review requested due to automatic review settings March 29, 2026 01:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CI validation gates to ensure SDK changes don’t silently break repo expectations—most notably by compiling/testing sample projects on PRs.

Changes:

  • Adds a samples-build job that builds the SDK and then builds/tests each samples/* project when packages/squad-sdk/src/** changes.
  • Adds feature-flag + skip-label behavior to conditionally bypass the samples gate.
  • Introduces changelog-gate and exports-map-check jobs alongside the samples gate.

Comment thread .github/workflows/squad-ci.yml Outdated
Comment thread .github/workflows/squad-ci.yml
Comment thread .github/workflows/squad-ci.yml Outdated
Comment thread .github/workflows/squad-ci.yml Outdated
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 29, 2026

Fixed -- removed changelog-gate and exports-map-check from the diff. This PR now only adds the samples-build job. Those other gates are in PR #673.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/squad-ci.yml Outdated
Comment thread .github/workflows/squad-ci.yml
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 29, 2026

Valid enhancement -- tracked in diberry#112 (Samples CI enhancements). This PR ships the initial gate that catches build/test failures in samples with file: SDK references (8 of 11 samples). The npm-registry samples (autonomous-pipeline, cost-aware-router) need SDK reference patching to test against PR changes -- that is a follow-up.

@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 29, 2026

Fixed -- added a CI step that patches npm-registry samples (autonomous-pipeline, cost-aware-router) to use file:../../packages/squad-sdk before running builds. All 11 samples now validate against the PR's SDK changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/squad-ci.yml
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/squad-ci.yml Outdated
@tamirdresher
Copy link
Copy Markdown
Collaborator

@diberry is this ready to merge? i see a conflict

tamirdresher pushed a commit that referenced this pull request Mar 29, 2026
…eed heuristic

- Fix sample count: 11 → 9 (actual count in samples/ directory)
- Mark samples-build and changelog/exports gates as pending merge (#673, #674)
- Add concrete heuristic for bleed check (scope by packages/ directory)
- Clarify bash snippet as reference commands, not literal agent execution

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry and others added 5 commits March 29, 2026 06:47
Closes #103

Adds samples-build CI job that validates all 11 samples compile when SDK changes.
- Loops samples/ directories with npm install/build/test
- Feature-flagged via skip-samples-build label
- 15-minute timeout, --ignore-scripts, npm cache
- Accepted Copilot suggestions: cache-dependency-path, workspace root install

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Remove changelog-gate and exports-map-check from this PR's diff.
Those gates are in PR bradygaster#673. This PR should only add samples-build.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot review found that samples using @bradygaster/squad-sdk from
npm registry (autonomous-pipeline, cost-aware-router) were not
validated against the PR's SDK changes. This step rewrites their
package.json to use file:../../packages/squad-sdk before running
builds and tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/103-samples-ci-upstream branch from 8b84703 to d6c8d7c Compare March 29, 2026 13:50
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 29, 2026

Merge conflict resolved — rebased onto upstream/dev

What happened: PR #673 (changelog-gate + exports-map-check) merged to upstream/dev while this PR was open. Both PRs added content to the same region of squad-ci.yml (between the test and publish-policy jobs), causing a merge conflict.

How it was resolved:

  • Rebased the PR branch onto latest upstream/dev
  • Kept upstream's changelog-gate and exports-map-check jobs exactly as-is (from PR feat(ci): add CHANGELOG and exports map completeness gates #673)
  • Added only the samples-build job from this PR
  • Resolved 5 conflict regions across 7 rebased commits (2 dropped as already upstream)
  • Fixed a duplicate cache-dependency-path that snuck in during the conflict

Final diff: 1 file changed, 151 additions — scoped exclusively to the samples-build job. No changes to changelog-gate or exports-map-check.

The CI workflow now has all 6 jobs in order: docs-quality, test, changelog-gate, exports-map-check, samples-build, publish-policy.

@tamirdresher — conflict is resolved, should be mergeable now.

Copy link
Copy Markdown
Collaborator

@tamirdresher tamirdresher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: 1 file changed (squad-ci.yml only), all 6 CI checks green, all 8 Copilot review findings resolved. Clean samples-build gate with feature flag + skip label pattern matching existing gates. LGTM.

@tamirdresher tamirdresher merged commit 1513359 into bradygaster:dev Mar 29, 2026
6 checks passed
robzelt pushed a commit to robzelt/squad that referenced this pull request Apr 1, 2026
)

Adds useTerminalHeight() hook and viewport-aware layout with height-bounded content area. Reserves 3 rows for InputPrompt.

Closes bradygaster#674
Closes bradygaster#675
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.

Workflow dual-path support for .squad/ migration

4 participants