Skip to content

Fix: Preserve portal identity provider refs in dump output#901

Merged
rspurgeon merged 4 commits intomainfrom
fix-portal-idp-scenario
Apr 26, 2026
Merged

Fix: Preserve portal identity provider refs in dump output#901
rspurgeon merged 4 commits intomainfrom
fix-portal-idp-scenario

Conversation

@rspurgeon
Copy link
Copy Markdown
Collaborator

Summary

Fix portal identity provider dump round trips by preserving kongctl metadata during serialization.

  • Add explicit JSON and YAML marshalers for PortalIdentityProviderResource so ref and portal are emitted alongside the embedded SDK identity provider payload.
  • Add regression coverage for JSON/YAML serialization of portal identity provider metadata.
  • Tighten the portal identity provider e2e scenario dump assertion to require the nested dumped provider ref.

Root Cause

PortalIdentityProviderResource embeds the SDK CreateIdentityProvider type, which has its own MarshalJSON. That promoted marshaler caused dump output to include SDK fields like type, enabled, and config, but drop kongctl metadata such as ref. Loading the dumped YAML then failed validation with an empty portal identity provider ref.

Validation

  • go test ./internal/declarative/resources ./internal/cmd/root/verbs/dump
  • make format
  • make test
  • make build
  • make lint

The full portal identity provider e2e scenario was not run locally because it requires real IdP environment variables and resets the test organization.

@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-2 April 25, 2026 22:21 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-4 April 25, 2026 22:21 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-3 April 25, 2026 22:21 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-5 April 25, 2026 22:21 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance April 25, 2026 22:21 — with GitHub Actions Inactive
@rspurgeon rspurgeon marked this pull request as ready for review April 26, 2026 15:08
Copilot AI review requested due to automatic review settings April 26, 2026 15:08
@rspurgeon rspurgeon requested review from a team as code owners April 26, 2026 15:08
@rspurgeon rspurgeon changed the title [codex] Preserve portal identity provider refs in dump output Fix: Preserve portal identity provider refs in dump output Apr 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes portal identity provider dump/load round-trips by ensuring kongctl metadata (ref, portal) is preserved when serializing embedded SDK identity provider payloads.

Changes:

  • Add custom JSON/YAML marshaling for PortalIdentityProviderResource to include ref/portal alongside SDK fields.
  • Add regression tests for JSON + YAML dump output containing portal identity provider metadata.
  • Tighten the portal IdP e2e scenario assertion to require the dumped nested provider ref.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/e2e/scenarios/portal/identity_providers/scenario.yaml Strengthens scenario dump assertions to verify the provider ref is preserved.
internal/declarative/resources/portal_identity_provider_test.go Adds regression coverage to ensure JSON/YAML serialization includes ref/portal.
internal/declarative/resources/portal_identity_provider.go Introduces explicit marshalers to avoid embedded SDK MarshalJSON dropping kongctl metadata.

Comment thread internal/declarative/resources/portal_identity_provider_test.go Outdated
Comment thread internal/declarative/resources/portal_identity_provider_test.go Outdated
Comment thread internal/declarative/resources/portal_identity_provider.go
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-5 April 26, 2026 15:19 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-4 April 26, 2026 15:19 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-3 April 26, 2026 15:19 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-2 April 26, 2026 15:19 — with GitHub Actions Inactive
@rspurgeon rspurgeon had a problem deploying to kongctl-acceptance April 26, 2026 15:19 — with GitHub Actions Failure
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance April 26, 2026 15:22 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance April 26, 2026 15:34 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-2 April 26, 2026 15:34 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-5 April 26, 2026 15:34 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-3 April 26, 2026 15:34 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-4 April 26, 2026 15:34 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-3 April 26, 2026 15:43 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-2 April 26, 2026 15:43 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-4 April 26, 2026 15:43 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance April 26, 2026 15:43 — with GitHub Actions Inactive
@rspurgeon rspurgeon temporarily deployed to kongctl-acceptance-5 April 26, 2026 15:43 — with GitHub Actions Inactive
@rspurgeon rspurgeon merged commit 2110337 into main Apr 26, 2026
22 checks passed
@rspurgeon rspurgeon deleted the fix-portal-idp-scenario branch April 26, 2026 15:48
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.

2 participants