fj release download/upload/view lack scripting affordances (--pattern, --clobber, implicit latest) #122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observation
fj releasecovers the release lifecycle but its asset and lookup verbs lack the affordances that make releases scriptable: download has no glob/--clobber, upload has no--clobber, and nothing resolves "the latest release" without a literal tag.Reproduced:
Three concrete gaps, all visible in
src/cli/release.rs:Download is exact-match only, no glob.
DownloadArgs(src/cli/release.rs:139-151) has-n/--name, and the handler filters with&a.name != filter(src/cli/release.rs:395-399), a string equality.gh release downloadtakes--pattern '*.tar.gz'. To grab "all the linux assets" fromfjyou must download everything or loop one exact name at a time.No
--clobberon download or upload; re-running is unsafe/ambiguous. Download unconditionallystd::fs::writes over whatever is at the destination (src/cli/release.rs:410), so there is no "skip if present" and no explicit "overwrite" gate. Upload (upload_one,src/cli/release.rs:365-385) just POSTs the asset; uploading a name that already exists on the release has no clobber path, so a re-run of a publish script (e.g. after a partial failure) either errors or duplicates the asset name.gh release upload --clobberexists precisely to make republish idempotent."Latest" is not addressable. Both
view(ViewArgs,src/cli/release.rs:55-67) anddownload(src/cli/release.rs:139) require a positional<TAG>and callget_by_tag(src/cli/release.rs:226,:390).gh release view/gh release downloadwith no tag operate on the latest release. A CI step that wants "download the assets from the most recent release" must firstfj release list --json | jq -r '.[0].tag_name'and thread that back in.Why it matters
These verbs are the install/publish surface, the part of
fjthat lands inside CI and bootstrap scripts:fj release download --pattern 'fj-*-linux-x86_64.tar.gz'from the latest release. Today it cannot express either half: no pattern, and no implicit latest.--clobber, a retried job fights the assets the previous attempt already uploaded.fj releasealready gets the hard parts right (draft/prerelease,--asseton create, path-traversal-safe asset names viasafe_asset_dest). The missing pieces are small, well-scoped flags that turn a manual tool into a scriptable one.Possible directions (sketches)
--pattern <glob>tofj release download(repeatable, OR-combined), matched againsta.namewith a glob crate, alongside the existing exact-n/--name. Mirrorgh release download --pattern.--clobbertodownload(overwrite existing files; without it, skip-with-note instead of silently overwriting) and toupload(delete-then-reupload, or PATCH, an existing same-named asset). Makes both re-runnable.<TAG>optional onviewanddownload: when omitted, resolve the latest published release (api::release::list(..., 1)first item, skipping drafts/prereleases unless asked). Optionally a--latestflag for explicitness.fj release listcould also grow--exclude-drafts/--exclude-pre-releasesto matchghand to make "latest stable" trivially selectable.Converted to backlog item rasterstate/fj#133 (p3, size M).