Skip to content

feat: Fixup repository environment logic#3162

Merged
stevehipwell merged 1 commit intointegrations:mainfrom
stevehipwell:fixup-repo-env
Feb 23, 2026
Merged

feat: Fixup repository environment logic#3162
stevehipwell merged 1 commit intointegrations:mainfrom
stevehipwell:fixup-repo-env

Conversation

@stevehipwell
Copy link
Copy Markdown
Collaborator

Resolves #ISSUE_NUMBER


Before the change?

  • github_repository_environment resource logic for reviewers had incorrect constraints
  • github_repository_environment_deployment_policy resource missing policy ID attribute

After the change?

  • github_repository_environment has correct constraints for reviewers, including validation for the sum of users and teams
  • github_repository_environment_deployment_policy has new policy_id attribute
  • Improved tests
  • Improved repository diff logic to support gradual adoption of repository_id

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@stevehipwell stevehipwell added this to the v6.12.0 Release milestone Feb 5, 2026
@stevehipwell stevehipwell self-assigned this Feb 5, 2026
@stevehipwell stevehipwell added the Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR label Feb 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 5, 2026

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

Comment thread github/resource_github_repository_environment.go
Comment thread github/resource_github_repository_environment.go Outdated
Comment thread github/resource_github_repository_environment_deployment_policy.go
Comment thread github/resource_github_repository_environment_deployment_policy.go
Comment thread github/util_check.go Outdated
Comment thread github/util_diff.go Outdated
@stevehipwell
Copy link
Copy Markdown
Collaborator Author

@deiga this is ready for a re-review. I've made the most of your testing improvements. I also have thoughts around the use of tflog.SetField(); in as much as we should use tflog.SetField(d.GetId()) by default and then not use it unless there is a specific reason to do so.

Comment thread github/resource_github_repository_environment.go Outdated
Comment thread github/resource_github_repository_environment_deployment_policy.go Outdated
Comment thread github/util_diff.go Outdated
Comment thread github/util_diff.go Outdated
@stevehipwell
Copy link
Copy Markdown
Collaborator Author

@deiga thanks for the tflog.SetField() correction. FYI there are still some instances of this pattern in the EMU group mapping resource.

@stevehipwell stevehipwell mentioned this pull request Feb 16, 2026
5 tasks
@stevehipwell stevehipwell force-pushed the fixup-repo-env branch 2 times, most recently from 7c8fb21 to ac4fdb7 Compare February 20, 2026 13:31
Copy link
Copy Markdown
Collaborator

@deiga deiga left a comment

Choose a reason for hiding this comment

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

Looking good!

Comment thread github/resource_github_repository_environment.go
Comment thread github/resource_github_repository_environment_deployment_policy.go Outdated
@stevehipwell stevehipwell force-pushed the fixup-repo-env branch 2 times, most recently from 11cfeca to a9e830f Compare February 20, 2026 13:53
Comment thread github/resource_github_repository_environment.go
@nickfloyd nickfloyd self-requested a review February 23, 2026 14:59
nickfloyd
nickfloyd previously approved these changes Feb 23, 2026
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
@stevehipwell stevehipwell merged commit d2d9d44 into integrations:main Feb 23, 2026
7 checks passed
@stevehipwell stevehipwell deleted the fixup-repo-env branch February 23, 2026 15:48
JiayangZhou pushed a commit to JiayangZhou/terraform-provider-github that referenced this pull request Apr 16, 2026
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants