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

rhel: add repo_key matching constraint #1398

Merged

Conversation

crozzy
Copy link
Contributor

@crozzy crozzy commented Aug 28, 2024

As the matcher now no longer queries on repo name, it means the result set returned from the DB is a lot larger. This change limits the results to just those added by the RHEL updater (previously OVAL now VEX).

@crozzy crozzy requested a review from a team as a code owner August 28, 2024 22:35
@crozzy crozzy requested review from hdonnay and removed request for a team August 28, 2024 22:35
@crozzy
Copy link
Contributor Author

crozzy commented Aug 28, 2024

This reduces results by around 90% for some packages I analyzed:

select count(*)
FROM 
  "vuln" 
  INNER JOIN "uo_vuln" ON ("vuln"."id" = "uo_vuln"."vuln") 
  INNER JOIN "latest_update_operations" ON (
    "latest_update_operations"."id" = "uo_vuln"."uo"
  ) 
WHERE 
  (
    (
      (
        ("package_name" = 'tar') 
        AND ("package_kind" = 'binary')
      ) 
      OR (
        ("package_name" = 'tar') 
        AND ("package_kind" = 'source')
      )
    ) 
    AND ("package_module" = '') 
    AND (
      "latest_update_operations"."kind" = 'vulnerability'
    )
  )
-- 252
select count(*)
FROM 
  "vuln" 
  INNER JOIN "uo_vuln" ON ("vuln"."id" = "uo_vuln"."vuln") 
  INNER JOIN "latest_update_operations" ON (
    "latest_update_operations"."id" = "uo_vuln"."uo"
  ) 
WHERE 
  (
    (
      (
        ("package_name" = 'tar') 
        AND ("package_kind" = 'binary')
      ) 
      OR (
        ("package_name" = 'tar') 
        AND ("package_kind" = 'source')
      )
    ) 
    AND ("package_module" = '') 
    AND (
      "latest_update_operations"."kind" = 'vulnerability'
    )
    AND (
      "repo_key" = 'rhel-cpe-repository'
    )
  )
-- 21

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 55.35%. Comparing base (64d2456) to head (8dd6a35).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datastore/postgres/querybuilder.go 0.00% 2 Missing ⚠️
rhel/matcher.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1398   +/-   ##
=======================================
  Coverage   55.34%   55.35%           
=======================================
  Files         282      282           
  Lines       17839    17841    +2     
=======================================
+ Hits         9873     9875    +2     
- Misses       6931     6932    +1     
+ Partials     1035     1034    -1     

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

@crozzy crozzy force-pushed the matcher-add-repository-key-constraint branch 2 times, most recently from fef6cf5 to 2484c9e Compare September 3, 2024 20:58
As the matcher now no longer queries on repo name, it means the result
set returned from the DB is a lot larger. This change limits the results
to just those added by the RHEL updater (previously OVAL now VEX).

Signed-off-by: crozzy <[email protected]>
@crozzy crozzy force-pushed the matcher-add-repository-key-constraint branch from 2484c9e to 8dd6a35 Compare September 5, 2024 19:34
@crozzy
Copy link
Contributor Author

crozzy commented Sep 5, 2024

/fast-forward

@github-actions github-actions bot merged commit 8dd6a35 into quay:main Sep 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants