Skip to content

Polaris/regression env config - #149

Merged
samir-gandhi merged 13 commits into
mainfrom
polaris/regression-env-config
Sep 21, 2026
Merged

samir-gandhi merged 13 commits into
mainfrom
polaris/regression-env-config

Conversation

@samir-gandhi

Copy link
Copy Markdown
Contributor

No description provided.

samir-gandhi and others added 13 commits September 1, 2026 15:22
Resource addresses are enumerated output and must be pipeable (as
established by the list-outputs command), but --list-resources printed
them through logger.Message, which writes to stderr and interleaved
progress lines. Extract writeResourceAddresses and write one
resource_type.label per line to stdout.

Also fix a mangled comment/func boundary in collectOutputPaths.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Store the Terraform HCL describing the static PingOne regression
environment used by the PR regression workflow, so it can be rebuilt if
lost or audited for drift. Generated by `pingcli-terraformer export
--output-format hcl --include-values` at c14d0b5 (post PR #146), then
reviewed and scrubbed:

- Connector clientSecret values are empty in the export (the API does
  not return secret values on read) — marked "provide manually".
- davinci_variable_testPW_value is a password held in a plain DaVinci
  variable; scrubbed from the tfvars and from three flow definitions
  that embed it in a rich-text node.
- Four flows with empty descriptions had description = "" omitted; the
  pingidentity/pingone provider enforces min-length 1 and the verbatim
  export fails `terraform validate` otherwise.

Also add the CONFIG_AS_CODE_PLAN.md written earlier this session.

Un-ignore tests/regression/environment/** in .gitignore so the snapshot
can be committed alongside the *.tf output-file rule.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Promote tests/regression/environment/ from a never-applied snapshot to
the management config for the static PingOne regression environment:

- Root versions.tf (pingone provider, env-var credentials) and an empty
  backend "s3" block configured at init (bucket/region/key from the CI
  blob), matching the pipeline-example-platform-test convention.
- ping-export-terraform.auto.tfvars is now git-ignored and removed from
  the tree: variable values ride in the TERRAFORM_ENV_BASE64 CI blob and
  1Password. davinci_variable_testPW_value is declared sensitive with no
  default.
- Secret-bearing connector instances get
  lifecycle { ignore_changes = [properties] } so apply can never wipe
  live clientSecrets the API cannot read back.
- Committed .terraform.lock.hcl for reproducible CI applies; the
  ephemeral state-adoption import file is git-ignored.
- New reviewer-gated regression-env-apply workflow: manual dispatch only
  (plan/apply modes, optional -target), saved-plan-file apply,
  post-apply verification plan, non-cancelling concurrency.
- Docs: tests/regression/README.md gains the drift-repair runbook, the
  regression-env-apply secrets/setup, and the "new resource type ->
  live resource" checklist; environment README rewritten (state policy,
  adoption runbook, scratch-only re-exports); CONFIG_AS_CODE_PLAN.md
  marked superseded; DEVELOPER_HANDBOOK and new-resource skill point at
  the checklist; changelog pr-149.

One-time state adoption (198 resources) is a documented local runbook
step pending the AWS bucket and write-scoped worker provisioning.

Co-Authored-By: Claude Code <noreply@anthropic.com>
export.sh gains --upload (export then upload) and --upload-only (upload
the reviewed tfvars without exporting) to push the generated
ping-export-terraform.auto.tfvars as the TERRAFORM_TFVARS_BASE64
repo-level Actions secret. Requires a gh account with repository-secret
write access; the resolved file is piped, never staged or echoed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
export.sh gains --full: backs up the tracked environment config to a
git-ignored .config-backup/ then replaces the .tf files with a fresh
full export, for wholesale baseline refreshes after deliberate
environment changes. --revert restores the backup. The default mode
still refreshes only the tfvars file; --imports now requires --full.

Co-Authored-By: Claude Code <noreply@anthropic.com>
--full now passes --include-imports in the single export run (the
generator emits ping-export-imports.tf independently of the tfvars), so
the state-adoption import file no longer needs a second export run.
The separate --imports flag is removed; --revert, --upload-only, and
the tfvars-only default are unchanged.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The default export now compares generated variable names against the
existing ping-export-terraform.auto.tfvars before touching it: an
unchanged variable set preserves the user's reviewed values (no churn,
no forced re-review), while new variables trigger a .tfvars-backup of
the old file before the fresh export replaces it — variables no longer
generated are reported but left in place.

Co-Authored-By: Claude Code <noreply@anthropic.com>
--full overwrites the tfvars as part of the fresh export but had no
backup of the previous values — only the default path protected them.
--full now saves the existing tfvars to
ping-export-terraform.auto.tfvars.bak before exporting, same as the
default path.

Co-Authored-By: Claude Code <noreply@anthropic.com>
export.sh loses the tfvars-only branch: every run is now a full refresh
that backs up the tracked config and the tfvars before exporting (the
tfvars backup is auto-restored when the fresh export's variable set
matches, keeping reviewed values; on a changed set the old file stays
as .bak for diffing). --revert and --upload-only are unchanged.

ping-export-imports.tf is now committed: its import blocks auto-import
resources absent from state (a rebuilt environment self-imports on the
first apply) and are verified-inert no-ops for resources already
managed — Terraform 1.14 ignores import blocks whose targets are in
state. Adoption therefore reduces to init + apply.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Regression Test Results

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

✅ No regressions detected

All export configurations produced compatible output.


Generated by regression workflow • View run

@samir-gandhi
samir-gandhi merged commit 2f33a0c into main Sep 21, 2026
8 checks passed
@samir-gandhi
samir-gandhi deleted the polaris/regression-env-config branch September 22, 2026 02:37
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.

1 participant