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

Fix /api/v1/vulnerability/source/{source}/vuln/{vuln} returning all vulnerable components #934

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Sep 27, 2024

Description

Fixes /api/v1/vulnerability/source/{source}/vuln/{vuln} returning all vulnerable components.

Addressed Issue

Fixes DependencyTrack/hyades#1539

Additional Details

N/A

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@nscuro nscuro added the defect Something isn't working label Sep 27, 2024
@nscuro nscuro added this to the 5.6.0 milestone Sep 27, 2024
Copy link

codacy-production bot commented Sep 27, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.02% (target: -1.00%) 100.00% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (816b742) 21980 18164 82.64%
Head commit (802993c) 22000 (+20) 18186 (+22) 82.66% (+0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#934) 44 44 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@nscuro nscuro force-pushed the issue-1539 branch 2 times, most recently from 87f5265 to bf6b697 Compare September 29, 2024 16:46
@nscuro
Copy link
Member Author

nscuro commented Sep 29, 2024

Testing with GHSA-288c-cq4h-88gq which affects 115 projects in my test portfolio:

image

Before:

$ hey -H 'X-Api-Key: odt_***' -n 1000 http://localhost:8080/api/v1/vulnerability/source/GITHUB/vuln/GHSA-288c-cq4h-88gq

Summary:
  Total:	34.9204 secs
  Slowest:	3.4239 secs
  Fastest:	0.2278 secs
  Average:	1.6650 secs
  Requests/sec:	28.6366


Response time histogram:
  0.228 [1]	|
  0.547 [39]	|■■■■■■■
  0.867 [62]	|■■■■■■■■■■
  1.187 [100]	|■■■■■■■■■■■■■■■■■
  1.506 [145]	|■■■■■■■■■■■■■■■■■■■■■■■■
  1.826 [234]	|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2.145 [238]	|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2.465 [121]	|■■■■■■■■■■■■■■■■■■■■
  2.785 [46]	|■■■■■■■■
  3.104 [10]	|■■
  3.424 [4]	|■


Latency distribution:
  10% in 0.8551 secs
  25% in 1.2955 secs
  50% in 1.7246 secs
  75% in 2.0573 secs
  90% in 2.3413 secs
  95% in 2.5196 secs
  99% in 2.8654 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0002 secs, 0.2278 secs, 3.4239 secs
  DNS-lookup:	0.0001 secs, 0.0000 secs, 0.0014 secs
  req write:	0.0002 secs, 0.0000 secs, 0.0548 secs
  resp wait:	0.2412 secs, 0.0658 secs, 1.0151 secs
  resp read:	1.4234 secs, 0.1619 secs, 2.7917 secs

Status code distribution:
  [200]	1000 responses

After:

$ hey -H 'X-Api-Key: odt_***' -n 1000 http://localhost:8080/api/v1/vulnerability/source/GITHUB/vuln/GHSA-288c-cq4h-88gq

Summary:
  Total:	1.0845 secs
  Slowest:	0.2268 secs
  Fastest:	0.0061 secs
  Average:	0.0498 secs
  Requests/sec:	922.0578


Response time histogram:
  0.006 [1]	|
  0.028 [245]	|■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.050 [350]	|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.072 [227]	|■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.094 [102]	|■■■■■■■■■■■■
  0.116 [38]	|■■■■
  0.139 [17]	|■■
  0.161 [12]	|■
  0.183 [3]	|
  0.205 [4]	|
  0.227 [1]	|


Latency distribution:
  10% in 0.0172 secs
  25% in 0.0285 secs
  50% in 0.0437 secs
  75% in 0.0656 secs
  90% in 0.0860 secs
  95% in 0.1083 secs
  99% in 0.1535 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0002 secs, 0.0061 secs, 0.2268 secs
  DNS-lookup:	0.0001 secs, 0.0000 secs, 0.0016 secs
  req write:	0.0000 secs, 0.0000 secs, 0.0014 secs
  resp wait:	0.0492 secs, 0.0055 secs, 0.2267 secs
  resp read:	0.0003 secs, 0.0001 secs, 0.0039 secs

Status code distribution:
  [200]	1000 responses

Copy link
Collaborator

@sahibamittal sahibamittal left a comment

Choose a reason for hiding this comment

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

lgtm 👍🏼

@sahibamittal sahibamittal merged commit 55fd8df into main Sep 30, 2024
9 checks passed
@sahibamittal sahibamittal deleted the issue-1539 branch September 30, 2024 10:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
defect Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/api/v1/vulnerability/source/{source}/vuln/{vuln} returns all vulnerable components
2 participants