feat(obs): migrate publishers, hooks, and gitlab forge to tracing#637
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #513 — the
println!/eprintln!→tracingmigration.The tracing foundation already exists (
src/logging.rs:init_logging+ theMessageOnlyhuman formatter, the--log-format {human,json}/--verboseflags, deps under the
clifeature). This migrates the first, smallest-blast-radiusmodules onto it so the pattern is established on real code:
src/publishers/mod.rs— the "N publishers", published / skipped / dry-runstatus lines →
tracing::info!; the publish error →tracing::error!.src/publishers/cargo.rs— the transient-retry notice →tracing::warn!.src/hooks/runner.rs— the⊙dry-run /▸running indicators →tracing::info!; the hook-failed warning →tracing::warn!.src/forge/gitlab.rs— the--draftunsupported warning →tracing::warn!.Level mapping: always-shown status →
info!, warnings →warn!, errors →error!. The colored✓ ▸ ⊙ ↻ →prefixes stay inside the message string, and theMessageOnlyformatter renders the message verbatim (viaformat_argsDebug — noquotes, no level/timestamp), so terminal output is byte-identical to before.
Behavioural note: the human layer writes to stderr (as the committed
logging.rsalready dictates), so these status lines move from stdout → stderr.That's the intended split — logs on stderr,
--jsondata stays on stdout(those
println!(serde_json)sites are deliberately left untouched). The childprocess passthrough in
hooks/runner.rs(eprint!of a failed hook's capturedoutput) also stays as-is — it relays subprocess bytes, not a ferrflow event.
Verified:
cargo buildclean, 669 lib tests pass,cargo fmt --check+cargo clippyclean.Remaining stages (follow-up PRs, per the issue's "not one giant PR"):
src/validate/,src/config/,src/monorepo/(hasif verbose && !quietgates to fold intodebug!), and thesrc/root (~92 sites, the bulk), then thedocs/observability/logs.mdschema + OTLP.