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

Artifacts metadata #1291

Open
6 of 7 tasks
olenagerasimova opened this issue May 15, 2023 · 5 comments
Open
6 of 7 tasks

Artifacts metadata #1291

olenagerasimova opened this issue May 15, 2023 · 5 comments
Labels
enhancement New feature or request stale

Comments

@olenagerasimova
Copy link
Member

olenagerasimova commented May 15, 2023

  • Let's implement some mechanism to store artifacts metadata, like:

  • repository name

  • artifact name (unique)

  • artifact version

  • created date

  • size (size of the package itself, external metadata/checksums files not included)

  • username of the user who uploaded the artifact

Questions:

  • what will happen with the record if the artifact was removed?
  • what will happen if the artifact was updated/replaced?
  • what db we will use and will the table be somehow partitioned?

What to implement:

  • interfaces/classes to write the info listed above into db
  • pass authorized username into header to origin slice in AuthzSlice: now adapters are not aware of the user, who is uploading the artifact
  • call this new mechanism which adds records into db inside each adapter

Steps:

@olenagerasimova olenagerasimova added the enhancement New feature or request label May 15, 2023
@olenagerasimova
Copy link
Member Author

@dgarus please, take a look and let's discuss my questions

@dgarus
Copy link
Contributor

dgarus commented May 17, 2023

@olenagerasimova @ChGen

what will happen with the record if the artifact was removed?

I think we have to remove the referred record.

what will happen if the artifact was updated/replaced?

Update the according record.

what db we will use and will the table be somehow partitioned?

Suggest SqlLight.
I think we could do optimizations when it will be needed.
In any way, this is artipie's internals, and we can change it at any time.

@ChGen
Copy link
Collaborator

ChGen commented May 17, 2023

Agree, we should provide some interface to the adapters, so Artipie would be able to add/update/remove records from the index database to keep it relevant.
I think SQLight would be enough for starters. As I remember, it could be slow if insert operations are done in straightforward way (without transaction & etc.), so it could be easily fixed.

@olenagerasimova
Copy link
Member Author

@dgarus @ChGen
do I understand correctly, that we do not wait for this insert into db operation to complete before returning response in slice? If repository update operation is successful, but insert into db failed, we reply OK and simply log the error about the db insert failure?

@github-actions
Copy link

Issue is stale, CC: @artipie/maintainers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants