-
-
Notifications
You must be signed in to change notification settings - Fork 35
Issue 2049 : Improve component search performance with JDBI #1867
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
Open
sahibamittal
wants to merge
22
commits into
main
Choose a base branch
from
issue-2049-improve-component-search-performance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d302664
WIP Add JDBI method for component search
sahibamittal 7c2af99
Add dependency metrics to components API
sahibamittal 4462d12
Add safe column checks and update OpenAPI keys
sahibamittal ebb0f55
Add tests for component identity endpoint
sahibamittal 237fa56
Return project object in component responses
sahibamittal 512f7cd
Update ComponentsResourceTest.java
sahibamittal be35f8b
Add listComponents endpoint and schema updates
sahibamittal ea6ef71
Merge branch 'main' into issue-2049-improve-component-search-performance
sahibamittal 892234b
Update ComponentsResourceTest.java
sahibamittal 5e09d4f
Add 400 response and test for invalid CPE
sahibamittal 7471c9f
Add project direct_dependencies in components API
sahibamittal 6debb6e
Include total counts in component pagination
sahibamittal 6bfda9c
Separate project-specific components response schema
sahibamittal 766238a
Add component search by hash
sahibamittal 7489c27
Add sorting support to components listing
sahibamittal 4d08596
Add component sorting test and setup fixes
sahibamittal dd2f31f
Add hash_type filter and enum-based sorting
sahibamittal 647532a
Merge branch 'main' into issue-2049-improve-component-search-performance
sahibamittal 5d5a56a
Update ComponentDao.java
sahibamittal 4103326
Update ComponentDao.java
sahibamittal 2d5c9d9
Update tests for LAST_RISKSCORE
sahibamittal 4305f10
Use HashType enum and centralize sort mapping
sahibamittal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
api/src/main/openapi/components/schemas/component-project.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # This file is part of Dependency-Track. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| type: object | ||
| properties: | ||
| name: | ||
| type: string | ||
| maxLength: 255 | ||
| version: | ||
| type: string | ||
| maxLength: 255 | ||
| uuid: | ||
| type: string | ||
| format: uuid |
96 changes: 96 additions & 0 deletions
96
api/src/main/openapi/components/schemas/dependency-metrics.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # This file is part of Dependency-Track. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| type: object | ||
| properties: | ||
| critical: | ||
| type: integer | ||
| format: int32 | ||
| high: | ||
| type: integer | ||
| format: int32 | ||
| medium: | ||
| type: integer | ||
| format: int32 | ||
| low: | ||
| type: integer | ||
| format: int32 | ||
| unassigned: | ||
| type: integer | ||
| format: int32 | ||
| vulnerabilities: | ||
| type: integer | ||
| format: int32 | ||
| suppressed: | ||
| type: integer | ||
| format: int32 | ||
| inherited_risk_score: | ||
| type: number | ||
| format: double | ||
| findings_total: | ||
| type: integer | ||
| format: int32 | ||
| findings_audited: | ||
| type: integer | ||
| format: int32 | ||
| findings_unaudited: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_fail: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_warn: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_info: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_total: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_audited: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_unaudited: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_security_total: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_security_audited: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_security_unaudited: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_license_total: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_license_audited: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_license_unaudited: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_operational_total: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_operational_audited: | ||
| type: integer | ||
| format: int32 | ||
| policy_violations_operational_unaudited: | ||
| type: integer | ||
| format: int32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
api/src/main/openapi/components/schemas/list-project-components-response-item.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # This file is part of Dependency-Track. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| type: object | ||
| properties: | ||
| name: | ||
| type: string | ||
| maxLength: 255 | ||
| version: | ||
| type: string | ||
| maxLength: 255 | ||
| group: | ||
| type: string | ||
| maxLength: 255 | ||
| classifier: | ||
| type: string | ||
| maxLength: 255 | ||
| hashes: | ||
| $ref: "./hashes.yaml" | ||
| cpe: | ||
| type: string | ||
| maxLength: 255 | ||
| purl: | ||
| type: string | ||
| maxLength: 1024 | ||
| swid_tag_id: | ||
| type: string | ||
| maxLength: 255 | ||
| internal: | ||
| type: boolean | ||
| copyright: | ||
| type: string | ||
| maxLength: 255 | ||
| license: | ||
| type: string | ||
| maxLength: 255 | ||
| license_expression: | ||
| type: string | ||
| maxLength: 255 | ||
| license_url: | ||
| type: string | ||
| maxLength: 255 | ||
| resolved_license: | ||
| $ref: "./license.yaml" | ||
| occurrence_count: | ||
| type: integer | ||
| format: int64 | ||
| minimum: 0 | ||
| last_inherited_risk_score: | ||
| type: number | ||
| format: double | ||
| uuid: | ||
| type: string | ||
| format: uuid |
26 changes: 26 additions & 0 deletions
26
api/src/main/openapi/components/schemas/list-project-components-response.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # This file is part of Dependency-Track. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| type: object | ||
| allOf: | ||
| - $ref: "./paginated-response.yaml" | ||
| properties: | ||
| items: | ||
| type: array | ||
| items: | ||
| $ref: "./list-project-components-response-item.yaml" | ||
| required: | ||
| - items |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.