Skip to content

resource/pingone_group: add export support - #134

Closed
samir-gandhi wants to merge 3 commits into
mainfrom
polaris/GH-75-pingone-group-export-support
Closed

resource/pingone_group: add export support#134
samir-gandhi wants to merge 3 commits into
mainfrom
polaris/GH-75-pingone-group-export-support

Conversation

@samir-gandhi

Copy link
Copy Markdown
Contributor

Summary

  • Adds Terraform export support for pingone_group: definitions/pingone/sso/group.yaml and internal/platform/pingone/resource_group.go, plus internal/platform/pingone/resource_group_test.go.
  • Attributes covered: name, description, population_id (references pingone_population, falls back to a variable since that resource isn't exported yet), user_filter, external_id, and custom_data (jsonencode_raw). id is computed-only; environment_id is injected by the orchestrator (no source_path), matching the pingone_davinci_flow pattern.
  • Uses the pingone-go-sdk-v2/management SDK via Client.management(ctx) (list-then-iterate over GroupsApi.ReadAllGroups, single GroupsApi.ReadOneGroup get) — no per-resource typed HAL links or list-then-get needed for this resource.
  • Updates contributing/RESOURCE_COVERAGE.md (pingone_group flipped to ✅) and adds .changelog/pr-134.txt.
  • Also updates two pre-existing hardcoded assertions that track the total number of registered definitions/resource types (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 pass
  • go build ./..., go vet ./..., go fmt ./... — clean
  • go test ./internal/... -v -count=1 — all pass, including new resource_group_test.go (registration, list pagination/empty/error cases, get success/not-found/error cases, management() not-configured error path)
  • Live export against a real PingOne environment (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_id resolved to var.pingone_environment_id, population_id resolved to a variable fallback (pingone_population not yet exported), import blocks correct ({env_id}/{group_id})
  • make regression-local: PASS — only acceptable additions (new pingone_group.tf file and the pingone_population_id variable/tfvars entries it introduces), no deletions or replacements in previously-exported resources

samir-gandhi and others added 3 commits July 24, 2026 15:34
…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>
@github-actions

Copy link
Copy Markdown

Regression Test Results

Matrix Entry Status Breaking Acceptable
default-hcl ✅ PASS 0 5
default-tfjson ✅ PASS 0 5
hcl-include-all ✅ PASS 0 7
hcl-skip-deps ✅ PASS 0 1
tfjson-skip-deps ✅ PASS 0 1

✅ No regressions detected

All export configurations produced compatible output.


Generated by regression workflow • View run

@samir-gandhi

Copy link
Copy Markdown
Contributor Author

Superseded by the pingone-core-resources branch — this PR's commits now live directly on that branch, which is being used as the integration target for the ongoing PingOne resource coverage pilot (tracked in #119) instead of main. Future resource PRs in this pilot target pingone-core-resources directly. Closing without merging to main.

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.

resource/pingone_group: add export support

1 participant