Skip to content

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

Open
AbhishekAg wants to merge 2 commits intogoogle:masterfrom
AbhishekAg:feat/copilot-coding-agent-and-content-exclusion
Open

feat: Add Copilot coding agent and content exclusion org endpoints#4176
AbhishekAg wants to merge 2 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 (daaa203) to head (7dcd064).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4176      +/-   ##
==========================================
- Coverage   93.69%   93.20%   -0.49%     
==========================================
  Files         210      210              
  Lines       19706    24627    +4921     
==========================================
+ Hits        18463    22953    +4490     
- Misses       1047     1478     +431     
  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.

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

Labels

NeedsReview PR is awaiting a review before merging.

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