Add digests flag to plugin search, which displays SHA values for all os/arch per binary - #6016
Add digests flag to plugin search, which displays SHA values for all os/arch per binary#6016datosh wants to merge 3 commits into
Conversation
…os/arch per binary Signed-off-by: Fabian Kammel <fabian.kammel@control-plane.io>
|
Thanks very much for this PR @datosh! codex/gpt-5.5 xhigh found a couple of nits:
|
Signed-off-by: Fabian Kammel <fabian.kammel@control-plane.io>
Signed-off-by: Fabian Kammel <fabian.kammel@control-plane.io>
|
Thanks for the feedback @matheuscscp
Good catch! I have added code to record the errors and print them as warnings. Let me know if you agree with that approach! |
|
Thanks @datosh! One last nit: what happens if all digest lookups fail? Wondering if the command output will make sense in that case 🤔 |
Since we have the The exit code is Do you agree with the other "implementation decisions" I laid out in the PR description? |
|
@datosh Yep, they make sense! About the failure for all digests, looks like we enter
Which is a bit confusing, since there are plugins but we actually failed fetching digests for all of them... |
matheuscscp
left a comment
There was a problem hiding this comment.
LGTM! 🚀
We can merge this either way, the comment above is quite a corner case 👍
Changes
--digestsflag toflux plugin search[@version]field toflux plugin search [query]Implementation Decisions
I would like to call out these decisions and invite feedback on the direction here!
Changed Columns
flux plugin searchuses the columns NAME, DESCRIPTION, and INSTALLED. To pin by hash, we need at least two (additional) pieces of information: OS/ARCH and DIGEST.Using all 5 columns would produce a very noisy console output. Instead, I opted to display only the "pinning relevant" columns when that code path is executed: NAME, VERSION, OS/ARCH, DIGEST.
Implied --digests
flux plugin search operatoruses the standard output format.flux plugin search operator --digestsuses the "pinning relevant" output format.flux plugin search name@1.2.3implies--digestsand therefore presents the "pinning relevant" information, since the user wants more information about a specific version.Are we okay with this, or should we require the explicit use of --digests?
Potentially Large Output
For each new plugin added to the catalogue,
flux plugin search --digestswill produce 6 rows of output, more if we decide to support more architectures or operating systems.I think this is fine, since
--digestshas to be set explicitly, and filtering down using the plugin name is possible.Sequential Fetching
To display the SHA values, the manifest for each plugin has to be fetched. To keep the implementation simple, I opted for a simple loop instead of parallel fetching.
I think this is reasonable right now, but it might be slow if the number of plugins grows substantially.
fixes #6008