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

feat: add workspaceRelationship #7889

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

Conversation

DmitriyLewen
Copy link
Contributor

Description

Add workspaceRelationship.

workspaceRelationship will be used for cargo, npm, maven, etc. packages.
See #7802 for more details.

This PR also adds workspaceRelationship for maven modules.

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@DmitriyLewen DmitriyLewen self-assigned this Nov 7, 2024
@DmitriyLewen DmitriyLewen marked this pull request as ready for review November 8, 2024 05:55
@@ -26,7 +26,7 @@
"Name": "poco",
"Identifier": {
"PURL": "pkg:conan/[email protected]",
"UID": "312753cebe80c0eb"
"UID": "1c5e3b385e0d9c68"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you have any idea why UID is different now?

Copy link
Contributor Author

@DmitriyLewen DmitriyLewen Nov 8, 2024

Choose a reason for hiding this comment

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

I added workspaceRelationship as 2:

RelationshipUnknown Relationship = iota
RelationshipRoot
RelationshipWorkspace // For maven `modules`. TODO use it for cargo and npm workspaces
RelationshipDirect
RelationshipIndirect

to correct sorting:
switch {
case pkgs[i].Relationship != pkgs[j].Relationship:
if pkgs[i].Relationship == RelationshipUnknown {
return false
} else if pkgs[j].Relationship == RelationshipUnknown {
return true
}
return pkgs[i].Relationship < pkgs[j].Relationship

So when we calc UID - we use 4 instead of 3 for IndirectRelationship (as example)

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.

bug(java): dependOn contains extra dependencies for pom.xml files with modules when using SBOM formats
2 participants