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

Enhanced functionality to improve developer experience by identifying… #7494

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dimitris-iliou
Copy link

@dimitris-iliou dimitris-iliou commented Sep 13, 2023

… parent packages or projects from duplicate packages. This commit introduces new features that parse the dependency graph, starting from the duplicate package and ending at the parent package/project that encompasses it.

#6465

… parent packages or projects from duplicate packages. This commit introduces new features that parse the dependency graph, starting from the duplicate package and ending at the parent package/project that encompasses it.

Signed-off-by: iliou <[email protected]>
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

detekt found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@sschuberth
Copy link
Member

Thanks or the contribution @dimitris-iliou. But before you put too much effort in it, be informed that during one of the last ORT community meetings it was agreed that the best solution to address the issue is to not have duplicate IDs between project and packages to begin with, and deduplicate these by replacing references with package linkage in the dependency tree by references that link to the project instead.

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.01%. Comparing base (3fac582) to head (f2f7c66).
Report is 2489 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7494   +/-   ##
=========================================
  Coverage     68.01%   68.01%           
  Complexity     2023     2023           
=========================================
  Files           339      339           
  Lines         16719    16719           
  Branches       2371     2371           
=========================================
  Hits          11371    11371           
  Misses         4363     4363           
  Partials        985      985           
Flag Coverage Δ
funTest-docker 69.33% <ø> (ø)
funTest-non-docker 36.46% <ø> (ø)

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.

@scottschreckengaust
Copy link

Thanks or the contribution @dimitris-iliou. But before you put too much effort in it, be informed that during one of the last ORT community meetings it was agreed that the best solution to address the issue is to not have duplicate IDs between project and packages to begin with, and deduplicate these by replacing references with package linkage in the dependency tree by references that link to the project instead.

@sschuberth : How might multiple subdirectories with the same python package dependencies within each requirements.txt file be constructed to not throw an exception?

20:18:16.195 [DefaultDispatcher-worker-1] ERROR java.lang.Object - Multiple projects with the same id 'PIP::src:1b11e6b573ecdb3a109776554dc04462bc00a82b' found. Not adding the project defined in 'https://github.com/organization/repository.git/src/module1/requirements.txt' to the analyzer results as it duplicates the project defined in 'https://github.com/organization/repository/src/module2/requirements.txt'.
Exception in thread "main" java.lang.IllegalArgumentException: Unable to create the AnalyzerResult as it contains packages and projects with the same ids: 
...

from this TODO

// TODO: It might be, e.g. in the case of PIP "requirements.txt" projects, that different projects with
// the same ID exist. We need to decide how to handle that case.
.

causing this exception

"Unable to create the AnalyzerResult as it contains packages and projects with the same ids: " +
duplicates.values

For example:

`+ src
|_ src/module1/requirements.txt
|_ src/module2/requirements.txt

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.

3 participants