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

repo: Fix tuf-on-ci-status when artifacts are added to delegates #94

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

jku
Copy link
Member

@jku jku commented Oct 5, 2023

Fixes #93.

It seems this was never tested:

  • the artifact path partition was just broken
  • subdirectories were not handled properly

I don't have test yet: I think I'll file a new issue for that. I've tested this manually by running "tuf-on-ci-status --no-push" in the branch of this signing event jku/tuf-demo#68: result looks good to me

The signing tool should work just fine as it does not really look at the artifacts itself (arguably it maybe should but currently it does not)

CC @rdimitrov

It seems this was never tested:
* the artifact path partition was just broken
* subdirectories were not handled properly
@jku jku force-pushed the fix-artifacts-in-delegations branch from d1b23f3 to 36c4165 Compare October 5, 2023 08:50
Also fix copy-pasted comments in signer_add_delegation()
@jku
Copy link
Member Author

jku commented Oct 5, 2023

I added a test. It's as bad as the e2e tests all are* but it does work as regression test for this issue.

*) as an example: the tuf-on-ci-status message is not checked, only the exit value. So we don't really know if it is giving good advice or not, the only thing we know is that it is asking for more signatures at right times

@@ -357,6 +355,27 @@ signer_modify_targets()
git push --quiet origin $EVENT
}

signer_add_delegated_target()
Copy link
Member Author

Choose a reason for hiding this comment

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

The test file really should get a file wide rename where "target" is changed to "artifact" where applicable: current state is confusing. But I didn't want to rename just the new methods and kept them in line with existing methods

@kommendorkapten
Copy link
Member

Just so I understand the scope, this only affects delegated targets in a directory inside targets/?

@jku
Copy link
Member Author

jku commented Oct 6, 2023

Just so I understand the scope, this only affects delegated targets in a directory inside targets/?

Correct:

  • this is used in tuf-on-ci-status only for two purposes:
    • decide which roles metadata should be updated (update hashes to match the artifacts in targets/ )
    • decide which roles to list on the status message
  • tuf-on-ci-status collects a list of roles that have changed in this signing event by looking at three things
    • roles whose metadata has changed
    • roles that have artifact changes in targets/ directory <-- this is what's broken for delegated roles
    • roles that have open invites

(It's possible that we should be building this list of changed roles by comparing the artifacts in targets/ to the metadata, but that currently only happens later when tuf-on-ci-status prints the change details. This was just the first implementation that I thought of)

Copy link
Member

@kommendorkapten kommendorkapten left a comment

Choose a reason for hiding this comment

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

Great, just wanted to make sure I understood the PR.

@jku jku merged commit 8a7d6d2 into theupdateframework:main Oct 6, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with artifact modification
2 participants