Prompt
I'm building a new dev/prod workflow and want infrastructure changes reviewed in Git
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
A good default pattern is: make infrastructure changes in code, review them in Git, and promote the same artifact through environments.
Recommended workflow
-
Infra as Code
- Store all infra definitions in Git:
- Terraform / OpenTofu
- CloudFormation / CDK
- Pulumi
- Kubernetes manifests / Helm / Kustomize
- Treat config, policy, and deployment scripts the same way.
- Store all infra definitions in Git:
-
Branch-based changes
- Create a feature branch for infra changes.
- Open a PR/MR for review before anything applies to shared environments.
-
Automated plan/diff in CI
- On every PR:
- run format/lint
- validate syntax
- generate a plan/diff
- post the output back to the PR
- This lets reviewers see exactly what will change.
- On every PR:
-
Approval gates
- Require approvals from appropriate reviewers:
- platform/SRE
- app team owner
- security/compliance if needed
- Use CODEOWNERS for automatic routing.
- Require approvals from appropriate reviewers:
-
Separate dev and prod promotion
- Merge to a
devormainbranch first and apply to non-prod automatically. - Promote the exact same commit/artifact to prod after checks and approval.
- Avoid manual edits directly in prod.
- Merge to a
-
State and secrets management
- Keep state isolated per environment.
- Store secrets in a secret manager, not in Git.
- Lock down prod state and apply permissions.
-
Drift detection
- Periodically compare live infra to Git.
- Alert on drift and require reconciliation through PRs.
A simple implementation pattern
main= desired state- PR opened for infra changes
- CI runs
plan - reviewers approve
- merge triggers apply to dev
- manual approval triggers apply to prod
Best practices
- Enforce formatting and policy checks in CI
- Use ephemeral preview environments if possible
- Add policy-as-code checks like OPA/Conftest, Sentinel, or equivalent
- Keep prod changes small and incremental
- Require change logs or release notes for higher-risk infra
If you want the shortest answer
Use Infrastructure as Code + Git PRs + CI-generated plan diffs + approval gates + staged promotion from dev to prod.
If you want, I can also sketch a concrete workflow for Terraform, Kubernetes/Helm, or AWS CDK.