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

fix(SpdxDocumentFile): Support nested DEPENDS_ON relations #8376

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

JSurf
Copy link
Contributor

@JSurf JSurf commented Mar 5, 2024

This fixes nested DEPENDS_ON relations as discussed in:
#8359

The main issue was that the dependsOnCase function is not always correctly defined.

There might be a better way to restructure the code and also support other nested relationships (if this is wanted) but my kotlin skills are very limited to do further improvements

@JSurf JSurf requested a review from a team as a code owner March 5, 2024 10:02
@sschuberth
Copy link
Member

The main issue was that the dependsOnCase function is not always correctly defined.

Thanks a lot for the contribution, @JSurf! I believe we should explain the above in more detail in the commit message. I propose to add:

While the `getDependencies()` function overload that takes the
`dependencyOfRelation` argument is generic with respect to the
relationship, whenever `DEPENDENCY_OF` is passed, also `dependsOnCase`
should be passed to handle dependency relationships bidirectionally. This
is exactly what the `getDependencies()` convenience function that only
takes three arguments is there for, so make use of that.

Also add a new test case to cover the `DEPENDS_ON` case.

Fixes #8359.

The last line will cause the issue to get auto-closed upon merge of the PR.

@JSurf JSurf force-pushed the fix-depends-on branch 2 times, most recently from 43ff749 to 91083a9 Compare March 6, 2024 13:37
While the `getDependencies()` function overload that takes the
`dependencyOfRelation` argument is generic with respect to the
relationship, whenever `DEPENDENCY_OF` is passed, also `dependsOnCase`
should be passed to handle dependency relationships bidirectionally. This
is exactly what the `getDependencies()` convenience function that only
takes three arguments is there for, so make use of that.

Also add a new test case to cover the `DEPENDS_ON` case.

Fixes oss-review-toolkit#8359.

Signed-off-by: Jens Viebig <[email protected]>
@JSurf
Copy link
Contributor Author

JSurf commented Mar 6, 2024

@sschuberth Made requested changes, please review again

@JSurf JSurf requested a review from sschuberth March 6, 2024 13:44
@sschuberth sschuberth enabled auto-merge (rebase) March 6, 2024 21:08
@sschuberth sschuberth merged commit d0bfd1b into oss-review-toolkit:main Mar 7, 2024
20 checks passed
@sschuberth sschuberth changed the title fix(SpdxDocumentFile): Support nested DEPENDS_ON relations fix(SpdxDocumentFile): Support nested DEPENDS_ON relations Mar 7, 2024
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