Skip to content

Fix dependent propagation when a project has multiple dependents#27

Open
JohnCampionJr wants to merge 2 commits into
solarwinds:mainfrom
jcamp-code:fix/multi-dependent-bug
Open

Fix dependent propagation when a project has multiple dependents#27
JohnCampionJr wants to merge 2 commits into
solarwinds:mainfrom
jcamp-code:fix/multi-dependent-bug

Conversation

@JohnCampionJr

Copy link
Copy Markdown

Found this while working on a new feature.

When a project is referenced by more than one other project, changeset version
only 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.

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.
Copilot AI review requested due to automatic review settings June 8, 2026 19:28
@JohnCampionJr JohnCampionJr requested a review from a team as a code owner June 8, 2026 19:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants