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

Only store policy data once #2184

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Conversation

joejstuart
Copy link
Member

Only collect the policy data once for each source group. Before this the data was duplicated for each component.

https://issues.redhat.com/browse/EC-1027

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 57.89474% with 8 lines in your changes missing coverage. Please review.

Project coverage is 71.21%. Comparing base (e614d88) to head (0c29154).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
cmd/validate/input.go 0.00% 6 Missing ⚠️
cmd/validate/image.go 84.61% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2184      +/-   ##
==========================================
- Coverage   71.22%   71.21%   -0.02%     
==========================================
  Files          88       88              
  Lines        7490     7501      +11     
==========================================
+ Hits         5335     5342       +7     
- Misses       2155     2159       +4     
Flag Coverage Δ
generative 71.21% <57.89%> (-0.02%) ⬇️
integration 71.21% <57.89%> (-0.02%) ⬇️
unit 71.21% <57.89%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
cmd/validate/image.go 91.55% <84.61%> (-0.28%) ⬇️
cmd/validate/input.go 42.24% <0.00%> (-0.46%) ⬇️

@joejstuart joejstuart changed the title Only store manyData once Only store policy data once Nov 25, 2024
Only collect the policy data once for each source
group. Before this the data was duplicated for
each component.

https://issues.redhat.com/browse/EC-1027
@@ -400,7 +400,7 @@ func validateImageCmd(validate imageValidationFunc) *cobra.Command {
close(jobs)

var components []applicationsnapshot.Component
var manyData [][]evaluator.Data
var evaluatorData [][]evaluator.Data
Copy link
Member

Choose a reason for hiding this comment

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

Should this be []evaludator.Data instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Intuitively, I think so, but I don't know if it adds any value and there's an acceptance test for it even, so I'd prefer to leave it alone.

Copy link
Member

@zregvart zregvart left a comment

Choose a reason for hiding this comment

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

One followup could be that we only collect the data if --output=data or the like was provided

@joejstuart
Copy link
Member Author

joejstuart commented Nov 26, 2024

One followup could be that we only collect the data if --output=data or the like was provided

I think this will do that. 0c29154

@joejstuart joejstuart merged commit b8c77a0 into enterprise-contract:main Nov 27, 2024
9 of 10 checks passed
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