Skip to content

Add the FilOzone github-mgmt admin guide and retire Upgrade - #84

Merged
beck-8 merged 18 commits into
masterfrom
beck-8/filozone-runbook
Dec 3, 2026
Merged

beck-8 merged 18 commits into
masterfrom
beck-8/filozone-runbook

Conversation

@beck-8

@beck-8 beck-8 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add docs/INFRA_ADMIN.md, the guide for FilOz maintainers who operate github-mgmt: the Terraform state backend and bootstrap state, the read/write/push environments and why there are three, applying access changes and what the normal PR flow can't do (prevent_destroy, archived repositories, team settings), removing an org member, running Sync, recovering state, a failed Apply or a stuck lock, rotating GitHub App keys, and upgrading from upstream.
  • Rewrite README.md for people requesting access: what this repo is, how to request a change, who reviews, a pointer to the admin guide, and why it's called github-mgmt.
  • Retire the Upgrade workflow (.github/workflows/upgrade.yml). It ran ipdxco/github-as-code's @master reusable workflow with the read-write App key, and merging its PR would overwrite FilOzone's OIDC workflows. Upgrades are now manual, reviewed PRs (see the admin guide); docs/HOWTOS.md points there.
  • Update docs/SETUP.md for the current setup: bootstrap state storage, App credentials as environment secrets, and write and push limited to master.

Validation

  • Checked repository-relative links and ran git diff --check.
  • Checked the backend and environment details against the live setup: bucket, versioning and roles in AWS, and the environment secrets and branch policies in this repo.

@github-actions

Copy link
Copy Markdown
Contributor

The following access changes will be introduced as a result of applying the plan:

Access Changes
There will be no access changes

@github-actions

Copy link
Copy Markdown
Contributor

Before merge, verify that all the following plans are correct. After merge, Apply will regenerate the plans from the merged commit and continue only if they match.

Terraform plans

FilOzone
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

@FilOzzy FilOzzy moved this from 📌 Triage to ⌨️ In Progress in FOC Nov 26, 2026
@beck-8
beck-8 marked this pull request as ready for review November 27, 2026 10:30
@beck-8
beck-8 requested review from BigLep and galargh November 27, 2026 10:30

@BigLep BigLep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Beck. I reviewed this with agent help (Claude and Codex) and checked their findings against the workflows, the Terraform, and the live environment settings. The content is a good base; my asks are mostly about structure and a few gaps that could bite an operator.

I've left these as comments and suggestions rather than pushing the changes myself so the reasoning is out in the open to review and discuss. We'll make similar changes to filecoin-project/github-mgmt, so it's worth agreeing on the approach here first.

1. Split the docs by audience. People requesting access and people operating the infra need different docs.

  • README.md: say this is FilOzone's fork of ipdxco/github-as-code, maintained by the FilOz team, which takes upstream changes. Note that it's very similar to filecoin-project/github-mgmt, since FilOz manages both. Explain how to request access (edit github/FilOzone.yml, open a PR, what happens on merge, who approves) and link docs/HOWTOS.md for details. Point operators to the new admin guide. Please also add a short FAQ with this entry:

    Why is this called github-mgmt instead of github-as-code? ipdxco/github-as-code grew out of filecoin-project/github-mgmt. github-mgmt was the original name, and it's the one that has stuck in the Filecoin community.

  • Rename this file to docs/INFRA_ADMIN.md and keep it for operators. Link docs/SETUP.md and docs/ABOUT.md for background instead of repeating them.

The filecoin-project PR can follow the same shape.

2. Retire the Upgrade workflow. Please delete .github/workflows/upgrade.yml in this PR and document only the manual upgrade path (suggestion on the Upgrade section below). Upstream's Upgrade copies every tracked template file except a short exclusion list, so it would copy over our apply.yml, plan.yml, sync.yml, fix.yml, clean.yml and docs/SETUP.md. Merging its PR would remove our OIDC setup (upstream still uses RO_AWS_*/RW_AWS_* secrets), and Plan wouldn't catch it because Plan only takes github/ from the PR (plan.yml:72-81). It also runs upstream @master with our read-write App key.

3. Keep history out of the doc. The #83 example and the backend cutover paragraph describe past events; they belong in those PRs. Suggestions below remove them.

4. Gaps worth documenting (inline below): prevent_destroy on members and repos, access changes on archived repos, -refresh=false and drift, and Sync's weekly schedule plus force-push to master.

5. Secrets are repository-scoped today. The six RO_GITHUB_APP_*/RW_GITHUB_APP_* secrets are repository secrets, and the read, write and push environments have none. So the environments' master-only restriction doesn't limit who can use the read-write key; any workflow in the repo can read it. The suggestions below describe the current setup. Moving the App secrets into the environments (read-only in read and push, read-write in write and push) is worth a follow-up. The legacy RO_AWS_*/RW_AWS_* repository secrets are still there too and can be deleted now that OIDC is live.

6. Links and terms. Link each workflow, App and settings page on first mention, and say "Terraform workspace" and "Terraform bootstrap" so those terms aren't ambiguous.

Comment thread docs/RUNBOOK.md Resolved
Comment thread docs/RUNBOOK.md Resolved
Comment thread docs/RUNBOOK.md Resolved
Comment thread docs/RUNBOOK.md Outdated
| State and lock paths | `org/FilOzone/terraform.tfstate` and `org/FilOzone/terraform.tfstate.tflock` |
| OIDC roles | `filoz-github-mgmt-filozone-ro` and `filoz-github-mgmt-filozone-rw` |

Keep the separate bootstrap state for changes to the versioned bucket or IAM roles. [Backend](../terraform/terraform_override.tf) · [Bootstrap](../terraform/bootstrap/aws.tf)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This line was hard to follow. Also: terraform/bootstrap/aws.tf has no backend block, so its state is a local file, and docs/SETUP.md:17 only says to keep it "in secure storage". Where is it? The doc should name the location and who can reach it, or nobody can change the bucket or roles safely later. I've left LOCATION and OWNER placeholders.

Suggested change
Keep the separate bootstrap state for changes to the versioned bucket or IAM roles. [Backend](../terraform/terraform_override.tf) · [Bootstrap](../terraform/bootstrap/aws.tf)
A separate Terraform root, the [Terraform bootstrap](../terraform/bootstrap/aws.tf), creates the S3 bucket and the OIDC IAM roles. A maintainer applies it separately with their own AWS session. It declares no backend, so its state is a local file: before changing the bucket or roles, get the existing bootstrap state from LOCATION (accessible to OWNER) and use it. [Backend config](../terraform/terraform_override.tf)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I’ve updated the guide to explain which access changes need an org owner. For full offboarding, should FilOzone follow the same process as filecoin-project?

Remove team memberships and direct repository grants through a PR, then verify that Apply succeeded.
Have an org owner remove the member from FilOzone in GitHub.
Run Sync to record the removal in Terraform state and YAML.
Could a FilOzone org owner confirm this sequence before we merge the guide?

Comment thread docs/RUNBOOK.md Resolved
Comment thread docs/RUNBOOK.md Resolved
Comment thread docs/RUNBOOK.md Resolved
Comment thread docs/RUNBOOK.md Resolved
Comment thread docs/RUNBOOK.md Resolved
Comment thread README.md Resolved
Restore the reasoning for read, write and push (why read allows any branch, why push has no AWS role) and use the github-mgmt naming history from the review.
@BigLep BigLep changed the title Add the FilOzone GitHub management runbook Add the FilOzone github-mgmt admin guide and retire Upgrade Dec 3, 2026
@BigLep

BigLep commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

I updated the PR title and description to match what the PR now does (admin guide, README rewrite, Upgrade retired, SETUP and HOWTOS updates). I also pushed 1e8a748: it restores the reasoning for the three environments in docs/INFRA_ADMIN.md and uses the naming history in the README FAQ.

- Define "GitHub settings" and "Terraform state" and use them instead of the ambiguous "organization".
- Link workflow and environment names throughout.
- Explain the settings Terraform ignores, why members and repositories can't be removed through github-mgmt, and why member removal still starts with a PR.
- Make a full Sync the single state rebuild path and say "don't merge PRs" instead of "pause merges".
- Store the bootstrap state in the bucket under bootstrap/terraform.tfstate instead of 1Password.
- Link the filecoin-project admin guide.
@BigLep

BigLep commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

@beck-8 I pushed 27054a8 with my review changes. One of them moves the bootstrap Terraform state from 1Password into S3: terraform/bootstrap/aws.tf now has an S3 backend (same bucket, key bootstrap/terraform.tfstate, S3 lock files), and docs/INFRA_ADMIN.md and docs/SETUP.md say the state lives there. It has nothing secret in it, and the workflow roles can't access that key (their policies only allow the org/FilOzone state keys), so keeping it with the rest of the state is simpler than 1Password.

I updated the docs assuming you'll migrate your local state before this merges. Until then the key is empty, and anyone running the bootstrap would get a plan to create resources that already exist. With your local terraform.tfstate in terraform/bootstrap/ and your MFA-backed AWS session:

terraform -chdir=terraform/bootstrap init -migrate-state
terraform -chdir=terraform/bootstrap plan   # expect: No changes

Then please confirm here that the plan shows no changes, and delete the 1Password share and your local copy.

- Sync reads the current state first, so a corrupt state needs its last good S3 version restored (or the object deleted) before rebuilding.
- Give the full first-time bootstrap sequence (local apply, then -migrate-state).
- Sync leaves ignored settings out of the YAML rather than recording them; name the four allow-merge toggles and branch protections.
- Describe the workflow roles' actual state-object scope.
- Restore the per-job qualifiers in the environments table's AWS column.
- The write environment is limited to master; review is what controls master.
- Update the App key UI label and point HOWTOS to the single Sync procedure.

@BigLep BigLep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I made and pushed some changes. This is shippable to me, but feel free to review and make any last changes you suggest.

I assume you'll then copy over anything to filecoin-project.

Thanks for doing this!

@github-project-automation github-project-automation Bot moved this from ⌨️ In Progress to ✔️ Approved by reviewer in FOC Dec 3, 2026
@beck-8

beck-8 commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Thank you very much for your feedback; storing it in S3 is indeed a better solution. I have verified this here, and it meets expectations.
image

@beck-8

beck-8 commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

I also pushed 1290feb with two small documentation updates. SETUP.md clarifies how to verify the migration from a clean checkout, and INFRA_ADMIN.md clarifies how to recover the organization state and the bootstrap state.

@beck-8
beck-8 merged commit 05a90aa into master Dec 3, 2026
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Dec 3, 2026
@beck-8
beck-8 deleted the beck-8/filozone-runbook branch December 3, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

2 participants