fix(version): point update check at fork, ship --check in releases (FJ-14) #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/update-check-target-fork-fj-14"
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?
Summary
Repoints
fj version --checkat this fork's Forgejo instance and ships the feature in the published binaries. Resolves FJ-14.Two problems fixed:
crates/fj/src/version.rshardcodedhttps://codeberg.org/and queriedrepo_get_latest_release("forgejo-contrib", "forgejo-cli"), i.e. upstream on Codeberg, so a fork user was told about versions unrelated to the binary they run.--checkis gated behind the non-defaultupdate-checkcargo feature, which no release build enabled, so the published Linux/Windows binaries did not contain the flag at all.Changes
crates/fj/src/version.rs: introduce a singleUPDATE_CHECK_BASE_URLconst (https://dev.a8n.run/) replacing the inline Codeberg literal, and queryrepo_get_latest_release("pandoras-box", "forgejo-cli"). Version comparison, the behind/current/ahead branches, and allmsg-version-update_check-*Fluent strings are unchanged. The fork's releasehtml_urlalready points atdev.a8n.run, so the "behind" message links to the correct fork release page with no string edits.oci-build/Dockerfileandoci-build/Dockerfile.windows: add--features update-checkto the real-sourcecargo build --release --lockedso both published binaries expose--check. The dummy-source dependency-prime builds are left untouched (they compile no fj source).Note on the workflow YAMLs
The acceptance criteria list
.forgejo/workflows/build-binary.ymlandbuild-binary-windows.ymlamong the files to build with--features update-check. Those workflows contain nocargo buildof their own; they invokedocker buildx buildagainst the two Dockerfiles. Enabling the feature at the Dockerfile layer is therefore what makes the flag ship in the workflow-produced binaries, so no edit to the YAMLs is required. They were left unchanged.Verification
cargo build --release --locked --features update-checkfrom the workspace root compiles clean;cargo fmt --all --checkandcargo clippy --features update-check --all-targets -- -D warningspass.fj version --helplists--check(no clap "unexpected argument");fj version --checknow hitsdev.a8n.run/pandoras-box/forgejo-cli./api/v1/repos/pandoras-box/forgejo-cli/releases/latestreturns 404, releases list is empty), so the check currently surfaces a 404. That is expected environment state - releases are cut bycreate-release.yml, which has not run for this fork yet - and the version-comparison code path is unchanged from upstream, only the host/repo coordinates moved. Once the first fork release exists, the behind/up-to-date branches resolve normally.#FJ-14