Skip to content

test(e2e): reuse config.TrunkConfig in the harness Config#422

Merged
joshua-temple merged 1 commit into
mainfrom
test/harness-trunkconfig-reuse
Jul 1, 2026
Merged

test(e2e): reuse config.TrunkConfig in the harness Config#422
joshua-temple merged 1 commit into
mainfrom
test/harness-trunkconfig-reuse

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

What

Closes #386. The e2e harness carried a hand-maintained Config struct duplicating the manifest schema; unmirrored fields were silently dropped on marshal (the #414 hand-added Inputs/Components were the symptom).

Change

Config is now a type alias: type Config = config.TrunkConfig (the CLI's authoritative manifest type). Every field the CLI parses is automatically marshalable into a scenario's manifest.yaml, with no parallel struct to maintain. This mirrors the multi-repo path (multi_repo_scenario.go), which already used config.TrunkConfig. Deleted the orphaned harness-local Config/BuildConfig/DeployConfig/PublishConfig/ConcurrencySpec.

Byte-compatibility

config.TrunkConfig is the CLI's own parse type, so harness marshal then CLI parse is a faithful round-trip. The one behavioral delta: the old struct emitted empty builds: []/depends_on: [] (no omitempty); the typed type omits them, which the CLI parses to the same value. Validated across scenarios (see below); the full e2e matrix on this PR exercises all 80+.

Tests

  • TestConfigReusesTrunkConfig: structural guarantee Config is config.TrunkConfig.
  • TestConfigCarriesFieldWithoutHarnessEdit: a scenario setting tag_prefix (absent from the retired mirror) reaches manifest.yaml and round-trips, with no harness edit.

Verification

go build (main + e2e), go test (main 2289 pass; harness unit 4 pass), golangci-lint, e2e build+vet all clean; Docker e2e (Custom Changelog + Two Env Happy Path) green. This PR relies on the full e2e matrix to confirm no scenario regresses from the omitempty delta.

The single-step and multi-step scenario harness carried a hand-mirrored
Config struct that duplicated trunk-config.yaml by hand. Any manifest field
nobody remembered to copy across was silently dropped on marshal, so a new
generator feature needed a matching harness edit before a scenario could
reach it.

Alias the harness Config to config.TrunkConfig, the CLI's own manifest type,
so every field the CLI parses is marshalable into a scenario's manifest.yaml
with no parallel struct to maintain. The multi-repo path already carried
config.TrunkConfig directly; single-step and multi-step now match it. The two
harness call sites that read changelog and validate as generic maps switch to
the typed pointer fields.

Add regression coverage proving a field absent from the retired struct
(tag_prefix) now round-trips from a scenario into the generated ci.config
block without a harness change.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple joshua-temple enabled auto-merge (squash) July 1, 2026 01:51
@joshua-temple joshua-temple merged commit 7ee802f into main Jul 1, 2026
18 checks passed
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.

test(e2e): reuse config.TrunkConfig in the harness Config to stop silently dropping new manifest fields

1 participant