Skip to content

Fix handling of group disallowedChangeTypes with dependent bumps#1238

Draft
ecraig12345 wants to merge 1 commit into
mainfrom
ecraig/related-change
Draft

Fix handling of group disallowedChangeTypes with dependent bumps#1238
ecraig12345 wants to merge 1 commit into
mainfrom
ecraig/related-change

Conversation

@ecraig12345

Copy link
Copy Markdown
Member

Fix handling of group disallowedChangeTypes in dependent bumps (bumpInMemory and updateRelatedChangeType).

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:

  • Only call updateRelatedChangeType if bumpDeps is enabled. (Bumping of groups without bumpDeps is handled in bumpInMemory pass 2.)
  • TODO...

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.

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 updateRelatedChangeType execution to bumpDeps: true and pass a cached packageToGroup mapping 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 thread packages/beachball/src/bump/updateRelatedChangeType.ts
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 });
}
@ecraig12345 ecraig12345 marked this pull request as draft May 7, 2026 05:38
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.

2 participants