Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/forge-client
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-15 23:22:48 +01:00
..
src forge-client: take the token as a string, drop TokenSource and StaticToken 2026-11-15 23:22:48 +01:00
Cargo.toml swarm-controller, swarm-ci-metrics: build forge clients through forge-client 2026-11-15 23:02:55 +01:00
README.md forge-client: take the token as a string, drop TokenSource and StaticToken 2026-11-15 23:22:48 +01:00

forge-client

The one place hyperhive builds a Forgejo client and reads a Forgejo notification. hive-forge (the blocking CLI), hive-forge-notify (the async poller), swarm-controller and swarm-ci-metrics share it, so a Forgejo schema change that forgejo-api does not yet model is fixed here once.

When to use it

  • Building a forgejo_api client from a base URL and a token string: async_client, and with the sync feature sync_client.
  • Building the raw reqwest client for Forgejo's web-router-only routes (the sync feature): raw_blocking_client.
  • Deciding how long a forge call may take: TimeoutPolicy. A caller names its policy (TimeoutPolicy::CLI, or its own value) and reads its bounds from it.
  • Parsing a notification thread from the forge: NotificationThread. Every field is optional and lenient, so an unknown or reshaped field cannot fail the page the way forgejo_api::structs::NotificationThread does.

Not here

Anything that decides what a notification means (delivery, read-state, filtering): that stays in hive-forge-notify and hive-forge.

A token that changes (the controller re-reads it from the secret store after a 401) is the caller's to track: it calls async_client again with the new value.