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

Make issues for unmapped licenses consider concluded licenses #4082

Merged
merged 2 commits into from
May 28, 2021

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

@sschuberth sschuberth requested a review from a team as a code owner May 28, 2021 09:46
@@ -49,15 +49,17 @@ data class CuratedPackage(
/**
* Check if this package contains any erroneous data.
*/
fun collectIssues(): List<OrtIssue> =
pkg.declaredLicensesProcessed.unmapped.map { unmappedLicense ->
fun collectIssues(): List<OrtIssue> {
Copy link
Member

@fviernau fviernau May 28, 2021

Choose a reason for hiding this comment

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

The issue is just a warning. I believe it's better to not do this change to keep the default behavior simple and thus easier to understand for the user. I suspect that the behavior 'as-is' before and after this change anyway does not match the needs of all users.

Instead of adding more complexity here I propose to (1) add a policy rule to our defaults which implements your idea with a rule violation and to (2) optionally eliminate creating this ORT issue completely.

(In general I think we should move towards reporting issues via rule violations where applicable. It's already valuable for just customizing the severity, let alone the added flexibility)

What do you think?

Copy link
Member Author

@sschuberth sschuberth May 28, 2021

Choose a reason for hiding this comment

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

Leaving this as-is is not an option for us. We have an "everything must be green" mandate, so also warnings need to be addressed.

While we could have gotten rid of the warning by creating a mapping as part of a curation, there is little reason to create such a mapping if its result is anyway going to be overridden by a concluded license.

But I do see some more options:

  • lower the severity to hint (which for us results in a "green" run) if a concluded license is set
  • only log a warning for this, but not create an issue if a concluded license is set

How about these?

Copy link
Member

Choose a reason for hiding this comment

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

In general, I like the approach to put more of such checking logic into rules, where it can be customized according to the users' needs.

In this special case, I find the implementation of this PR more intuitive compared to the current state. The user might have explicitly added a curation for a concluded license to get rid off these warnings.

Copy link
Member

@fviernau fviernau May 28, 2021

Choose a reason for hiding this comment

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

The fact that Bosch fixes all warning and HERE doesn't makes it hard to make a good proposal.
I believe it indicates that severity should be under user control, so that everybody can decide what exactly is a must fix.
Anyhow, the only additional idea I'd throw into the basket of options is the following (which tries to avoid adding complexity into ORT)

  1. Turn this issue into a hint
  2. Implement a rule violation with your desired (more complex) logic

_edit: On the other hand warning seems just right, so I can't see any short term options which is ideal imo. I'd actually prefer @sschuberth 's proposal to "lower the severity to hint (which for us results in a "green" run) if a concluded license is set" _

Copy link
Member Author

Choose a reason for hiding this comment

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

On the other hand warning seems just right, so I can't see any short term options which is ideal imo. I'd actually prefer @sschuberth 's proposal to "lower the severity to hint (which for us results in a "green" run) if a concluded license is set"

Ok, I'll make the change, as I also like to have a warning for this in the general case.

This is a preparation to take properties of a CuratedPackage into account
in this function.

Signed-off-by: Sebastian Schuberth <[email protected]>
If a concluded license is set, declared licenses are likely not taken
into account at all (depending on policy rules), so lower the severity of
unmapped declared licneses in this case.

Fixes #4081.

Signed-off-by: Sebastian Schuberth <[email protected]>
@sschuberth sschuberth force-pushed the unmapped-consider-concluded branch from fe5fa32 to 7c6a80e Compare May 28, 2021 11:06
@sschuberth
Copy link
Member Author

I'll work on the PipFunTest failure separately...

@sschuberth sschuberth merged commit 042d821 into master May 28, 2021
@sschuberth sschuberth deleted the unmapped-consider-concluded branch May 28, 2021 12:12
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