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

RHINENG-8141: improve evaluation performance #1461

Merged
merged 15 commits into from
Aug 13, 2024

Conversation

Dugowitch
Copy link
Contributor

@Dugowitch Dugowitch commented Aug 13, 2024

Refactored in a way that all data is loaded and evaluated first. Then, all updates (and just the updates) are done in a single transaction. Furthermore, advisories are now processed like package have been.

For code review see #1457.

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Copy link

jira-linking bot commented Aug 13, 2024

Referenced Jiras:
https://issues.redhat.com/browse/RHINENG-8141

@Dugowitch Dugowitch requested a review from psegedy August 13, 2024 12:59
@Dugowitch Dugowitch marked this pull request as ready for review August 13, 2024 12:59
- put `parseStored` and `parseReported` code into `evaluateChanges` --
  separate functions are not needed
- remove pointer to extendedAdvisories because it's unnecessary
- edit function doc comment after changes
- move slice-to-map logic into `getAdvisoryMetadataByNames` since all
  uses converted the returned slice into a map
- rename the function to `getAdvisoryMetadataIDs` to reflect changes
- propagate changes into functions that used `getAdvisoryMetadataByNames`
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 80.38462% with 51 lines in your changes missing coverage. Please review.

Project coverage is 64.97%. Comparing base (0a56574) to head (e5890ec).
Report is 1 commits behind head on master.

Files Patch % Lines
evaluator/evaluate_advisories.go 84.61% 18 Missing and 10 partials ⚠️
evaluator/evaluate.go 72.72% 8 Missing and 4 partials ⚠️
evaluator/evaluate_packages.go 72.00% 6 Missing and 1 partial ⚠️
base/database/utils.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1461      +/-   ##
==========================================
+ Coverage   64.82%   64.97%   +0.15%     
==========================================
  Files         114      114              
  Lines        7801     7804       +3     
==========================================
+ Hits         5057     5071      +14     
+ Misses       2217     2208       -9     
+ Partials      527      525       -2     
Flag Coverage Δ
unittests 64.97% <80.38%> (+0.15%) ⬆️

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.

@psegedy psegedy merged commit 5adb8a6 into RedHatInsights:master Aug 13, 2024
3 of 4 checks passed
@Dugowitch Dugowitch deleted the RHINENG-8141 branch September 26, 2024 10:10
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