Skip to content

Pull config via @ConfigProperty in mirror-service #1236

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

Merged
merged 3 commits into from
May 28, 2024

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Apr 25, 2024

Description

Note

This PR is based on #1223. Please review that first, I'll update this PR once it is merged. Should drastically reduce the change size. :)

Replaces properties pulled from application.properties / environment variables to configure datasources in mirror-service, with properties from the CONFIGPROPERTY database table. This is achieved via the quarkus-config-dependencytrack extension introduced in #1223.

Addressed Issue

Relates to #929

Additional Details

  • mirror-service now requires a database connection
  • mirror-service now requires access to the secret key, in order to decrypt API secrets
  • Config properties are not cached, due to the low frequency at which they'll be queried

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 enhancement New feature or request domain/vuln-mirroring labels Apr 25, 2024
@nscuro nscuro changed the title Use config extension mirrorsvc Pull config via @ConfigProperty in mirror-service Apr 25, 2024
@nscuro nscuro changed the title Pull config via @ConfigProperty in mirror-service Pull config via @ConfigProperty in mirror-service Apr 25, 2024
@nscuro nscuro force-pushed the use-config-extension-mirrorsvc branch 5 times, most recently from 24aac5f to 2071526 Compare April 30, 2024 10:34
@nscuro nscuro force-pushed the use-config-extension-mirrorsvc branch 7 times, most recently from 23409aa to e6859ac Compare May 27, 2024 11:33
@nscuro nscuro added this to the 0.5.0 milestone May 27, 2024
@nscuro nscuro marked this pull request as ready for review May 27, 2024 11:38
nscuro added 2 commits May 28, 2024 14:20
Also removes manual retry logic, as the `open-vulnerability-clients` library has added its own retry since we originally adopted it.

Further removed the `num-threads` configuration option for the NVD datasource. Downloading of the data has never been a bottleneck, it's always the processing of already downloaded data that's the most time-consuming.

Signed-off-by: nscuro <[email protected]>
Even though the container will do effectively nothing, this at least verifies it's starting as intended.

Signed-off-by: nscuro <[email protected]>
@nscuro nscuro force-pushed the use-config-extension-mirrorsvc branch from 4f73631 to 197a966 Compare May 28, 2024 12:20
@DependencyTrack DependencyTrack deleted a comment from sonarqubecloud bot May 28, 2024
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+2.64% (target: -1.00%) (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6aff045) 172 140 81.40%
Head commit (711bfb2) 6715 (+6543) 5643 (+5503) 84.04% (+2.64%)

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 (#1236) 0 0 ∅ (not applicable)

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 will stop sending the deprecated coverage status from June 5th, 2024. Learn more

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 fdfc7db into main May 28, 2024
12 checks passed
@sahibamittal sahibamittal deleted the use-config-extension-mirrorsvc branch May 28, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants