Skip to content

fix(devops): guard WIF pilot partial recovery - #9884

Merged
Git-on-my-level merged 1 commit into
mainfrom
codex/opentofu-wif-display-recovery
Jul 16, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
codex/opentofu-wif-display-recovery

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Shorten both Workload Identity Federation display names to satisfy the IAM API's 32-character limit.
  • Add a regression guard for both display names.
  • Add a state-aware recovery gate for the known development-only partial apply.

Related: #9842

Root cause and durable guard

The development bootstrap created its service account and roles/browser binding, then IAM rejected the WIF pool display name as too long. The provider display name was also too long and would have failed next.

The guard now rejects either overlong WIF display name. Its recovery mode accepts only the recorded two-resource prior state, preserves those resources as no-ops, and permits only creation of the pool, provider, and WIF impersonation binding. It rejects updates, replacements, deletions, unexpected state, and IAM changes.

Verification

  • python3 .github/scripts/test_check_opentofu_development_wif_pilot.py — 12 tests passed.
  • Backend-free OpenTofu init, validate, saved plan, JSON rendering, and exact five-create assertion — passed with the invalid offline sentinel token; no GCP authentication or mutation path.
  • tofu -chdir=infrastructure/opentofu/pilots/development-wif-plan fmt -check — passed.
  • make preflight — passed all 13 selected checks after rebasing onto the current main.

Product invariants affected

none

Failure class (fixes)

Failure-Class: none

No existing registered failure class covers a provider display-name contract missing from an IaC guard.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e0e25b596

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +320 to +323
if set(planned_resources) != EXPECTED_BOOTSTRAP_RESOURCES:
errors.append(
"bootstrap recovery planned values must contain exactly " f"{sorted(EXPECTED_BOOTSTRAP_RESOURCES)}"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate planned WIF values before recovery

In the recovery flow documented for operators, the checked plan is supplied as JSON, but this branch only compares the planned resource addresses. A stale saved plan from before the display-name fix still has the exact two prior resources and the same create/no-op actions while carrying the rejected 36/44-char WIF display names in planned_values, so --partial-recovery-plan-json passes and the operator can apply a plan that repeats the IAM API failure. Please validate the planned values for the WIF pool/provider rather than only the address set.

Useful? React with 👍 / 👎.

The development bootstrap stopped after two desired resources because the WIF display names exceeded the IAM API limit. Bound both labels and accept only the recorded two-resource state plus the remaining three creates during recovery.
@Git-on-my-level
Git-on-my-level force-pushed the codex/opentofu-wif-display-recovery branch from 5e0e25b to 1003811 Compare July 16, 2026 20:51
@Git-on-my-level
Git-on-my-level merged commit dba9895 into main Jul 16, 2026
20 of 23 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/opentofu-wif-display-recovery branch July 16, 2026 20:53
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
## Summary

- Shorten both Workload Identity Federation display names to satisfy the
IAM API's 32-character limit.
- Add a regression guard for both display names.
- Add a state-aware recovery gate for the known development-only partial
apply.

Related: BasedHardware#9842

## Root cause and durable guard

The development bootstrap created its service account and
`roles/browser` binding, then IAM rejected the WIF pool display name as
too long. The provider display name was also too long and would have
failed next.

The guard now rejects either overlong WIF display name. Its recovery
mode accepts only the recorded two-resource prior state, preserves those
resources as no-ops, and permits only creation of the pool, provider,
and WIF impersonation binding. It rejects updates, replacements,
deletions, unexpected state, and IAM changes.

## Verification

- `python3 .github/scripts/test_check_opentofu_development_wif_pilot.py`
— 12 tests passed.
- Backend-free OpenTofu init, validate, saved plan, JSON rendering, and
exact five-create assertion — passed with the invalid offline sentinel
token; no GCP authentication or mutation path.
- `tofu -chdir=infrastructure/opentofu/pilots/development-wif-plan fmt
-check` — passed.
- `make preflight` — passed all 13 selected checks after rebasing onto
the current `main`.

## Product invariants affected

none

## Failure class (fixes)

Failure-Class: none

No existing registered failure class covers a provider display-name
contract missing from an IaC guard.
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