Skip to content

Commit 831cea8

Browse files
obit91Copilot
andcommitted
fix(ci): cover .squad/agents charters, fix gate docs and test hygiene
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>
1 parent 3b50205 commit 831cea8

4 files changed

Lines changed: 19 additions & 10 deletions

File tree

.changeset/widen-changelog-gate-template-paths.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
Widen changelog-gate coverage for template and scaffolding paths
66

7-
Previously, the changelog gate only required a changeset for `packages/squad-(sdk|cli)/src/` changes, so template and scaffolding updates under `packages/squad-(sdk|cli)/templates/`, `.squad-templates/`, and top-level `templates/` could reach users with no release-note entry. This widens the gate to those paths so user-facing template changes are no longer silently omitted from release notes. Closes #1156.
7+
Previously, the changelog gate only required a changeset for `packages/squad-(sdk|cli)/src/` changes, so template and scaffolding updates under `packages/squad-(sdk|cli)/templates/`, `.squad-templates/`, top-level `templates/`, and agent charters under `.squad/agents/*/charter.md` could reach users with no release-note entry. This widens the gate to those paths so user-facing template and scaffolding changes are no longer silently omitted from release notes. Closes #1156.

.github/workflows/squad-ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,10 @@ jobs:
221221
CHANGED=$(git diff --name-only "$BASE"..."$HEAD")
222222
# Paths whose changes ship behavioral or scaffolding updates and therefore
223223
# require a changeset (or CHANGELOG update). The top-level templates/ tree is
224-
# a full canonical mirror of .squad-templates/ (see scripts/sync-templates.mjs),
225-
# so the entire tree is governed squad scaffolding, not unrelated content.
226-
SDK_CLI_PATH_REGEX='^packages/squad-(sdk|cli)/src/|^packages/squad-(sdk|cli)/templates/|^\.squad-templates/|^templates/'
224+
# the primary sync target of .squad-templates/ (see scripts/sync-templates.mjs) —
225+
# an append-only superset whose entire tree is governed squad scaffolding, not
226+
# unrelated content. Agent charters under .squad/agents/ are likewise governed.
227+
SDK_CLI_PATH_REGEX='^packages/squad-(sdk|cli)/src/|^packages/squad-(sdk|cli)/templates/|^\.squad-templates/|^templates/|^\.squad/agents/.+/charter\.md$'
227228
SDK_CLI_CHANGED=$(echo "$CHANGED" | grep -E "$SDK_CLI_PATH_REGEX" || true)
228229
if [ -z "$SDK_CLI_CHANGED" ]; then
229230
echo "✅ Not applicable (no SDK/CLI source or template changes)" >> $GITHUB_STEP_SUMMARY

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ External contributors don't have write access, so the review-to-merge flow has a
187187

188188
**Your side (contributor):**
189189

190-
1. ✅ All required CI checks are green (build, test, lint; changeset/CHANGELOG gate only applies when `packages/squad-cli/src/` or `packages/squad-sdk/src/` files change)
190+
1. ✅ All required CI checks are green (build, test, lint; the changeset/CHANGELOG gate applies when `packages/squad-(sdk|cli)/src/` **or** governed template/scaffolding paths change — `packages/squad-(sdk|cli)/templates/`, `.squad-templates/`, top-level `templates/`, and `.squad/agents/*/charter.md`)
191191
2. ✅ PR is no longer a draft — mark as **"Ready for review"**
192192
3. ✅ Copilot reviewer bot posts its review automatically
193193
4. ✅ Review Copilot's suggestions and manually apply any you agree with in your fork
@@ -214,7 +214,7 @@ An automated readiness check runs on every PR and posts a checklist comment. Add
214214
| **Not in draft** | Mark your PR as "Ready for review" when it's done |
215215
| **Branch up to date** | Rebase on latest `dev` (`git fetch upstream && git rebase upstream/dev`) |
216216
| **Copilot review** | Wait for the Copilot reviewer bot to post its review |
217-
| **Changeset present** | Run `npx changeset add` if you changed files in `packages/squad-sdk/src/` or `packages/squad-cli/src/` |
217+
| **Changeset present** | Run `npx changeset add` if you changed `packages/squad-(sdk|cli)/src/` or governed template/scaffolding paths (`packages/squad-(sdk|cli)/templates/`, `.squad-templates/`, top-level `templates/`, `.squad/agents/*/charter.md`) |
218218
| **No merge conflicts** | Resolve any conflicts with the target branch |
219219
| **CI passing** | All CI checks (build, test, lint) must be green |
220220

test/ci/changelog-gate.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* regressions in governed source/template paths.
55
*/
66

7-
import { describe, it, expect } from 'vitest';
7+
import { describe, it, expect, beforeAll } from 'vitest';
88
import { readFileSync } from 'node:fs';
99
import path, { dirname } from 'node:path';
1010
import { fileURLToPath } from 'node:url';
@@ -14,10 +14,15 @@ const workflowPath = path.resolve(__dirname, '..', '..', '.github', 'workflows',
1414
const workflow = readFileSync(workflowPath, 'utf-8');
1515
const patternMatch = workflow.match(/SDK_CLI_PATH_REGEX='([^']+)'/);
1616

17-
expect(patternMatch, 'Expected changelog gate SDK_CLI_PATH_REGEX to be defined in squad-ci.yml').not.toBeNull();
17+
let regex: RegExp;
1818

19-
const pattern = patternMatch?.[1] ?? '';
20-
const regex = new RegExp(pattern);
19+
beforeAll(() => {
20+
expect(
21+
patternMatch,
22+
'Expected changelog gate SDK_CLI_PATH_REGEX to be defined in squad-ci.yml',
23+
).not.toBeNull();
24+
regex = new RegExp(patternMatch?.[1] ?? '');
25+
});
2126

2227
const governedPaths = [
2328
'packages/squad-sdk/src/index.ts',
@@ -28,6 +33,7 @@ const governedPaths = [
2833
'.squad-templates/scribe-charter.md',
2934
'templates/skills/release-process/SKILL.md',
3035
'templates/casting/policy.json',
36+
'.squad/agents/troi/charter.md',
3137
];
3238

3339
const unrelatedPaths = [
@@ -38,6 +44,8 @@ const unrelatedPaths = [
3844
'packages/squad-cli/package.json',
3945
'scripts/bump-build.mjs',
4046
'test/ci/changelog-gate.test.ts',
47+
'.squad/agents/troi/notes.md',
48+
'.squad/routing.md',
4149
];
4250

4351
describe('changelog gate path matching', () => {

0 commit comments

Comments
 (0)