Skip to content

direct: add test for redundant resources.yml lifecycle entries#5267

Merged
pietern merged 1 commit into
mainfrom
resource-dup-test
May 19, 2026
Merged

direct: add test for redundant resources.yml lifecycle entries#5267
pietern merged 1 commit into
mainfrom
resource-dup-test

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented May 19, 2026

Adds a unit test that fails when bundle/direct/dresources/resources.yml has redundant lifecycle rules: a field listed twice in the same category of a resource, or a hand-written field that resources.generated.yml already produces. The hand-written and generated configs are merged at runtime by consulting both in series (bundle/direct/bundle_plan.go), so duplicates were silently tolerated.

Also removes one existing bug the test surfaced: a duplicated block of gateway_definition.* and ingestion_definition.ingest_from_uc_foreign_catalog entries under pipelines.recreate_on_changes.

This pull request and its description were written by Isaac.

Adds a unit test that fails when `bundle/direct/dresources/resources.yml`
has redundant lifecycle rules: a field listed twice in the same category
of a resource, or a hand-written field that
`resources.generated.yml` already produces. The hand-written and
generated configs are merged at runtime by consulting both in series
(`bundle/direct/bundle_plan.go`), so duplicates were silently tolerated.

Also removes one existing class-A bug the test surfaced: a duplicated
block of `gateway_definition.*` and
`ingestion_definition.ingest_from_uc_foreign_catalog` entries under
`pipelines.recreate_on_changes`.

Co-authored-by: Isaac
@pietern pietern requested a review from denik May 19, 2026 10:13
@pietern pietern temporarily deployed to test-trigger-is May 19, 2026 10:14 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is May 19, 2026 10:14 — with GitHub Actions Inactive
@pietern pietern enabled auto-merge May 19, 2026 10:15
@pietern pietern added this pull request to the merge queue May 19, 2026
@denik
Copy link
Copy Markdown
Contributor

denik commented May 19, 2026

Possible follow up: add 'bool override' to FieldRule that allows intentional duplicate (we can check that value is different too). No specific use case though.

Merged via the queue into main with commit 437a1ea May 19, 2026
25 checks passed
@pietern pietern deleted the resource-dup-test branch May 19, 2026 13:06
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.

3 participants