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

feat: use database to store and retrieve found repos #263

Open
wants to merge 5 commits into
base: staging
Choose a base branch
from

Conversation

benmss
Copy link
Member

@benmss benmss commented May 30, 2023

This adds the third part of the repo finding extension. Making remote calls to retrieve POMs is a costly operation that should be avoided when possible. By adding found repositories to the Macaron database, it can first be polled before any remote calls are needed.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 30, 2023
if db_man and defaults.getboolean("repofinder.java", "use_database"):
# Perform database lookup
query = sqlalchemy.text(
"SELECT remote_path FROM _repository WHERE namespace = :group and name = :artifact"
Copy link
Member

Choose a reason for hiding this comment

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

Instead of raw queries, we should use SQLAlchemy's ORM queries, which performs proper validation.

Signed-off-by: Ben Selwyn-Smith <[email protected]>
@behnazh-w
Copy link
Member

We've decided to review this PR once the new data model PR is merged.

@behnazh-w behnazh-w added the repository_finder The issues related to the repository finder label Jul 5, 2023
@benmss benmss linked an issue Aug 23, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement. repository_finder The issues related to the repository finder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add caching of discovered repositories
2 participants