resource/pingone_population: Add export support - #135
Closed
samir-gandhi wants to merge 4 commits into
Closed
Conversation
…sources pingone-go-client only covers DaVinci, Environments, Connectors, and ConfigurationManagement APIs, so the ~92 open Platform/SSO/Authorize/MFA/ Protect/Verify export-support issues cannot be implemented against it. Add patrickcping/pingone-go-sdk-v2/management (the SDK terraform-provider- pingone itself uses) as a second client on Client, built lazily since it performs an OAuth exchange at construction time rather than on first request.
The go:embed directive listed pingone/base and pingone/davinci explicitly, so every new resource category (sso, platform, mfa, ...) would require editing this file — violating the "new resource requires zero edits to existing files" invariant. A single pingone/*/*.yaml wildcard covers any category subdirectory automatically.
Adds the pingone_population YAML definition and Go handler using the management SDK's list-then-paginate/get pattern, per issue #81. Both password_policy.id and theme.id nested references degrade gracefully to Terraform variable fallbacks since pingone_password_policy and pingone_branding_theme are not yet exported by this tool; resolution auto-promotes once those resource types land, with no changes needed here. Updates dispatch_test.go and schema integration_test.go resource-count assertions to account for the new registered type, and flips the pingone_population row in RESOURCE_COVERAGE.md to supported. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Regression Test Results
✅ No regressions detectedAll export configurations produced compatible output. Generated by regression workflow • View run |
Regression Test Results
✅ No regressions detectedAll export configurations produced compatible output. Generated by regression workflow • View run |
Contributor
Author
|
Superseded by the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pingone_populationper issue resource/pingone_population: add export support #81, following the schema-driven pattern: one YAML definition (definitions/pingone/sso/population.yaml) and one Go handler (internal/platform/pingone/resource_population.go) — no edits to existing resource files.github.com/patrickcping/pingone-go-sdk-v2/managementSDK (viaClient.management(ctx)), following the list-then-paginate/get pattern documented in thenew-resource-pingoneskill forPopulationsApi.ReadAllPopulations/ReadOnePopulation.password_policy.idandtheme.idnested attributes declarereferences_typepointing atpingone_password_policyandpingone_branding_themerespectively — neither resource type is implemented yet in this repo, so both degrade gracefully to Terraform variable fallbacks (var.pingone_password_policy_id,var.pingone_branding_theme_id) per the existing reference-resolution fallback behavior inorchestrator.go. Resolution will auto-promote to a resource reference once those resource types are added, with zero changes needed topopulation.yaml.contributing/RESOURCE_COVERAGE.mdflippedpingone_populationto ✅..changelog/pr-135.txt.internal/platform/pingone/dispatch_test.go,internal/schema/integration_test.go) whose assertions hardcode the total registered/loaded resource count — these needed a+1bump to account for the new registration, per this repo's existing pattern for adding a resource.Dependency: Base SDK integration (PR #132) is a dependency — this PR should not be merged before #132.
Closes #81
Test plan
go run ./tools/validate-definitions definitions/— passes, 9/9 definitions includingpingone_population(10 attributes)go build ./.../go vet ./.../go fmt ./...— cleango test ./internal/... -v -count=1— all packages pass, including new table-driven tests inresource_population_test.go(list success/empty/no-embedded/API-error/unconfigured-client, get success/not-found/empty-id/unconfigured-client)./pingcli-terraformer export --out /tmp/export-test-population --output-format hcl --include-imports— found and exported 2 populations, correctenvironment_id = var.pingone_environment_id,theme.idcorrectly fell back tovar.pingone_branding_theme_id(no raw UUIDs in output), import blocks generated correctlymake regression-local— PASS, only acceptable additions (newpingone_population.tffile, newpingone_branding_theme_idvariable) vs. main; no deletions or replacements in existing resources🤖 Generated with Claude Code