Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/swarm-ci-metrics/Cargo.toml
maia e88de09d72 swarm-ci-metrics: move the settings and pass logic out of main and test it
main read the environment inline and held the per-repo pass, the
certificate gauges and the verdict, so none of it could run in a test.
Each is now a function with its inputs as arguments:

- Env::read takes a lookup closure in place of std::env (same read
  order), var names a missing setting by its full variable.
- finish, skip_counts, wanted_repo, walk_done, trimmed and cert_gauges
  hold the branches that were inline.
- A pass talks to the forge, the identity provider and the collector
  through a Remote trait. Live is the daemon's HTTP implementation, and
  the tests' stand-in answers from memory, so no test opens a socket.
- post_request builds the collector request and refused the refusal
  text, so both are tested without a connection.

x509-cert becomes a dev-dependency (the workspace already pins it) for
the test certificate. Behaviour is the same.

Refs #6811
2026-11-23 22:36:45 +01:00

39 lines
1.1 KiB
TOML

[package]
name = "swarm-ci-metrics"
version.workspace = true
edition.workspace = true
[[bin]]
name = "swarm-ci-metrics"
path = "src/main.rs"
[dependencies]
anyhow.workspace = true
# Builds the forge client, from the `ci-metrics` account token.
forge-client.workspace = true
# The runs list and the repo search, as the `ci-metrics` account.
forgejo-api.workspace = true
hive-log.workspace = true
# The OTLP/HTTP push. Built by hand rather than through the OTel SDK, whose
# readers stamp every point with the export time, not the run's `stopped`.
reqwest.workspace = true
serde.workspace = true
serde_json.workspace = true
# The OIDC client-credentials mint.
swarm-queue-client.workspace = true
# The forge token and client secret paths, and the store login.
swarm-secret-client.workspace = true
# The run timestamps `forgejo-api` hands back.
time.workspace = true
tokio.workspace = true
tracing.workspace = true
url.workspace = true
[dev-dependencies]
# A scratch state directory for the cursor tests.
tempfile = "3"
# Builds the client certificate the cert-gauge tests read.
x509-cert.workspace = true
[lints]
workspace = true