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

Add target with delegation #45

Closed jku closed 1 year ago

jku commented 1 year 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.

vmwclabot commented 1 year ago

@jku, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

jku commented 1 year ago

The obvious review comment here is that add-target and remove-target now look different... I have a commit for the latter as well, but would rather put that in another PR (it's not completely trivial as it makes sense to add a delegation search there as well).

joshuagl commented 1 year ago

@MVrachev care to take a look at this one?

MVrachev commented 1 year ago

Yes, I will. I will try to find time these days.

vmwclabot commented 1 year ago

@jku, VMware has approved your signed contributor license agreement.