Skip to content

feat: Add Copilot coding agent and content exclusion org endpoints#4176

Merged
gmlewis merged 3 commits intogoogle:masterfrom
AbhishekAg:feat/copilot-coding-agent-and-content-exclusion
Apr 23, 2026
Merged

feat: Add Copilot coding agent and content exclusion org endpoints#4176
gmlewis merged 3 commits intogoogle:masterfrom
AbhishekAg:feat/copilot-coding-agent-and-content-exclusion

Conversation

@AbhishekAg
Copy link
Copy Markdown
Contributor

Implement support for two Copilot organization management endpoints under the CopilotService.

  • Add ListCopilotCodingAgentRepositories for GET /orgs/{org}/copilot/coding-agent/permissions/repositories.
  • Add GetCopilotOrganizationContentExclusionDetails for GET /orgs/{org}/copilot/content_exclusion.
  • Add tests covering both endpoints, JSON round-trip tests for the new types, and regenerate accessors and iterators.

API docs:

Fixes: #4175

Implement support for two Copilot organization management endpoints
under the CopilotService.

- Add ListCopilotCodingAgentRepositories for
  GET /orgs/{org}/copilot/coding-agent/permissions/repositories.
- Add GetCopilotOrganizationContentExclusionDetails for
  GET /orgs/{org}/copilot/content_exclusion.
- Add tests covering both endpoints, JSON round-trip tests for the
  new types, and regenerate accessors and iterators.

API docs:
- https://docs.github.com/rest/copilot/copilot-coding-agent-management#list-repositories-enabled-for-copilot-coding-agent-in-an-organization
- https://docs.github.com/rest/copilot/copilot-content-exclusion-management#get-copilot-content-exclusion-rules-for-an-organization

Fixes: google#4175
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.20%. Comparing base (3430163) to head (8474194).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4176      +/-   ##
==========================================
+ Coverage   93.18%   93.20%   +0.01%     
==========================================
  Files         210      210              
  Lines       24568    24622      +54     
==========================================
+ Hits        22894    22948      +54     
  Misses       1478     1478              
  Partials      196      196              

☔ View full report in Codecov by Sentry.
📢 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.

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Apr 21, 2026
Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

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

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

Comment thread github/copilot.go Outdated
Comment thread github/copilot.go Outdated
Signed-off-by: abhishek <abhishek@exaforce.com>
@AbhishekAg AbhishekAg requested a review from alexandear April 22, 2026 09:38
@AbhishekAg
Copy link
Copy Markdown
Contributor Author

The uncovered block at github/copilot.go:L233-L236 flagged by Codecov is the pre-existing json.Marshal error branch in CopilotSeatDetails.UnmarshalJSON.It's an unreachable branch: the input is a map[string]any that was just populated by json.Unmarshal, so it's guaranteed marshalable.

This PR's own additions are at 100% coverage (go test ./github/ -coverprofile shows no uncovered blocks in the new code).

@gmlewis Please override the Codecov check.
I am happy to open the small PR to clean-up the dead code.

@AbhishekAg
Copy link
Copy Markdown
Contributor Author

@alexandear Could you please check the PR again, if anything unanswered?
@gmlewis If possible can you please override the CodeCov report. After this Merge I will open the new PR to clean-up the preexisting dead code in Copilot.go

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Apr 23, 2026
@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Apr 23, 2026

@gmlewis If possible can you please override the CodeCov report. After this Merge I will open the new PR to clean-up the preexisting dead code in Copilot.go

@AbhishekAg - it is not possible to "override" the Codecov report, but it is possible to simply ignore it and squash-and-merge anyway, which is what we will be doing.

Thank you, @AbhishekAg and @alexandear!

Merging.

@gmlewis gmlewis merged commit 0f881f5 into google:master Apr 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Copilot coding agent and content exclusion management APIs

3 participants