feat(multi-env): add multi-environment deployment support#71
Draft
feat(multi-env): add multi-environment deployment support#71
Conversation
There was a problem hiding this comment.
Pull request overview
Adds multi-environment deployment support so separate SchemaBot instances can own different environments, publish environment-scoped aggregate checks, and coordinate prior-environment enforcement across instances.
Changes:
- Added
allowed_environmentsconfig support and documentation for multi-instance deployments. - Filtered webhook command handling and multi-env planning to only process environments owned by the current instance.
- Added GitHub-check-based prior-environment verification and environment-scoped aggregate check naming/tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/webhook/plan.go |
Filters multi-environment plan execution to this instance’s allowed environments. |
pkg/webhook/issue_comment.go |
Skips env-targeted commands that belong to another instance. |
pkg/webhook/check_runs.go |
Adds per-environment aggregate names and remote prior-environment checks. |
pkg/webhook/check_runs_test.go |
Adds unit tests for new check-run and environment-filtering helpers. |
pkg/github/client.go |
Adds helper to find a check run by name on a commit. |
pkg/api/config.go |
Introduces allowed_environments config and lookup helper. |
pkg/api/config_test.go |
Tests new config behavior and YAML deserialization. |
docs/configuration.md |
Documents multi-environment deployment setup and behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Support running separate SchemaBot instances per environment (e.g., staging and production on isolated infrastructure). Each instance handles a subset of environments with its own GitHub App and database. Key features: - allowed_environments config scopes which environments an instance handles - Per-environment aggregate check runs: SchemaBot (staging), SchemaBot (production) - Config-driven prior-environment enforcement: owned environments checked via local DB, remote environments checked via GitHub Checks API (fail-closed) - respond_to_unscoped config controls which instance responds to help and invalid commands (prevents duplicates with multiple GitHub Apps) - Eyes reaction fires only after routing decisions (avoids duplicate reactions) - Environment filtering in webhook handlers — non-allowed environments silently skipped Fully backwards compatible — single-deployment mode unchanged when allowed_environments is not set. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two self-contained deployments for testing multi-instance SchemaBot: - deploy/aws-multi-env/staging/ — staging-only instance - deploy/aws-multi-env/production/ — production-only instance Each creates its own App Runner, RDS, secrets, and bastion. Different subnet CIDRs allow same-account deployment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace duplicated ~800-line main.tf in each environment with a shared module (~800 lines, one copy) and thin wrappers (~100 lines each). Move scripts to a shared directory. Structure: modules/schemabot/ — all resources parameterized by environment staging/main.tf — module call with staging vars production/main.tf — module call with production vars scripts/ — shared scripts (one copy) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d scripts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for running separate SchemaBot instances per environment (e.g., staging and production on isolated infrastructure). Each instance handles a subset of environments with its own GitHub App and database.
allowed_environmentsconfig field scopes which environments an instance handlesSchemaBot (staging),SchemaBot (production)allowed_environmentsis not setThe production instance enforces "staging before production" by checking GitHub for the
SchemaBot (staging)check run from the staging instance — no cross-environment networking needed.🤖 Generated with Claude Code