Skip to content

build(devops): add offline OpenTofu foundation guard - #9846

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:codex/opentofu-foundation-safety
Jul 15, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:codex/opentofu-foundation-safety

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

  • add an intentionally empty OpenTofu foundation module, locked Google provider, and isolated dev/prod backend examples;
  • enforce the ownership boundary in source and plan fixtures: foundation identity/IAM/state metadata only, never Cloud Run/GKE releases or secret values; and
  • add a credentials-free GitHub workflow that validates the source and produces an offline empty plan from a temporary backend-free copy.

Why

Omi's durable identity and IAM control plane needs a reviewable source of truth, while GitHub workflows remain the sole Cloud Run/GKE release writers. This establishes that boundary before a development WIF pilot.

Scope and safety

No GCP resource, state bucket, IAM binding, WIF provider, secret, Cloud Run/GKE release surface, or GitHub environment was changed. The workflow has contents: read only; the repository guard rejects GCP auth, OIDC tokens, gcloud, tofu apply, Cloud Run/GKE resources, data sources, and Secret Manager payload/version paths.

Verification

  • python3 .github/scripts/test_check_opentofu_foundation.py — 10 fixture tests passed.
  • python3 .github/scripts/check_opentofu_foundation.py --plan-json /tmp/omi-opentofu.wkAqDX/foundation-clean-plan.json — source and empty-plan boundary passed.
  • Checksum-verified OpenTofu 1.12.4: init -backend=false, validate, and a credentials-free offline plan -refresh=false -lock=false — passed with No changes.
  • actionlint -shellcheck '' .github/workflows/opentofu-foundation-validate.yml — passed.
  • make preflight and pre-push deterministic checks — passed (12 manifest checks selected).

No product invariants apply to these paths.

Refs #9842.

Review in cubic

Establish an intentionally empty OpenTofu foundation module for BasedHardware#9842.\n\nThe module has a GCS backend shape, separate environment placeholders, and a locked Google provider. Its guard allows only durable identity, additive IAM, secret metadata, and state-bucket resource families; it rejects release resources, data sources, and secret values. The validation workflow is credentials-free and can only validate the source plus plan a backend-free temporary copy.\n\nVerification:\n- python3 .github/scripts/test_check_opentofu_foundation.py\n- python3 .github/scripts/check_opentofu_foundation.py --plan-json /tmp/omi-opentofu.wkAqDX/foundation-clean-plan.json\n- actionlint -shellcheck '' .github/workflows/opentofu-foundation-validate.yml\n- checksum-verified OpenTofu 1.12.4 init -backend=false, validate, and offline -refresh=false empty plan with Google credentials unset
@Git-on-my-level
Git-on-my-level merged commit c75abf5 into BasedHardware:main Jul 15, 2026
20 of 23 checks passed
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
)

## Summary

- add an intentionally empty OpenTofu foundation module, locked Google
provider, and isolated dev/prod backend examples;
- enforce the ownership boundary in source and plan fixtures: foundation
identity/IAM/state metadata only, never Cloud Run/GKE releases or secret
values; and
- add a credentials-free GitHub workflow that validates the source and
produces an offline empty plan from a temporary backend-free copy.

## Why

Omi's durable identity and IAM control plane needs a reviewable source
of truth, while GitHub workflows remain the sole Cloud Run/GKE release
writers. This establishes that boundary before a development WIF pilot.

## Scope and safety

No GCP resource, state bucket, IAM binding, WIF provider, secret, Cloud
Run/GKE release surface, or GitHub environment was changed. The workflow
has `contents: read` only; the repository guard rejects GCP auth, OIDC
tokens, `gcloud`, `tofu apply`, Cloud Run/GKE resources, data sources,
and Secret Manager payload/version paths.

## Verification

- `python3 .github/scripts/test_check_opentofu_foundation.py` — 10
fixture tests passed.
- `python3 .github/scripts/check_opentofu_foundation.py --plan-json
/tmp/omi-opentofu.wkAqDX/foundation-clean-plan.json` — source and
empty-plan boundary passed.
- Checksum-verified OpenTofu 1.12.4: `init -backend=false`, `validate`,
and a credentials-free offline `plan -refresh=false -lock=false` —
passed with `No changes`.
- `actionlint -shellcheck ''
.github/workflows/opentofu-foundation-validate.yml` — passed.
- `make preflight` and pre-push deterministic checks — passed (12
manifest checks selected).

No product invariants apply to these paths.

Refs BasedHardware#9842.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/9846?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
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