fj/src
Stephen Way a6fbf45ba9
stability + optimization: SIGINT handling, wiremock integration tests, trim binary 30%
Stability:
* `cli::run` now races command futures against `tokio::signal::ctrl_c()`.
  On SIGINT the command future is dropped, which propagates to the
  PagerGuard's Drop and restores stdout cleanly.
* Removed the unsafe `std::env::set_var("FJ_NO_PAGER")` in dispatch.
  `--no-pager` is now threaded into `pager::maybe_start(force_disabled)`
  as a parameter, no process-wide side effect.
* Replaced the panicking `.expect("token contains invalid header chars")`
  in `auth_headers` with a typed error that names the host and tells the
  user how to recover.
* Added 9 wiremock-backed integration tests covering: auth header
  injection, retry-on-5xx for idempotent methods, no-retry for POST,
  401 mapping to friendly error, custom header pass-through, null-body
  list tolerance, `get_all` following Link rel=next, total_limit honored
  on early break, malformed token rejection.

Optimization:
* Dropped unused reqwest features (stream, brotli) and unused crates
  (indicatif, futures-util, is-terminal, textwrap, tempfile).
* `panic = "abort"` and `lto = "fat"` on the release profile.
* HTTP retry loop now builds the request once and uses
  `reqwest::Request::try_clone` per attempt instead of rebuilding the
  RequestBuilder (eliminates per-attempt HeaderMap + URL clones).
* Pulled debug-mode request logging behind a `#[cold]` helper so the
  hot path stays small.

Binary: 5.94 MB → 4.15 MB stripped (-30%).
Tests: 51 → 60 (9 new integration tests).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 12:46:19 -07:00
..
api chore: cargo fmt run 2026-05-13 08:44:13 -07:00
auth initial: fj, a CLI for Forgejo 2026-05-13 07:56:28 -07:00
cli stability + optimization: SIGINT handling, wiremock integration tests, trim binary 30% 2026-05-13 12:46:19 -07:00
client stability + optimization: SIGINT handling, wiremock integration tests, trim binary 30% 2026-05-13 12:46:19 -07:00
config expand: repo auto-detect, --web, editor, PR diff/checks/ready/review/status, repo lifecycle, api headers/paginate 2026-05-13 08:22:40 -07:00
git expand: repo auto-detect, --web, editor, PR diff/checks/ready/review/status, repo lifecycle, api headers/paginate 2026-05-13 08:22:40 -07:00
output stability + optimization: SIGINT handling, wiremock integration tests, trim binary 30% 2026-05-13 12:46:19 -07:00
main.rs expand: auth token/refresh/setup-git, protect, hook, --debug, man pages 2026-05-13 08:34:01 -07:00