-
Notifications
You must be signed in to change notification settings - Fork 317
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
test(reporters): Add three scan issues to report test assets #8552
Conversation
e01a939
to
50aeb43
Compare
@@ -65,59 +65,80 @@ issue_resolutions: | |||
comment: "A comment explaining why the issue can be ignored." | |||
issues: | |||
- _id: 0 | |||
timestamp: "2024-04-22T10:36:10.661544294Z" |
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.
Add one issue to an included- and another to an excluded project
"Add one issue to an included and another one to an excluded project"
This prepares adding the ability
"This prepares for adding the ability" or "This prepares to add the ability"
50aeb43
to
e89a519
Compare
e89a519
to
6b893b2
Compare
The replacement has been introduced for replacing the report creation timestamp only. However, `replace()` replaces all matches and the pattern would all so match the timestamp value of issues. So, replace only the first match, so that issues (with timestamps) can be added in a following change. [1]: ba0e4cb Signed-off-by: Frank Viernau <[email protected]>
6b893b2
to
03dd6ae
Compare
plugins/reporters/evaluated-model/src/funTest/kotlin/EvaluatedModelReporterFunTest.kt
Fixed
Show fixed
Hide fixed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8552 +/- ##
=========================================
Coverage 67.68% 67.68%
Complexity 1006 1006
=========================================
Files 246 246
Lines 7924 7924
Branches 883 883
=========================================
Hits 5363 5363
Misses 2181 2181
Partials 380 380
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Add one issue with an included and one issue with an excluded affected path to an included project. Furthermore, add on issue with an included affected path to an excluded project. This prepares to add the ability to vizualize issues with excluded effected path as excluded, in the WebApp as well as in the static HTML report. Note: There are three copies of `reporter-test-input.yml` which are all updated for consistency. Furthermore, the affected paths of the issues have been choosen to be within the VCS path, so that the issues do net get filtered out by `OrtResult.getScanResultsForId()`. Signed-off-by: Frank Viernau <[email protected]>
03dd6ae
to
5ff7c71
Compare
@@ -190,6 +221,97 @@ scan_results: | |||
package_verification_code: "da39a3ee5e6b4b0d3255bfef95601890afd80709" | |||
packages: | |||
- _id: 0 | |||
id: "Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0" |
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.
Any idea why the numeric IDs of the packages seem to be swapped now? That makes the diff a bit difficult to read...
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.
No idea. This is always imho difficult to figure out as the IDs are assigned by Jackson.
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.
@sschuberth - I've debugged this for quite a bit, and it seems to just depend on the order things get serialized. E.g. the first identifier which gets serialized gets the 0
assigned. The next identifier the 1
and so forth. So, with this change Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0
gets serialized first.
I believe such diffs we have to live with, as long as we use the above mentioned approach to assign identifiers.
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.
E.g. the first identifier which gets serialized gets the
0
assigned.
Right, but why does the order of identifiers change with your PR, shouldn't it all be deterministic? In any case, thanks for looking into it.
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.
Right, but why does the order of identifiers change with your PR, shouldn't it all be deterministic?
Hm, each time one make a small change to the test asset one needs to debug why jackson assigns the IDs in the way it does is imo raising the bar for contributions quite a bit. Can we shortcut this and live without the explanation ?
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.
Investigating further. Maybe @mnonnenmacher does the issue here ring any bell? (can you help?)
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.
I believe it is as follows:
- The
EvaluatedModel.issues
property comes beforeEvaluatedModel.packages
. - The issues do reference packages
- So, the assignment of the package identifiers start when
issues
are serialized, and the ordering of
the issues determines the IDs of the referenced packages. - As this commit adds a new first issue, the package referenced gets the first id:
0
.
So, it seemed natural to just change property order so that packages
are serialized before the issues, but
that would re-create a similar issues, because there is a cyclic reference between these instances.
@sschuberth what do you think?
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.
That sounds reasonable as an explanation, good enough for me, thanks!
First preparations for implementing #8373.