Skip to content

feat!: Add Copilot content exclusion set and enterprise endpoints - #4527

Open
Tens1des wants to merge 2 commits into
google:masterfrom
Tens1des:feat/copilot-content-exclusion-apis
Open

feat!: Add Copilot content exclusion set and enterprise endpoints#4527
Tens1des wants to merge 2 commits into
google:masterfrom
Tens1des:feat/copilot-content-exclusion-apis

Conversation

@Tens1des

@Tens1des Tens1des commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: CopilotOrganizationContentExclusionDetails is now CopilotContentExclusionDetails.

Summary

  • Add organization/enterprise set and enterprise get for Copilot content exclusion
  • Share a common CopilotContentExclusionDetails type

Fixes #4526

Test plan

  • go test ./github/ -run ContentExclusion
  • ./script/fmt.sh and ./script/generate.sh
  • Breaking: rename CopilotOrganizationContentExclusionDetailsCopilotContentExclusionDetails

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Sep 7, 2026
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.53%. Comparing base (3a439fa) to head (2da94fd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4527   +/-   ##
=======================================
  Coverage   98.53%   98.53%           
=======================================
  Files         195      195           
  Lines       17848    17875   +27     
=======================================
+ Hits        17587    17614   +27     
  Misses        261      261           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread github/copilot.go Outdated

// CopilotOrganizationContentExclusionDetails is an alias for organization-scoped
// content exclusion rules. Prefer CopilotContentExclusionDetails for new code.
type CopilotOrganizationContentExclusionDetails = CopilotContentExclusionDetails

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need two types representing the same thing?
Are you doing this just to prevent a breaking API change?

I'm fine with breaking (and documenting) the API change and just use the same renamed type for both.

Thoughts?

cc: @stevehipwell - @alexandear - @Not-Dhananjay-Mishra

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the alias was only to avoid a breaking rename. Dropped it and kept a single CopilotContentExclusionDetails type, with a NOTE Breaking API change in the docs. Also updating the PR title to feat!:.

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.

Please remove the NOTE for consistency with other breaking changes. We provide info about breaking changes in a PR's description.

Remove CopilotOrganizationContentExclusionDetails alias and keep a
single CopilotContentExclusionDetails type, as requested in review.
@Tens1des Tens1des changed the title feat: Add Copilot content exclusion set and enterprise endpoints feat!: Add Copilot content exclusion set and enterprise endpoints Sep 7, 2026
@gmlewis gmlewis added the Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). label Sep 7, 2026

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @Tens1des!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @Not-Dhananjay-Mishra

Comment thread github/copilot.go
Comment on lines +396 to +397
//
// NOTE Breaking API change: renamed from CopilotOrganizationContentExclusionDetails.

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 is not needed:

Suggested change
//
// NOTE Breaking API change: renamed from CopilotOrganizationContentExclusionDetails.

Comment thread github/copilot.go
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-content-exclusion-management?apiVersion=2022-11-28#set-copilot-content-exclusion-rules-for-an-organization
//
//meta:operation PUT /orgs/{org}/copilot/content_exclusion
func (s *CopilotService) SetOrganizationContentExclusionDetails(ctx context.Context, org string, body CopilotContentExclusionDetails) (*CopilotContentExclusionUpdateResponse, *Response, error) {

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.

Suggested change
func (s *CopilotService) SetOrganizationContentExclusionDetails(ctx context.Context, org string, body CopilotContentExclusionDetails) (*CopilotContentExclusionUpdateResponse, *Response, error) {
func (s *CopilotService) SetOrganizationContentExclusionDetails(ctx context.Context, org string, body CopilotSetContentExclusionDetailsRequest) (*CopilotSetContentExclusionResponse, *Response, error) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Copilot content exclusion set/get enterprise and org set endpoints

3 participants