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

Preparations for removing ReporterInput.resolutionProvider #8048

Merged
merged 6 commits into from
Dec 20, 2023
Merged

Conversation

fviernau
Copy link
Member

@fviernau fviernau commented Dec 19, 2023

See individual commits.

Part of #7921.

@fviernau fviernau requested a review from a team as a code owner December 19, 2023 11:27
@fviernau fviernau enabled auto-merge (rebase) December 19, 2023 11:41
Copy link

codecov bot commented Dec 19, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (c9fdf41) 67.07% compared to head (398a621) 67.08%.

Files Patch % Lines
...kotlin/commands/repoconfig/RemoveEntriesCommand.kt 0.00% 2 Missing ⚠️
...oconfig/GenerateRuleViolationResolutionsCommand.kt 0.00% 1 Missing ⚠️
...src/main/kotlin/utils/DefaultResolutionProvider.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8048   +/-   ##
=========================================
  Coverage     67.07%   67.08%           
  Complexity     2054     2054           
=========================================
  Files           357      357           
  Lines         17120    17120           
  Branches       2457     2457           
=========================================
+ Hits          11484    11485    +1     
  Misses         4613     4613           
+ Partials       1023     1022    -1     
Flag Coverage Δ
funTest-docker 66.22% <ø> (ø)
funTest-non-docker 34.24% <0.00%> (+0.13%) ⬆️
test 36.75% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Use the analog `OrtResult.getRuleViolations()` instead.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
The function only returns resolutions from the repository
configurations, but not the other ones from the resolved configuration.
This prepares for introducing a new `getResolutions()` implementation
which returns all resolutions contained in the ORT result.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Prepare for making use of it in a following change.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Make the functions adhere to the resolutions from the resolved
configuration instead of those from the repository configuration.
This enables upcoming simplifactions in the callers of these function.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Retrieve all resolutions from the provider earlier, and integrate them
into the `OrtResult` before passing the `OrtResult` to the reporters.
This obviously makes it unnecessary to pass the `ResolutionProvider` to
the reporters and prepares for removing the corresponding property from
`ReporterInput`, so that it does not get passed around anymore.

Until then, just pass a `ResolutionProvider` constructed from
`OrtResult`'s resolutions, to avoid querying the resolutions again.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
The reporter command has been changed to ensure that all resolutions
are included in the `OrtResult` before passing it around to the
reporters. Reflect that also in this test asset.

This prepares for the removal of `ResolutionProvider` from the
`EvaluatedModelMapper` / `StatisticsCalculator`.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Issue(message = "Issue message to resolve", source = ""),
Issue(message = "Non-resolved issue", source = "")
)
Identifier("Maven:org.oss-review-toolkit:example:1.0") to listOf(
Copy link
Member

Choose a reason for hiding this comment

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

Just for my understanding: Is this change necessary because the original resolution from the repo config was not actually "baked" into the resolutions from the resolved configuration in the hard-coded test asset, although it usually would be if the repo config is read by ORT?

Copy link
Member

Choose a reason for hiding this comment

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

I.e. this is a bit similar to the adjustments of the test asset in your last commit 398a621, correct?

@fviernau fviernau merged commit 10c0362 into main Dec 20, 2023
21 of 22 checks passed
@fviernau fviernau deleted the rm-rp-prep branch December 20, 2023 10:33
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