fix(version): point update check at fork, ship --check in releases (FJ-14) #12

Merged
David merged 2 commits from chore/update-check-target-fork-fj-14 into main 2026-05-25 16:39:06 +02:00
Owner

Summary

Repoints fj version --check at this fork's Forgejo instance and ships the feature in the published binaries. Resolves FJ-14.

Two problems fixed:

  1. Wrong target. crates/fj/src/version.rs hardcoded https://codeberg.org/ and queried repo_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.
  2. Shipped in zero binaries. --check is gated behind the non-default update-check cargo 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 single UPDATE_CHECK_BASE_URL const (https://dev.a8n.run/) replacing the inline Codeberg literal, and query repo_get_latest_release("pandoras-box", "forgejo-cli"). Version comparison, the behind/current/ahead branches, and all msg-version-update_check-* Fluent strings are unchanged. The fork's release html_url already points at dev.a8n.run, so the "behind" message links to the correct fork release page with no string edits.
  • oci-build/Dockerfile and oci-build/Dockerfile.windows: add --features update-check to the real-source cargo build --release --locked so 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.yml and build-binary-windows.yml among the files to build with --features update-check. Those workflows contain no cargo build of their own; they invoke docker buildx build against 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-check from the workspace root compiles clean; cargo fmt --all --check and cargo clippy --features update-check --all-targets -- -D warnings pass.
  • fj version --help lists --check (no clap "unexpected argument"); fj version --check now hits dev.a8n.run/pandoras-box/forgejo-cli.
  • The live "behind" / "Up to date!" message path could not be exercised end-to-end yet: the fork has no published release (/api/v1/repos/pandoras-box/forgejo-cli/releases/latest returns 404, releases list is empty), so the check currently surfaces a 404. That is expected environment state - releases are cut by create-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

## Summary Repoints `fj version --check` at this fork's Forgejo instance and ships the feature in the published binaries. Resolves FJ-14. Two problems fixed: 1. **Wrong target.** `crates/fj/src/version.rs` hardcoded `https://codeberg.org/` and queried `repo_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. 2. **Shipped in zero binaries.** `--check` is gated behind the non-default `update-check` cargo 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 single `UPDATE_CHECK_BASE_URL` const (`https://dev.a8n.run/`) replacing the inline Codeberg literal, and query `repo_get_latest_release("pandoras-box", "forgejo-cli")`. Version comparison, the behind/current/ahead branches, and all `msg-version-update_check-*` Fluent strings are unchanged. The fork's release `html_url` already points at `dev.a8n.run`, so the "behind" message links to the correct fork release page with no string edits. - `oci-build/Dockerfile` and `oci-build/Dockerfile.windows`: add `--features update-check` to the real-source `cargo build --release --locked` so 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.yml` and `build-binary-windows.yml` among the files to build with `--features update-check`. Those workflows contain no `cargo build` of their own; they invoke `docker buildx build` against 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-check` from the workspace root compiles clean; `cargo fmt --all --check` and `cargo clippy --features update-check --all-targets -- -D warnings` pass. - `fj version --help` lists `--check` (no clap "unexpected argument"); `fj version --check` now hits `dev.a8n.run/pandoras-box/forgejo-cli`. - The live "behind" / "Up to date!" message path could not be exercised end-to-end yet: the fork has no published release (`/api/v1/repos/pandoras-box/forgejo-cli/releases/latest` returns 404, releases list is empty), so the check currently surfaces a 404. That is expected environment state - releases are cut by `create-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
fix(version): point update check at fork, ship --check in releases (FJ-14)
Some checks failed
Check / fmt + clippy + build + tests (pull_request) Has been cancelled
0d0e057db0
The only update mechanism, `fj version --check`, queried upstream Codeberg (`forgejo-contrib/forgejo-cli`) and was gated behind the non-default `update-check` cargo feature that no release build enabled. So the check reported upstream versions unrelated to the running binary, and the `--check` flag shipped in zero published binaries.

Repoint the check at this fork's Forgejo instance: introduce a single `UPDATE_CHECK_BASE_URL` const (`https://dev.a8n.run/`) replacing the inline Codeberg literal, and query `repo_get_latest_release("pandoras-box", "forgejo-cli")`. The fork's create-release.yml cuts a Forgejo release per tag with the same version string the Generic Packages upload uses, so the existing releases-based code path stays valid with only the coordinates changed. The version comparison, behind/current/ahead branches, and `msg-version-update_check-*` Fluent strings are unchanged; the fork's release `html_url` already points at dev.a8n.run.

Ship the feature: add `--features update-check` to the real-source `cargo build --release --locked` in oci-build/Dockerfile and oci-build/Dockerfile.windows, so both published binaries expose the `--check` flag. The dummy-source dependency-prime builds are left untouched (they compile no fj source). The build-binary*.yml workflows invoke `docker buildx build` against these Dockerfiles and contain no cargo build of their own, so enabling the feature at the Dockerfile layer is what makes the flag ship in the workflow-produced binaries.

#FJ-14

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merge branch 'main' into chore/update-check-target-fork-fj-14
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + build + tests (pull_request) Successful in 37s
652b990dce
David merged commit 8a762b4037 into main 2026-05-25 16:39:06 +02:00
David deleted branch chore/update-check-target-fork-fj-14 2026-05-25 16:39:06 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/forgejo-cli!12
No description provided.