Skip to content

Require next-major targets for breaking changes - #2153

Open
jar-stripe wants to merge 5 commits into
masterfrom
jar/breakingchanges-nextmajor-mergetarget-changelog
Open

jar-stripe wants to merge 5 commits into
masterfrom
jar/breakingchanges-nextmajor-mergetarget-changelog

Conversation

@jar-stripe

@jar-stripe jar-stripe commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Why?

Breaking SDK changes must land on sdk-release/next-major so they do not enter the current major release from master.

What?

  • Default workflow token permissions to none, with read-only permissions granted only to the changefile rule.
  • Add a rules job that finds newly added top-level Hark changefiles through the paginated pull request files API.
  • Inspect new changefiles with Hark and require major changes to target sdk-release/next-major.
  • Allow the release pull request that merges sdk-release/next-major into master.
  • Rerun the rules workflow when pull request contents or the base branch change.
  • Add a patch changefile for this user-facing workflow behavior.
  • Verify the generated workflow matches the sdk-codegen template, passes actionlint, and passes repository CI.

See Also

Configuration

  • skip-changefile: This PR is not a user-facing change, so there's no changefile.

Committed-By-Agent: goose
Orbit-Session-Id: c9e24cd7-9c07-436c-8756-f6998b381745
Comment thread .github/workflows/rules.yml Fixed
Committed-By-Agent: goose
Orbit-Session-Id: c9e24cd7-9c07-436c-8756-f6998b381745
Committed-By-Agent: goose
Orbit-Session-Id: c9e24cd7-9c07-436c-8756-f6998b381745
Committed-By-Agent: goose
Orbit-Session-Id: c9e24cd7-9c07-436c-8756-f6998b381745
@jar-stripe
jar-stripe marked this pull request as ready for review September 18, 2026 20:32
@jar-stripe
jar-stripe requested a review from a team as a code owner September 18, 2026 20:32
@jar-stripe
jar-stripe requested review from justiny-stripe and a lite review from Copilot and removed request for a team September 18, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Inspect renamed changefiles and pin the Hark action to an audited commit.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR adds CI enforcement requiring breaking Hark changes to target sdk-release/next-major.

Changes:

  • Adds paginated changefile discovery and Hark inspection.
  • Updates workflow permissions and pull request triggers.
  • Documents the behavior with a patch changefile.
File summaries
File Summary
.hark/changes/2026-09-18_jar_require-next-major-target.change.md Documents the workflow behavior.
.github/workflows/rules.yml Implements branch-target validation and workflow updates.
Review details

Suppressed comments (1)

.github/workflows/rules.yml:56

  • Filtering only for status == "added" lets a breaking changefile bypass this check when it is introduced via a rename: the pull request files API reports the destination as status: "renamed", so it will never reach hark inspect even though the PR adds a new .hark/changes/*.change.md path. Include renamed entries (or otherwise inspect every changed non-deleted changefile) before applying the branch restriction.
          if ! paths=$(jq -sc             '[.[] | select(.status == "added") | .filename | select(test("^[.]hark/changes/[^/]+[.]change[.]md$"))]'             <<< "$files" 2>&1); then
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/rules.yml
Comment thread .github/workflows/rules.yml Outdated
Comment on lines +78 to +82
if [[ "$major_paths" != "[]" && "$BASE_REF" != "sdk-release/next-major" ]]; then
affected_paths=$(jq -r 'join(", ")' <<< "$major_paths")
echo "::error::Major Hark changefiles must target sdk-release/next-major. Retarget this pull request from '$BASE_REF' to 'sdk-release/next-major'. Affected files: $affected_paths"
exit 1
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Committed-By-Agent: goose
Orbit-Session-Id: c9e24cd7-9c07-436c-8756-f6998b381745
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.

4 participants