-
Notifications
You must be signed in to change notification settings - Fork 347
fix(fossid-webapp): Deduplicate and normalize ignore rules #10657
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
base: main
Are you sure you want to change the base?
fix(fossid-webapp): Deduplicate and normalize ignore rules #10657
Conversation
plugins/scanners/fossid/src/main/kotlin/events/CloneRepositoryHandler.kt
Outdated
Show resolved
Hide resolved
plugins/scanners/fossid/src/main/kotlin/events/CloneRepositoryHandler.kt
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10657 +/- ##
============================================
+ Coverage 57.25% 57.30% +0.04%
Complexity 1646 1646
============================================
Files 341 341
Lines 12692 12705 +13
Branches 1199 1202 +3
============================================
+ Hits 7267 7280 +13
Misses 4965 4965
Partials 460 460
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d77c6fa
to
46ec571
Compare
plugins/scanners/fossid/src/main/kotlin/events/CloneRepositoryHandler.kt
Outdated
Show resolved
Hide resolved
b3d1f6b
to
d4a3b61
Compare
plugins/scanners/fossid/src/main/kotlin/events/CloneRepositoryHandler.kt
Outdated
Show resolved
Hide resolved
d4a3b61
to
6448835
Compare
|
||
/** | ||
* Deduplicate and normalize ignore rules [allRules] by removing duplicate directory and file rules, and by stripping | ||
* the trailing "/ *" from directory rule values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there a space too much in between "/ *"...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentionally. If you don't add a space, then it is interpreted as the beginning of a new comment. I tried to find a solution, but adding a space is the easiest option that was returned in my searches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I propose to spell it out instead, like "the trailing slash and asterisk".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ugly, but you could close the comment with a double */*/
:
https://youtrack.jetbrains.com/issue/KT-23333/Nested-multiple-line-block-comment-breaks-the-parsing#focus=Comments-27-3947881.0-0
6448835
to
d2ec1b2
Compare
Looks like some test needs to be adjusted. |
Head branch was pushed to by a user without write access
d2ec1b2
to
862591a
Compare
@sschuberth @mnonnenmacher Unfortunately the tests are still failing, as you already noticed. Please consider to merge it nevertheless, as we would like to have a new ORT release as soon as possible, as this issue currently blocks our FossID scans. |
@wkl3nk, the test I was linking indicates there's a real (mocking) issue caused by your changes. So just rebasing does not help. You need to adjust the test. |
Deduplicate and normalize ignore rules by removing the trailing "/*" from directory rules and also remove duplicate directory, file and extension rules. This prevents a problem where FossID reports an error when ignore rules are created that already exist. Signed-off-by: klw1imb <[email protected]>
862591a
to
e4c52bf
Compare
@sschuberth Oh sorry, yes, a test was failing and I did not recognized. I adapted the code now. |
Deduplicate and normalize ignore rules by removing the trailing "/*" from directory rules and also remove duplicate directory,file and extension rules.
This prevents a problem where FossID reports an error when ignore rules are created that already exist.
"Scanner job '177452' failed."
java.lang.IllegalArgumentException: Could not 'create ignore rules'. Additional information: Rule already exists.