Fix handling of group disallowedChangeTypes with dependent bumps#1238
Draft
ecraig12345 wants to merge 1 commit into
Draft
Fix handling of group disallowedChangeTypes with dependent bumps#1238ecraig12345 wants to merge 1 commit into
ecraig12345 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Beachball’s bump calculation to correctly apply group-level disallowedChangeTypes during dependent bump propagation, and to only run the dependent-bump traversal when bumpDeps is enabled.
Changes:
- Restrict
updateRelatedChangeTypeexecution tobumpDeps: trueand pass a cachedpackageToGroupmapping for faster group lookup. - Update dependent-bump traversal to propagate through groups while applying repo/group/package
disallowedChangeTypes. - Extend/adjust unit tests to cover group bumping behavior and group
disallowedChangeTypes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/beachball/src/bump/updateRelatedChangeType.ts | Reworks the dependent bump traversal, adds group-aware handling and cached group lookup. |
| packages/beachball/src/bump/bumpInMemory.ts | Only invokes dependent traversal when bumpDeps is enabled; builds packageToGroup cache during group initialization. |
| packages/beachball/src/tests/bump/updateRelatedChangeType.test.ts | Updates the helper/setup and adds coverage for group propagation and group disallowedChangeTypes. |
| change/change-e5e83f54-1a36-4545-9dcc-ee8af7201e1e.json | Adds the change file entry documenting this fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+89
to
100
| // If this package is in a group, enqueue other packages in the group. | ||
| // (Use an extra set tracking groups to avoid iterating over all member packages.) | ||
| const groupKey = groupName ? (`${groupName}#${dependentChangeType}` as const) : undefined; | ||
| if (group && groupKey && !seenGroups.has(groupKey)) { | ||
| seenGroups.add(groupKey); | ||
| for (const packageNameInGroup of group.packageNames) { | ||
| const key: SeenKey = `${packageNameInGroup}#${dependentChangeType}`; | ||
| if (!seen.has(key)) { | ||
| seen.add(key); | ||
| queue.push({ subjectPackage: packageNameInGroup, dependentChangeType: newType }); | ||
| } | ||
| } |
Comment on lines
+91
to
+99
| const groupKey = groupName ? (`${groupName}#${dependentChangeType}` as const) : undefined; | ||
| if (group && groupKey && !seenGroups.has(groupKey)) { | ||
| seenGroups.add(groupKey); | ||
| for (const packageNameInGroup of group.packageNames) { | ||
| const key: SeenKey = `${packageNameInGroup}#${dependentChangeType}`; | ||
| if (!seen.has(key)) { | ||
| seen.add(key); | ||
| queue.push({ subjectPackage: packageNameInGroup, dependentChangeType: newType }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix handling of group
disallowedChangeTypesin dependent bumps (bumpInMemoryandupdateRelatedChangeType).This should be non-breaking, but this bumping code is the most complex part of beachball and has a higher risk of unexpected side effects, so it's only going in v3. Though from tests, this change didn't cause any failures, and it makes a couple disabled tests pass that didn't before.
Changes:
updateRelatedChangeTypeifbumpDepsis enabled. (Bumping of groups withoutbumpDepsis handled inbumpInMemorypass 2.)