vmware-archive / repository-editor-for-tuf

Command line tool for editing and maintaining a TUF repository
Apache License 2.0
5 stars 3 forks source link

Re-design target addition #39

Closed jku closed 2 years ago

jku commented 2 years ago

Fixes #32


Adding a target only modifies a single metadata so making it a "edit" sub command made sense... However, often user does not know which metadata should be modified: this is especially the case with succinct delegations.

Make add-target a top level action instead of a edit subaction:

This means add-target is now a simple repository wide command which seems quite logical: user does not need to know the details, they just want to add a target file to the repository.

There is a edit()-refactor here that makes the edit-contextmanager handle AbortEdit silently: the users of edit() can raise AbortEdit to signal they want to exit the contextmanager without saving the edited metadata. This is a bit undiscoverable and not immediately obvious but works quite nicely in both snapshot and add-target in my opinion.

jku commented 2 years ago

Closing this and opening a new one from fork (I can't modify this branch anymore since my permissions in this repo were downsized)