Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changeset completeness check #1494

Merged
merged 9 commits into from May 13, 2024
Merged

changeset completeness check #1494

merged 9 commits into from May 13, 2024

Conversation

edwardfoyle
Copy link
Member

Problem

Our current changeset checks assert that PR that touch public packages have a changeset, but it does not check that all packages with changes are actually included in a changeset. This puts an unnecessary manual burden on the PR author and reviewer to ensure that all modified packages are included in a changeset.

Issue number, if available:

Changes

Add a PR check to validate that any modified package is included in a changeset

Corresponding docs PR, if applicable:

Validation

Running some experiments on this PR

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

changeset-bot bot commented May 10, 2024

⚠️ No Changeset found

Latest commit: 74d8ec5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@edwardfoyle edwardfoyle marked this pull request as ready for review May 10, 2024 20:10
@edwardfoyle edwardfoyle requested review from a team as code owners May 10, 2024 20:10
0618
0618 previously approved these changes May 10, 2024
bombguy
bombguy previously approved these changes May 13, 2024
sobolk
sobolk previously approved these changes May 13, 2024
throw new Error(
`The following packages have changes but are not included in any changeset:${EOL}${EOL}${packagesMissingChangesets.join(
EOL
)}${EOL}${EOL}Add a changeset using 'npx changeset add' or 'npx changeset add --empty' if this is a non-functional change.`
Copy link
Member

Choose a reason for hiding this comment

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

I think message now should clarify that --empty is allowed if only private packages are changed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Things like adding tests or linting a public package could also have an empty changeset. Although maybe those cases are small enough that it's not worth mentioning

Copy link
Member

Choose a reason for hiding this comment

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

Good point.
We could perhaps have some predicate function in the algorithm that narrows down this classification.

something like

const shouldHaveNonEmptyChangeSet: () : 'yes'|'no'|'maybe' => {

if (API.md changed) {
 return yes
}
if (Only Test Changed) {
return no
}

return maybe;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll leave this as a future optimization if needed. For now, I just removed the empty changeset suggestion. Having an unnecessary version bump is much better than a missing version bump.

@edwardfoyle edwardfoyle dismissed stale reviews from sobolk, bombguy, and 0618 via 74d8ec5 May 13, 2024 16:47
@edwardfoyle edwardfoyle enabled auto-merge (squash) May 13, 2024 17:10
@edwardfoyle edwardfoyle merged commit 3855f17 into main May 13, 2024
35 checks passed
@edwardfoyle edwardfoyle deleted the changeset-check branch May 13, 2024 18:09
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.

None yet

4 participants