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

Design repository library #1136

Closed
lukpueh opened this issue Sep 10, 2020 · 12 comments · Fixed by #2193
Closed

Design repository library #1136

lukpueh opened this issue Sep 10, 2020 · 12 comments · Fixed by #2193
Assignees
Labels
backlog Issues to address with priority for current development goals discussion Discussions related to the design, implementation and operation of the project repository Related to the repository implementation
Milestone

Comments

@lukpueh
Copy link
Member

lukpueh commented Sep 10, 2020

[Update 2/14/22]

  • ADR 10 shows the updated direction of this issue including further reading (design document, prototype implementation)
  • Comments in thread here below point to survey documents for existing repository tooling, based on which ADR 10 was developed

[Original issue description]

Identify what functionality from existing repository_tool/repository_lib/roledb/keydb modules should exist in a TUF repository library on top of a metadata model as sketched in #1112.

Start with API functionality.

Coordinate with #1134.

@lukpueh lukpueh added this to the Repository Library Refactor milestone Sep 10, 2020
@joshuagl joshuagl added the repository Related to the repository implementation label Sep 10, 2020
@lukpueh lukpueh added the discussion Discussions related to the design, implementation and operation of the project label Sep 10, 2020
@joshuagl
Copy link
Member

I think a good place to start with this would be looking at what scaffolding Warehouse ends up building on top of the metadata API.

pypi/warehouse#7488
pypi/warehouse#8955

@joshuagl
Copy link
Member

joshuagl commented Apr 6, 2021

See also a WIP addition to the specification describes the repository workflow for adding/updating targets which this library should implement: theupdateframework/specification#153

@joshuagl
Copy link
Member

See also a WIP addition to the specification describes the repository workflow for adding/updating targets which this library should implement: theupdateframework/specification#153

This has landed and can be referenced here https://theupdateframework.github.io/specification/latest/#adding-updating-targets

@sechkova sechkova added the backlog Issues to address with priority for current development goals label Oct 27, 2021
@jku
Copy link
Member

jku commented Oct 28, 2021

Linking to #1459 (comment). If this issue is top-down design that one is definitely bottom-up: I'm creating initial repositories in a few places and the code always looks quite ugly but the last comment maybe has a decent idea that would work without lots of new API.

@lukpueh
Copy link
Member Author

lukpueh commented Oct 28, 2021

Adding the list of surveys of existing TUF repository implementations here so that we can close #1612...

@lukpueh
Copy link
Member Author

lukpueh commented Nov 15, 2021

Adding more relevant documents ...

Next steps:

  • Revise open questions and generalize problems
  • Revise strawman design for suitability to answer these questions
  • Revise strawman design / prototype implementation for remaining open questions
  • Write design document

lukpueh added a commit to lukpueh/tuf that referenced this issue Dec 21, 2021
Remove `bump_version()` method, which is just an alias for "+= 1"
on the version attribute. For a slim low-level API it seems okay to
just directly access/modify the attribute.

The extra level of abstraction of "bumping a version" is more
appropriate for a repository library (see theupdateframework#1136).

This patch also removes a related unit test and updates another one
to directly do `(...).version +=`.

Signed-off-by: Lukas Puehringer <[email protected]>
lukpueh added a commit to lukpueh/tuf that referenced this issue Jan 11, 2022
Remove `bump_version()` method, which is just an alias for "+= 1"
on the version attribute. For a slim low-level API it seems okay to
just directly access/modify the attribute.

The extra level of abstraction of "bumping a version" is more
appropriate for a repository library (see theupdateframework#1136).

This patch also removes a related unit test and updates another one
to directly do `(...).version +=`.

Signed-off-by: Lukas Puehringer <[email protected]>
@lukpueh
Copy link
Member Author

lukpueh commented Feb 14, 2022

Next steps:

  • Revise open questions and generalize problems
  • Revise strawman design for suitability to answer these questions
  • Revise strawman design / prototype implementation for remaining open questions
  • Write design document

See updated issue description above for latest results...

@lukpueh
Copy link
Member Author

lukpueh commented Mar 17, 2022

Feature request:
Convenience interface that takes a path to local target file(s) and constructs targets metadata, computing length and hashes from the local file and normalizing the path to match the TARGETPATH specification (see #1019 and #1018 for details and challenges)

@prateek041
Copy link

I would like to work on this issue, where should I start ?

@lukpueh
Copy link
Member Author

lukpueh commented Apr 19, 2022

I would like to work on this issue, where should I start ?

Reading the resources referenced above in the issue description and brainstorming designs seems like the way to start.

But as @jku has mentioned on slack, this is likely a long term issue that is going to require experimentation and quite a bit of team work to solve.

@joshuagl
Copy link
Member

Another implementation we could look to for inspiration is Rugged, which implements repository and a key manager classes on top of the low-level metadata API.

A key manager/keyring feels like a useful helper to provide.

@jku
Copy link
Member

jku commented Nov 24, 2022

I've decided to just do a PR of this:

  • a tiny repository abstraction
  • example implementation of that abstraction (a in-memory ephemeral repository a bit like the one in tests)
  • demo repository application using that in-memory implementation that simulates a live repository by generating changes every few seconds

I have that 90% ready, will push the PR this week. Future steps would include:

  • example developer tool (built using the same building blocks as the repository) that is able to sign changes and submit them to the demo repository application. I have a rough idea, should not be too much work

I have no assumptions that the API would be final in this PR: as minimal as it is, new use cases seem to always bring new complications... So I suggest we

  • try to merge something soon
  • keep the repository abstraction as unstable API for now
  • build more implementations to gather data (potential ones at least RSTUF, repository-editor-for-tuf, repository-playground)
  • improve as new ideas come up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issues to address with priority for current development goals discussion Discussions related to the design, implementation and operation of the project repository Related to the repository implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants