feat: add GitHub environments support with deployment policies#3
Open
ljuboops257 wants to merge 27 commits intogcss-1135--add-environment-with-deployment-policyfrom
Open
feat: add GitHub environments support with deployment policies#3ljuboops257 wants to merge 27 commits intogcss-1135--add-environment-with-deployment-policyfrom
ljuboops257 wants to merge 27 commits intogcss-1135--add-environment-with-deployment-policyfrom
Conversation
DEVELOPERS_GUIDE.md should only document YAML config fields. Removed import control references from the environments entry as requested in PR review.
Replace Config.Features map[string]bool (yaml inline) with a typed *Features struct so import-config.yaml is strictly deserialised. Remove IsFeatureEnabled() method and FeatureGithubEnvironment constant. Call sites in github.go use direct field access with nil guard. YAML format changes from root-level key to features.github_environments.
refactor: move environments from vendored module to root module
…pos independently
ListEnvironments non-404 errors and GetEnvironment errors now propagate as import failures instead of being silently swallowed. 404 (no environments) is still treated as a normal no-op and does not fail the import.
Change signature from []Environment to ([]Environment, error) so errors from org info lookup and other internal calls propagate to the caller instead of being silently dropped. Call site extracts the result before the Repository struct literal and fails the import on error.
Add default case to the reviewer type switch in resolveEnvironments. Unknown types (e.g. GitHub added a new type, or JSON was tampered with) now fail the import with an explicit error instead of being silently ignored.
GitHub enforces a maximum of 6 reviewers per environment across users and teams combined. Add an explicit check after collecting reviewers from ProtectionRules and fail the import with a clear error if the limit is exceeded.
…r2549533810) Replace repeated 'cfg != nil && cfg.Features != nil && cfg.Features.GithubEnvironments' expressions with a single nil-safe isEnvEnabled(cfg) helper function.
…689325, r2549594557) Reviewers are always in env.ProtectionRules in the GitHub API response. The env.Reviewers top-level field was never observed to be set, so the fallback path that resolved reviewer IDs to names via separate API calls was dead code. Removing it also eliminates the now-unnecessary org info lookup that only existed to support team ID resolution in that block.
…5677) Reviewer: content should live in the config template repo's repository.yaml.example, not in a standalone doc here. Remove the file and the link to it from DEVELOPERS_GUIDE.md.
Reviewer: this file shouldn't be part of the environments PR. Will be revisited in a separate docs-focused PR after discussion on purpose and scope.
… r2549698626) Add else clause to the ProtectedBranches/CustomBranchPolicies check in resolveEnvironments. If neither field is set the API response is unexpected (GitHub API change or tampered JSON) — fail the import with an explicit error rather than silently producing an environment with no deployment policy.
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.
What
Full GitHub Environments support with deployment policies, moved to the root Terraform module. Includes a feature flag refactor as prerequisite.
Commits by area
Feature flag refactor
Terraform: environments moved to root module (vendored module untouched)
Importer error handling (reviewer feedback)
Code quality (reviewer feedback)
Docs cleanup (reviewer feedback)
Known limitations
github_repository_environment_deployment_policy— "inconsistent result after apply" on v6.9.0-gr.3. Under investigation.