resource/pingone_group: add export support - #134
Closed
samir-gandhi wants to merge 3 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 a schema-driven definition and Go handler for pingone_group, covering name, description, population_id (referencing pingone_population), user_filter, external_id, and custom_data (jsonencode_raw). Uses the pingone-go-sdk-v2/management SDK via Client.management(), following the list-then-iterate pagination pattern documented in the new-resource-pingone skill. Also bumps the hardcoded definition-count assertions in internal/schema/integration_test.go and the sorted resource-type list in internal/platform/pingone/dispatch_test.go, both of which track the total number of registered definitions/resources and needed updating for the new pingone_group entry. 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 |
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_group:definitions/pingone/sso/group.yamlandinternal/platform/pingone/resource_group.go, plusinternal/platform/pingone/resource_group_test.go.name,description,population_id(referencespingone_population, falls back to a variable since that resource isn't exported yet),user_filter,external_id, andcustom_data(jsonencode_raw).idis computed-only;environment_idis injected by the orchestrator (nosource_path), matching thepingone_davinci_flowpattern.pingone-go-sdk-v2/managementSDK viaClient.management(ctx)(list-then-iterate overGroupsApi.ReadAllGroups, singleGroupsApi.ReadOneGroupget) — no per-resource typed HAL links or list-then-get needed for this resource.contributing/RESOURCE_COVERAGE.md(pingone_groupflipped to ✅) and adds.changelog/pr-134.txt.internal/schema/integration_test.go,internal/platform/pingone/dispatch_test.go) — these are test upkeep, not edits required by the "two new files" invariant.Base SDK integration (PR #132) is a dependency — this PR should not be merged before #132.
Closes #75
Test plan
go run ./tools/validate-definitions definitions/— 9/9 passgo build ./...,go vet ./...,go fmt ./...— cleango test ./internal/... -v -count=1— all pass, including newresource_group_test.go(registration, list pagination/empty/error cases, get success/not-found/error cases,management()not-configured error path)make build && ./pingcli-terraformer export --out /tmp/export-test-group --output-format hcl --include-imports): 2 real groups exported correctly, no unresolved raw UUIDs,environment_idresolved tovar.pingone_environment_id,population_idresolved to a variable fallback (pingone_populationnot yet exported), import blocks correct ({env_id}/{group_id})make regression-local: PASS — only acceptable additions (newpingone_group.tffile and thepingone_population_idvariable/tfvars entries it introduces), no deletions or replacements in previously-exported resources