Skip to content

build(devops): add dev WIF read-only plan pilot - #9848

Merged
Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/opentofu-dev-wif-plan
Jul 15, 2026
Merged

Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/opentofu-dev-wif-plan

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Scope

Implements the development-only proof slice for #9842. It creates source code only; no GCP resources have been created or updated.

  • Defines a five-resource bootstrap: dedicated GitHub WIF pool/provider, a dedicated development plan service account, its workloadIdentityUser binding, and project-level roles/browser.
  • Locks the pilot to based-hardware-dev (project number 1031333818730) and immutable GitHub repository ID 776121034, owner ID 162546372, the dedicated workflow, development environment, and main.
  • Adds a manually dispatched workflow that exchanges GitHub OIDC only after bootstrap, then runs a data-only google_project plan with no remote backend, refresh, lock, or apply path.
  • Adds an offline validation workflow plus static guard/fixtures that reject production scope, broader roles, secret access, release ownership, long-lived key credentials, extra OpenTofu files/providers/modules/provisioners, and tofu apply.
  • Saves the offline bootstrap plan, renders JSON, and requires exactly the five approved create actions—no other resource or action can pass CI.

Explicit operator gate

This PR does not apply the bootstrap. A separately approved development operator must create the isolated versioned GCS state bucket, use a write-capable development-only identity to apply the reviewed saved plan, perform a metadata-only read-back, and then dispatch the workflow from main. Production remains out of scope.

Verification

  • python3 .github/scripts/test_check_opentofu_development_wif_pilot.py — 10 passing tests.
  • python3 .github/scripts/check_opentofu_development_wif_pilot.py — passed.
  • actionlint -shellcheck "" .github/workflows/opentofu-development-wif-pilot.yml .github/workflows/opentofu-development-wif-pilot-validate.yml — passed.
  • OpenTofu 1.12.4: in a fresh environment with no ADC or GCP credentials, source init -backend=false and validate passed; the backend-free, no-refresh saved bootstrap plan passed JSON validation with exactly 5 creates and 0 changes/destroys.
  • Development read-only profile: probes/development-project-read plan read based-hardware-dev and emitted project number 1031333818730, with no infrastructure changes.
  • make preflight and the push hook — passed all 15 selected checks.

Addresses the P2 plan-proof review thread. Refs #9842.

@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: 7432c2df3b

ℹ️ 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".

@Git-on-my-level
Git-on-my-level force-pushed the codex/opentofu-dev-wif-plan branch from e315f2a to db8d62e Compare July 15, 2026 22:18
@Git-on-my-level
Git-on-my-level merged commit 489870a into BasedHardware:main Jul 15, 2026
20 of 26 checks passed
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
## Scope

Implements the development-only proof slice for BasedHardware#9842. It creates source
code only; no GCP resources have been created or updated.

- Defines a five-resource bootstrap: dedicated GitHub WIF pool/provider,
a dedicated development plan service account, its `workloadIdentityUser`
binding, and project-level `roles/browser`.
- Locks the pilot to `based-hardware-dev` (project number
`1031333818730`) and immutable GitHub repository ID `776121034`, owner
ID `162546372`, the dedicated workflow, `development` environment, and
`main`.
- Adds a manually dispatched workflow that exchanges GitHub OIDC only
after bootstrap, then runs a data-only `google_project` plan with no
remote backend, refresh, lock, or apply path.
- Adds an offline validation workflow plus static guard/fixtures that
reject production scope, broader roles, secret access, release
ownership, long-lived key credentials, extra OpenTofu
files/providers/modules/provisioners, and `tofu apply`.
- Saves the offline bootstrap plan, renders JSON, and requires exactly
the five approved `create` actions—no other resource or action can pass
CI.

## Explicit operator gate

This PR does **not** apply the bootstrap. A separately approved
development operator must create the isolated versioned GCS state
bucket, use a write-capable development-only identity to apply the
reviewed saved plan, perform a metadata-only read-back, and then
dispatch the workflow from `main`. Production remains out of scope.

## Verification

- `python3 .github/scripts/test_check_opentofu_development_wif_pilot.py`
— 10 passing tests.
- `python3 .github/scripts/check_opentofu_development_wif_pilot.py` —
passed.
- `actionlint -shellcheck ""
.github/workflows/opentofu-development-wif-pilot.yml
.github/workflows/opentofu-development-wif-pilot-validate.yml` — passed.
- OpenTofu `1.12.4`: in a fresh environment with no ADC or GCP
credentials, source `init -backend=false` and `validate` passed; the
backend-free, no-refresh saved bootstrap plan passed JSON validation
with exactly 5 creates and 0 changes/destroys.
- Development read-only profile: `probes/development-project-read` plan
read `based-hardware-dev` and emitted project number `1031333818730`,
with no infrastructure changes.
- `make preflight` and the push hook — passed all 15 selected checks.

Addresses the P2 plan-proof review thread. Refs BasedHardware#9842.
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