Skip to content

sow config

Validate sow.yml against the schema and existing state, and print the configuration SOW actually applies.

Run sow config check after every edit to sow.yml and before the next build: it catches typos, invalid names, unusable signing keys, and changes that existing repository state cannot accept, without touching anything. Run sow config show when you need to know what SOW will actually apply to a repository or Dist, with every default and inherited value filled in. Both commands are read-only.

Synopsis

sow config check [-C DIR] [--json] [--passfile PATH]
sow config show [--all] [-C DIR] [-r NAME] [-d NAME]... [--json]

config check accepts --passfile for its signing checks. config show never reads password files and rejects the option.

Examples

Validate before a build in CI:

sow config check -C /srv/repo || exit 1
sow build -C /srv/repo -r pgsql

Compare the effective policy of two Dists:

sow config show -r pgsql -d el9 > /tmp/el9.yml
sow config show -r pgsql -d el9-beta > /tmp/beta.yml
diff -u /tmp/el9.yml /tmp/beta.yml

sow config check

config check parses and validates the whole sow.yml: schema version, names, path collisions, the architecture list, Dist formats, membership policy, and signing key references. It also checks the configuration against existing repository state, and reports the workspace it found and how much it validated:

sow config check
configuration valid: /srv/repo repositories=1 dists=2
sow config check --json
{"schema":"sow.cli/v1","command":"config check","ok":true,"repository":null,"operation":null,"result":{"workspace":"/srv/repo","repositories":1,"dists":2},"errors":[]}

Options

Flag Description Default
-C, --workdir DIR Workspace discovery start directory current directory
--passfile PATH Password file for this invocation per-key config, then SOW_GPG_PASSFILE
--json Output JSON false
-h, --help Show help —

Strict field rejection

An unknown key is an error, not a warning, so a misspelled policy field cannot be silently ignored:

sow config check
configuration error: load config "/srv/repo/sow.yml": parse sow.yml: yaml: construct errors: line 8: field bogus_field not found in type config.DistConfig

Active workspaces must use schema: sow/v3:

sow config check
configuration error: load config "/srv/repo/sow.yml": config schema must be "sow/v3", got "invalid"

A frozen sow/v2 workspace can still be inspected before migration: config check, repo ls, repo show, dist ls, and dist show read it without changing it.

How far the signing check goes depends on the signer:

  • Metadata key files are unlocked and checked for signing suitability. An external GPG metadata key also performs a small non-interactive signing probe.
  • For active RPM package signing, SOW checks the selected password file’s format, rpm/GPG, and that the secret key is available. It does not sign a package, so it cannot prove the password is correct; RPM macros can also affect authentication. The first real package signing, and verification of its output, is the final check.

Removing an architecture from the workspace list fails while anything still uses it. Remove it from Dist configuration, membership, and built state first.

sow config show

config show prints the effective configuration of the selected scope as YAML:

sow config show
schema: sow/v3
architectures:
  - x86_64
  - aarch64
repos:
  pigsty:
    protected: false
    signing:
      rpm:
        packages:
          mode: never
    dists:
      el9:
        format: rpm
        architectures:
          - x86_64
          - aarch64
        limit: 0
        exclude: []
      trixie:
        format: deb
        architectures:
          - x86_64
          - aarch64
        limit: 0
        exclude: []

The file on disk holds only what you wrote:

cat sow.yml
schema: sow/v3
architectures:
  - x86_64
  - aarch64
repos:
  pigsty:
    signing:
      rpm:
        packages:
          mode: never
    dists:
      el9:
        format: rpm
      trixie:
        format: deb

show filled in protected: false, each Dist’s inherited architectures, limit: 0, and an empty exclude list. Architectures appear under their canonical family names, x86_64 and aarch64; the corresponding DEB names are amd64 and arm64.

Options

Flag Description Default
--all Show every repository and Dist in the workspace; ignores -r and -d off
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Select a repository selection rules
-d, --dist NAME Select a distribution; repeatable selection rules
--json Output JSON false
-h, --help Show help —

Select configuration with -r and -d

-r and -d narrow the output to the selected objects, which is the quickest answer to “which policy applies to this Dist”:

sow config show -r pigsty -d el9
schema: sow/v3
architectures:
  - x86_64
  - aarch64
repos:
  pigsty:
    protected: false
    signing:
      rpm:
        packages:
          mode: never
    dists:
      el9:
        format: rpm
        architectures:
          - x86_64
          - aarch64
        limit: 0
        exclude: []

Without --all, the normal repository selection applies, so a workspace with several repositories needs -r. Inside a Dist directory SOW shows that Dist unless you pass -d; otherwise it shows every Dist of the selected repository. --all shows the entire workspace and ignores -r and -d.

Signing references

The output shows key references and resolved fingerprints, never private key material or passphrases. Configured passfile paths are shown as written; the SOW_GPG_PASSFILE fallback is a runtime setting and does not appear.

Exit codes

Code Trigger
0 Configuration valid, or output printed
1 Runtime or key-resolution failure
2 Usage or discovery error, ambiguous selection, invalid YAML, unknown field, or unsupported schema
5 Existing state, controlled paths, or recovery records are inconsistent
6 Unknown selection, unusable signing configuration, or configuration incompatible with existing state

See also

Table reader