Skip to content

chore(infra): add terraform bootstrap for azure remote state - #14

Merged
danielrpof merged 4 commits into
mainfrom
feat/terraform-bootstrap
Oct 31, 2026
Merged

danielrpof merged 4 commits into
mainfrom
feat/terraform-bootstrap

Conversation

@danielrpof

Copy link
Copy Markdown
Owner

Summary

Phase 999.1 slice (a). Adds infra/bootstrap, applied once by hand and never destroyed.

infra/
├── .gitignore               # state, tfvars, plans, overrides
└── bootstrap/
    ├── main.tf              # rg + versioned private storage + tfstate container
    ├── github_oidc.tf       # managed identity + federated credential + 2 roles
    ├── backend.tf           # azurerm backend, key bootstrap/terraform.tfstate
    ├── versions.tf  providers.tf  variables.tf
    └── README.md
sequenceDiagram
    participant GH as GitHub Actions (main)
    participant AAD as Entra ID
    participant MI as Managed identity
    GH->>AAD: OIDC token (subject = repo + main)
    AAD->>MI: match federated credential
    AAD-->>GH: short-lived access token
Loading

A user-assigned managed identity replaces an app registration: the university tenant returned 403 on service-principal and credential writes.

Evidence

  • Before: bootstrap state in a local terraform.tfstate.
    After: terraform plan reports No changes. Your infrastructure matches the configuration. and the tfstate container holds one blob, bootstrap/terraform.tfstate.
  • Pre-commit hooks pass (gitleaks); no state, tfvars or plan files are tracked.

Merge Danger

Door: two-way

Merging adds files only. The Azure resources were already applied by hand, so reverting the PR changes nothing in Azure, and prevent_destroy blocks accidental teardown.

Blast Radius: none

No app code, workflow or release change. Titled chore so the release job skips; merge with squash.

Phase 999.1 slice (a). Adds infra/bootstrap: resource group, versioned
private storage account and tfstate container, a user-assigned managed
identity with a federated credential for GitHub Actions on main, and role
assignments for the pipeline. State is migrated to the azurerm backend.

A managed identity replaces an app registration because the university
tenant denies service-principal and credential writes.
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Coverage

Area Coverage Δ vs main Gate Status
Backend 90.64% +0.06pp 80% ✅
Frontend 97.65% ±0.00pp 70% ✅

head 0266def · 2026-10-31T01:28:41Z
baseline: main@d000201

danielrpof added a commit that referenced this pull request Oct 31, 2026
## Summary

Clears the Trivy gates: `trivy-fs` first, then `build-scan`, which it
had been hiding. No `package.json` or `go.mod` changes.

```diff
 # web/pnpm-lock.yaml, transitive, within existing ranges
-body-parser        2.3.0
+body-parser        2.4.0    # CVE-2026-111181
-systeminformation  5.33.1
+systeminformation  5.33.18  # CVE-2026-116576
-undici             7.30.0
+undici             7.30.1   # CVE-2026-109383, -109829, -109869, -87018
-undici             8.11.2
+undici             8.12.3

 # Dockerfile, go-build stage
-golang:1.26.9-alpine3.24
+golang:1.26.10-alpine3.24   # stdlib CVE-2026-111943
```

## Evidence

- **Before:** `trivy-fs` fails with 6 HIGH findings in
`web/pnpm-lock.yaml` (blocking #14); then `build-scan` fails with 1 HIGH
in the `server` binary's stdlib.
  **After:** `trivy-fs` and `build-scan` both pass on this branch.
- `pnpm install --frozen-lockfile`, prettier and `pnpm test` ran locally
on the updated lockfile.

## Merge Danger

**Door:** two-way

Revert restores the previous lockfile and builder image.

**Blast Radius:** minor

`fix` type cuts a patch release. The server binary is rebuilt with Go
1.26.10; the web packages come through tooling (`shadcn`, `jsdom`).
@danielrpof
danielrpof merged commit 67b1bec into main Oct 31, 2026
26 checks passed
@danielrpof
danielrpof deleted the feat/terraform-bootstrap branch October 31, 2026 01:33
danielrpof added a commit that referenced this pull request Oct 31, 2026
## Summary

Squash merges removed the commits that the planning docs cite.

```diff
-84bc8a8
+67b1bec  # #14
-f45762a
+d000201  # #15
```

## Evidence

- **Before:** `git grep` finds both old hashes in `.planning/`.
  **After:** it finds neither.

## Merge Danger

**Door:** two-way

**Blast Radius:** none

Planning docs only. `docs` type, so no release.
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