fix(ci): expand changelog gate to cover template and scaffolding paths#1195
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the Squad CI workflow to also treat template changes as “SDK/CLI changes” that require a changeset or a CHANGELOG update.
Changes:
- Expands the path filter from only
packages/squad-(sdk|cli)/src/to also include template directories. - Updates step-summary and error messaging to reflect the broader “source or template” scope.
✅ Added a regression test for the changelog gatePer review request, this PR now includes an automated suite that verifies the gate actually catches the paths it's supposed to. New file: How it works: the test reads the live
If anyone renames/removes the regex variable or narrows it (re-opening the #1156 gap), the suite fails. Runs under
Commit: bd3c9ac |
|
Added a changeset documenting this PR's changelog-gate scope widening. It records a patch bump for |
|
cc @tamirdresher @bradygaster — heads up: this PR changes how the changelog/changeset gate behaves, which affects what lands in release notes going forward. What changes:
Flagging since this alters contributor workflow (more PRs will be asked for a changeset) and the release-note pipeline. Closes #1156. |
|
Good use of #1035 as the regression example — that kind of real-world evidence makes the case much cleaner than a hypothetical. The test-reads-live-regex approach is the right call. A few things before this lands.
Issue #1156 explicitly called that path out as a bypass path. The current The "full canonical mirror" comment is wrong. The diff says: "The top-level CONTRIBUTING.md is now out of date. Lines 190 and 217 both still say the changeset gate applies only to One test hygiene note. In Fix the first three; the fourth is up to you but I''d do it. Core logic is sound, changeset is appropriate. |
Address review on bradygaster#1195: - Add .squad/agents/*/charter.md to SDK_CLI_PATH_REGEX (final bradygaster#1156 bypass path) - Correct the templates/ comment: append-only superset of .squad-templates/, not a full mirror - Update CONTRIBUTING.md changeset-gate scope to match the widened gate - Wrap the regex-presence assertion in beforeAll so YAML drift surfaces as a readable failure - Extend the gate test with governed/unrelated .squad/agents cases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🟡 Impact Analysis — PR #1195Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedci-workflows (1 file)
root (2 files)
tests (1 file)
This report is generated automatically for every PR. See #733 for details. |
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 6 commits — consider squashing before review |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | Changeset file found |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | 0 active Copilot thread(s) resolved (2 outdated skipped) |
| ❌ | CI passing | 7 check(s) still running |
Files Changed (4 files, +84 −8)
| File | +/− |
|---|---|
.changeset/widen-changelog-gate-template-paths.md |
+7 −0 |
.github/workflows/squad-ci.yml |
+10 −4 |
CONTRIBUTING.md |
+4 −4 |
test/ci/changelog-gate.test.ts |
+63 −0 |
Total: +84 −8
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
🏗️ Architectural Review
Automated architectural review — informational only. |
|
Thanks @tamirdresher — all addressed in 831cea8.
Also refreshed the changeset to mention the charter path. |
The changelog-gate job only matched packages/squad-(sdk|cli)/src/, so PRs touching bundled templates, scaffolding, and agent files bypassed the changeset requirement silently. Expand the SDK_CLI_CHANGED pattern to also match packages/squad-(sdk|cli)/templates/, .squad-templates/, and templates/, aligning CI enforcement with CONTRIBUTING.md. Closes bradygaster#1156 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follows up bradygaster#1156: the changelog gate now also fires on template/scaffolding path changes, so the failure message should mention template files, not only source. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address PR review feedback on the changelog gate: consolidate the grep -E alternation into a single SDK_CLI_PATH_REGEX variable for readability and safer extension, and document why the whole top-level templates/ tree is governed (it is a canonical mirror of .squad-templates/ per scripts/sync-templates.mjs). No behavioral change. Closes bradygaster#1156 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add test/ci/changelog-gate.test.ts, which reads the live SDK_CLI_PATH_REGEX from .github/workflows/squad-ci.yml and asserts a table of governed paths (src/ + all template trees) match the gate while unrelated paths (docs, root configs, package.json) do not. The test extracts the pattern from the workflow itself so it stays in sync with the gate. Guards the fix for bradygaster#1156 against regression. Closes bradygaster#1156 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes bradygaster#1156 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review on bradygaster#1195: - Add .squad/agents/*/charter.md to SDK_CLI_PATH_REGEX (final bradygaster#1156 bypass path) - Correct the templates/ comment: append-only superset of .squad-templates/, not a full mirror - Update CONTRIBUTING.md changeset-gate scope to match the widened gate - Wrap the regex-presence assertion in beforeAll so YAML drift surfaces as a readable failure - Extend the gate test with governed/unrelated .squad/agents cases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
831cea8 to
7240262
Compare
Summary
The
changelog-gatejob in.github/workflows/squad-ci.ymlcomputedSDK_CLI_CHANGEDusing a pattern that only matched^packages/squad-(sdk|cli)/src/. As a result, PRs that touched bundled templates, scaffolding, or agent files bypassed the changeset requirement silently.This change expands the
SDK_CLI_CHANGEDgrep pattern to also match:packages/squad-(sdk|cli)/templates/.squad-templates/templates/The two related summary/echo strings were updated to accurately reflect that the gate now also covers template changes ("no SDK/CLI source or template changes" / "SDK/CLI source or template files changed:"). No other logic was changed.
Closes #1156
Scope
.github/workflows/squad-ci.yml.packages/*/src/untouched).packages/squad-sdk/srcorpackages/squad-cli/src).Testing
grep -Epattern against sample paths:packages/squad-sdk/src/z.ts,packages/squad-cli/templates/y.md,.squad-templates/foo.md, andtemplates/skills/x/SKILL.mdall match, whileREADME.mddoes not match.js-yamlparse →YAML OK).npm run buildpasses from the repo root (YAML-only change, build unaffected).Real-world example: PR #1035
#1035 ("fix: context overflow sentinel and coordinator size reduction", merged 2026-05-22) is a concrete case of this gap:
packages/squad-cli/templates/,packages/squad-sdk/templates/,.squad-templates/, andtemplates/(~2,000+ lines), pluspackages/squad-cli/package.json.packages/squad-(sdk|cli)/src/files.src/-only gate,SDK_CLI_CHANGEDmatched nothing -> the Changelog Gate reported "Not applicable" and passed -> no changeset was required or added, even though substantial shipped template content changed.CHANGELOG.mdupdate, or theskip-changeloglabel).Automated gate test (added in this PR)
Added
test/ci/changelog-gate.test.ts(vitest) to lock in the widened gate and guard #1156 against regression.SDK_CLI_PATH_REGEXdirectly from.github/workflows/squad-ci.yml(single source of truth), builds a JSRegExp, and asserts a table of paths. If the regex variable is renamed/removed, the suite fails loudly.packages/squad-sdk/src/,packages/squad-cli/src/, bothpackages/squad-(sdk|cli)/templates/trees,.squad-templates/, and top-leveltemplates/.README.md,docs/...,.github/workflows/squad-ci.yml,package.json,packages/squad-cli/package.json(boundary case — not undersrc//templates/),scripts/..., and the test file itself.npm test(vitest run, which only collectstest/**/*.test.ts).npx vitest run test/ci/changelog-gate.test.ts-> 15 passed;npm run buildpasses.