Skip to content

Add --dump to discovery - #37

Merged
j0sh merged 1 commit into
mainfrom
ja/discovery-dump
Nov 3, 2026
Merged

j0sh merged 1 commit into
mainfrom
ja/discovery-dump

Conversation

@j0sh

@j0sh j0sh commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Prints discovered orchestrators as JSON and exits.

Fixes #30

Prints discovered orchestrators as JSON and exits.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 08:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the CLI-only discovery dump mode for one-shot inventory inspection.

No open issues 🎉

What changed in this PR

Adds CLI-only --dump mode to both discovery entry points, enabling one-shot inventory inspection without starting listeners or periodic refreshes, addressing issue #30.

Changes:

  • Reuses discovery collection and HTTP response encoding to write a newline-terminated JSON array.
  • Handles partial and total source failures, cancellation, and output errors, with diagnostics on stderr.
  • Adds unit and binary integration coverage, documents exit behavior, and updates CLI help.
File Description
docs/​discovery.md Documents dump mode, output, and exit behavior.
discovery/​server.go Adds one-shot collection and shared response encoding.
discovery/​server_test.go Tests response parity, record preservation, timeouts, cancellation, and output errors.
discovery/​app.go Adds the flag, conflicting-flag validation, and cancellable stdout writes.
discovery/​app_test.go Tests source outcomes, advertising switches, and configuration precedence.
cmd/​livepeer/​testdata/​cli/​discovery-help.golden Adds --dump to expected CLI help.
cmd/​livepeer/​integration_test.go Tests both entry points, occupied ports, failures, and output cancellation.

Review effort: Balanced

@j0sh
j0sh merged commit e2b3319 into main Nov 3, 2026
10 checks passed
@j0sh
j0sh deleted the ja/discovery-dump branch November 3, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a single-shot --dump mode to discovery

2 participants