From 29fd0e494c82950958075b2059583b8c1251aa3c Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 1 Jun 2026 21:11:35 +0000 Subject: [PATCH] Add configured source validation and inspection --- docs/cli.md | 37 +++++-- docs/operations.md | 32 +++++- docs/troubleshooting.md | 49 ++++++++-- internal/app/inspect.go | 71 ++++++++++---- internal/app/inspect_test.go | 53 ++++++++++ internal/app/run.go | 3 + internal/app/source_select.go | 120 +++++++++++++++++++++++ internal/app/validate.go | 65 +++++++++--- internal/app/validate_test.go | 179 ++++++++++++++++++++++++++++++++++ internal/cli/inspect.go | 22 ++++- internal/cli/root_test.go | 99 +++++++++++++++++++ internal/cli/source_mode.go | 26 +++++ internal/cli/validate.go | 22 ++++- 13 files changed, 728 insertions(+), 50 deletions(-) create mode 100644 internal/app/source_select.go create mode 100644 internal/cli/source_mode.go diff --git a/docs/cli.md b/docs/cli.md index fe48ec2..6d12e3d 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -15,17 +15,19 @@ distributor [--help] distributor version [--format text|json] distributor run [--config ] [--dry-run] [--force] [--format text|json] distributor validate [--format text|json] +distributor validate --config --pipeline [--bundle ] [--format text|json] distributor inspect [--format text|json] +distributor inspect --config --pipeline [--bundle ] [--format text|json] distributor manifest create --id [options] ``` - `version`: prints the application name and version. Development builds print `distributor dev`. - `run`: loads a YAML config, discovers source bundles, plans each configured destination, writes selected outputs unless `--dry-run` is set, and prints a final status summary. -- `validate`: validates a local source bundle directory or a local tree containing source bundles. -- `inspect`: validates local source bundles and prints normalized bundle metadata. +- `validate`: validates a local source bundle directory, a local source bundle tree, or one configured pipeline source. +- `inspect`: validates source bundles and prints normalized bundle metadata for a local path or one configured pipeline source. - `manifest create`: creates `manifest.json` for a local source bundle directory. -`validate` and `inspect` accept local paths only. `run` executes `local`, `ssh`, and `s3` backends. +`validate` and `inspect` have two mutually exclusive modes: a local path shortcut, or configured source mode with `--config --pipeline `. Configured source mode opens only the selected pipeline source and supports configured `local`, `ssh`, and `s3` sources. It does not open destinations. `run` executes configured sources and destinations. ## Flag reference @@ -47,6 +49,12 @@ Output-producing subcommands: - `--dry-run`: load config, discover bundles, inspect destination state, print planned actions and final status, and do not write output files, destination state, or SSH `known_hosts` entries. - `--force`: allow explicit destructive replacement for supported conflict cases in this run only. +`validate` and `inspect` configured source flags: + +- `--config `: config file to load for source validation or inspection. Required in configured source mode. +- `--pipeline `: pipeline source to validate or inspect. Required in configured source mode. +- `--bundle `: source-root-relative bundle directory to validate or inspect instead of discovering every bundle under the source root. + `manifest create` flags: - `--id `: source bundle id. Required. @@ -54,7 +62,7 @@ Output-producing subcommands: - `--created