Fix dependent propagation when a project has multiple dependents#27
Open
JohnCampionJr wants to merge 2 commits into
Open
Fix dependent propagation when a project has multiple dependents#27JohnCampionJr wants to merge 2 commits into
JohnCampionJr wants to merge 2 commits into
Conversation
GetProjectsDependentsNames added each dependent to its set but then overwrote the entry with a fresh single-element set, so only the last dependent survived. Add to the existing set instead of replacing it.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes version processing so that when a project is referenced by multiple other projects, all dependents receive the expected bump.
Changes:
- Correct dependent-project mapping to accumulate multiple dependents per referenced project.
- Add a regression test covering “one project referenced by two projects”.
- Add a changeset entry documenting the patch fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/SolarWinds.Changesets.Tests/Version/ChangelogGeneratorTests.cs | Adds a regression test ensuring two dependents are both bumped. |
| src/SolarWinds.Changesets/Commands/Version/Helpers/ChangelogGenerator.cs | Fixes dependent collection logic to avoid overwriting previously recorded dependents. |
| .changeset/fix-multiple-dependents.md | Documents the patch-level fix in the changeset system. |
HashSet iteration order can vary between runs (records hash by value and string hashing is randomized per process), so sort dependents by name when materializing to keep output ordering stable.
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.
Found this while working on a new feature.
When a project is referenced by more than one other project,
changeset versiononly bumped (and wrote a changelog for) one of those dependents — the last one
processed. GetProjectsDependentsNames added each dependent to its set but then
overwrote the entry with a fresh single-element set, so all but the last were lost.
Added a test with a project that has two dependents, and fixed the lookup to add
to the existing set instead of replacing it.