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

chore(DependencyGraphNavigator): Avoid relying on manager name prefixes #9776

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sschuberth
Copy link
Member

@sschuberth sschuberth commented Jan 17, 2025

This removes the assumption that package manager names start with the name of the type of project they manage in favor of collecting all root indices that match the project and ensuring that they only stem from a single manager.

@sschuberth sschuberth requested a review from a team as a code owner January 17, 2025 18:51
@sschuberth sschuberth enabled auto-merge (rebase) January 17, 2025 18:51
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.07%. Comparing base (e510c6f) to head (2273808).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9776   +/-   ##
=========================================
  Coverage     68.07%   68.07%           
  Complexity     1284     1284           
=========================================
  Files           249      249           
  Lines          8827     8827           
  Branches        918      918           
=========================================
  Hits           6009     6009           
  Misses         2432     2432           
  Partials        386      386           
Flag Coverage Δ
funTest-docker 65.00% <ø> (ø)
funTest-non-docker 33.36% <ø> (ø)
test-ubuntu-24.04 35.89% <ø> (ø)
test-windows-2022 35.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sschuberth sschuberth changed the title chore(DependencyGraphNavigator): Avoid relying on manage name prefixes chore(DependencyGraphNavigator): Avoid relying on manager name prefixes Jan 17, 2025
// TODO: Relax this assumption that package manager names start with the name of the type of project
// they manage, for example that "GradleInspector" manages "Gradle" projects.
val managers = graphs.keys.filter { it.startsWith(project.id.type) }
// Collect all root indices for all manager whose graphs have projects of the respective type.
Copy link
Member

Choose a reason for hiding this comment

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

typo: managers

This removes the assumption that package manager names start with the name
of the type of project they manage in favor of collecting all root
indices that match the project and ensuring that they only stem from a
single manager.

Signed-off-by: Sebastian Schuberth <[email protected]>
…bled

This fails early additionally to the check the `DependencyGraphNavigator`
does in `directDependencies()`. The latter check is still and anyway
required to unambiguously get the direct dependencies for a project
unless the API is changed.

Signed-off-by: Sebastian Schuberth <[email protected]>
@sschuberth sschuberth requested review from fviernau and a team January 18, 2025 12:31
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