fix(ci): changelog-gate accepts .changeset/ files#746
Conversation
9fa1c93 to
c8ef640
Compare
There was a problem hiding this comment.
Pull request overview
Updates the repository’s CI changelog gate to accept Changesets as an alternative to direct CHANGELOG.md edits when SDK/CLI source files change, and documents the intended contributor workflow.
Changes:
- Adjust
changelog-gatein CI to pass when either a.changeset/*.mdfile orCHANGELOG.mdis modified. - Expand
CONTRIBUTING.mdwith interactive/manual Changeset creation guidance and CI gate behavior. - Add a Changeset file describing this CI behavior change.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
CONTRIBUTING.md |
Documents preferred Changesets workflow and how the CI gate evaluates changelog compliance. |
.github/workflows/squad-ci.yml |
Updates changelog-gate logic to accept .changeset/*.md or CHANGELOG.md. |
.changeset/fix-changelog-gate.md |
Adds a changeset entry for the CI gate behavior change. |
|
|
||
| ```bash | ||
| npx changeset add | ||
| npx changeset |
There was a problem hiding this comment.
This section recommends npx changeset, but earlier in this same file the PR checklist still says npx changeset add. To avoid confusing contributors (and accidental CI failures), align on one command and use it consistently (likely npx changeset add if you intend to invoke the interactive add flow).
| npx changeset | |
| npx changeset add |
There was a problem hiding this comment.
✅ Fixed. Aligned to npx changeset add consistently throughout the file.
| --- | ||
| '@bradygaster/squad-cli': patch | ||
| --- | ||
|
|
||
| Fix changelog-gate CI to accept .changeset/ files as alternative to direct CHANGELOG.md edits |
There was a problem hiding this comment.
This new changeset file is committed with CRLF line endings (\r), unlike other files in .changeset/. Please normalize to LF to avoid noisy diffs and potential tooling edge cases on *nix environments.
There was a problem hiding this comment.
✅ Fixed. Normalized to LF line endings.
|
@copilot Please review this PR. Focus on: Are the shell scripts in the CI jobs correct? Any edge cases where the changelog-gate or changelog-protection could false-positive or false-negative? Is the approved-authors check secure? |
CI Workflow Review — PR #746✅ APPROVE (with minor recommendations)Validation Results✓ Workflow YAML
✓ changelog-protection Job
✓ fetch-depth: 0 Usage
✓ Job Independence
✓ Changeset Formatting
✓ CONTRIBUTING.md
✓ Commit Quality
Minor Observations
✓ fix-roster-sync.md Changeset SummaryWorkflow design is sound. The dual-gate approach (changelog-gate + changelog-protection) effectively prevents merge conflicts while protecting CHANGELOG.md integrity. Job logic is correct, error messages are helpful. Ready to merge with minor polish on the conditional logic. |
✅ APPROVEReview SummaryI've thoroughly reviewed the changelog-gate and changelog-protection implementation. The solution is well-designed and production-ready. Detailed Analysis1. changelog-gate Logic ✅ CORRECT
2. changelog-protection Approved-Authors List ✅ COMPLETEApproved authors correctly include:
List is complete and secure. 3. Edge Cases Handled ✅ ROBUST
4. CONTRIBUTING.md Clarity ✅ EXCELLENT
5. CHANGELOG Conflict Prevention ✅ EFFECTIVEProblem solved: Multiple PRs editing CHANGELOG.md = merge conflicts
Security Reviewchangelog-gate
changelog-protection
Verdict: ✅ APPROVE AND MERGEThis PR is production-ready. It improves dev workflow by enabling parallel PR development without CHANGELOG merge conflicts, while maintaining strong guardrails on who can edit the final CHANGELOG.md file. |
|
@test-review.md |
- changelog-gate now passes when .changeset/*.md files are present - New changelog-protection gate blocks non-approved authors from editing CHANGELOG.md directly (approved: bradygaster, bots) - Updated CONTRIBUTING.md with changeset workflow documentation - Prevents merge conflicts when multiple PRs are open Closes #745 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c8ef640 to
d8c1382
Compare
- CHANGESET_ADDED: use BASE...HEAD diff with --diff-filter=AM instead of hardcoded origin/dev...HEAD; use precise grep patterns and exclude .changeset/README.md to avoid false-positives from deleted files or repo documentation - approved-authors: replace grep -qw (regex, [bot] chars unsafe) with tr + grep -qxF for exact fixed-string per-line matching - Align npx changeset -> npx changeset add in error messages Agent-Logs-Url: https://github.com/bradygaster/squad/sessions/c82281d6-e434-4f43-96d9-2618923e7c9a Co-authored-by: diberry <41597107+diberry@users.noreply.github.com>
Reviewed and addressed in commit
Command consistency: Aligned all error messages and CONTRIBUTING.md to |
CHANGESET_ADDEDto use--diff-filter=AMwith"$BASE"..."$HEAD"and exclude.changeset/README.mdapproved-authorscheck to use exact string match (tr + grep -qxF) instead of regex-susceptible-wnpx changeset→npx changeset add.changeset/fix-changelog-gate.md(already in remote commit)npx changeset addin CONTRIBUTING.md (already in remote commit)