Skip to content

feat: Add support for getting Copilot cloud agent configuration#4241

Open
maishivamhoo123 wants to merge 11 commits into
google:masterfrom
maishivamhoo123:feat/copilot-cloud-agent-configuration
Open

feat: Add support for getting Copilot cloud agent configuration#4241
maishivamhoo123 wants to merge 11 commits into
google:masterfrom
maishivamhoo123:feat/copilot-cloud-agent-configuration

Conversation

@maishivamhoo123
Copy link
Copy Markdown
Contributor

Description

Add support for getting Copilot cloud agent configuration via the GitHub REST API.

Changes

  • Added CopilotCloudAgentConfiguration struct to handle the API response
  • Added EnabledTools struct for tool configuration details
  • Implemented GetCopilotCloudAgentConfiguration method in CopilotService
  • Fixed McpConfiguration field to use *json.RawMessage for proper null handling

Related Issue

Closes #4239

Testing

All existing tests pass and new unit tests validate the functionality.

Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Comment thread openapi_operations.yaml
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.48%. Comparing base (c207b27) to head (6aa11a5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4241   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files         190      191    +1     
  Lines       19178    19188   +10     
=======================================
+ Hits        18695    18705   +10     
  Misses        268      268           
  Partials      215      215           

☔ 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.

@maishivamhoo123 maishivamhoo123 force-pushed the feat/copilot-cloud-agent-configuration branch from 59ab5d7 to 4420993 Compare May 21, 2026 03:23
@gmlewis gmlewis changed the title feat: add support for getting Copilot cloud agent configuration feat: Add support for getting Copilot cloud agent configuration May 21, 2026
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label May 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, @maishivamhoo123!
A couple minor tweaks, please, then we should be ready for any other contributor to this repo to provide a second LGTM+Approval before merging.

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

Comment thread github/copilot_cloud_agent.go Outdated
Comment thread github/copilot_cloud_agent.go Outdated
Comment thread github/copilot_cloud_agent.go
@maishivamhoo123 maishivamhoo123 requested a review from gmlewis May 21, 2026 15:20
Comment thread github/copilot_cloud_agent.go Outdated
Comment thread github/copilot_cloud_agent.go
Comment thread github/copilot_cloud_agent.go Outdated
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Comment thread github/copilot_cloud_agent.go Outdated
Comment thread github/copilot_cloud_agent.go Outdated
Comment thread github/copilot_cloud_agent.go Outdated
Comment thread github/copilot_cloud_agent.go Outdated
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Comment thread github/copilot_cloud_agent.go
Comment thread github/copilot_cloud_agent.go
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Comment thread github/copilot_cloud_agent.go Outdated
Comment thread github/copilot_cloud_agent.go
Comment thread github/copilot_cloud_agent_test.go Outdated
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
@maishivamhoo123
Copy link
Copy Markdown
Contributor Author

@gmlewis, @alexandear, @Not-Dhananjay-Mishra I’ve made all the recommended changes and addressed the review comments.
Could you please take another look at this PR ?

Thank you!

Copy link
Copy Markdown
Contributor

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label May 26, 2026

// CopilotCloudAgentConfiguration represents the Copilot cloud agent configuration for a repository.
type CopilotCloudAgentConfiguration struct {
McpConfiguration *json.RawMessage `json:"mcp_configuration"`
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.

I apologize for not catching this sooner, but it looks like we need a new initialism ("MCP") to be added to line 424 of tools/structfield/structfield.go (in sorted order) and then update this line as well. Note that json.RawMessage is already a reference type (it is a byte slice) and there is no need for a pointer here.

So this line needs to be:

Suggested change
McpConfiguration *json.RawMessage `json:"mcp_configuration"`
MCPConfiguration json.RawMessage `json:"mcp_configuration"`

@maishivamhoo123
Copy link
Copy Markdown
Contributor Author

maishivamhoo123 commented May 26, 2026

image image
type CopilotCloudAgentConfiguration struct {
	MCPConfiguration                      json.RawMessage                `json:"mcp_configuration"`
	EnabledTools                          *CopilotCloudAgentEnabledTools `json:"enabled_tools"`
	RequireActionsWorkflowApproval        bool                           `json:"require_actions_workflow_approval"`
	IsFirewallEnabled                     bool                           `json:"is_firewall_enabled"`
	IsFirewallRecommendedAllowlistEnabled bool                           `json:"is_firewall_recommended_allowlist_enabled"`
	CustomAllowlist                       []string                       `json:"custom_allowlist"`
}

@gmlewis I made all the changes but it is still failing?

@maishivamhoo123 maishivamhoo123 requested a review from gmlewis May 26, 2026 12:22
@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented May 26, 2026

@gmlewis I made all the changes but it is still failing?

Ah, yes, you may need to delete the old linters in the bin subdirectory and then try again.

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 getting Copilot cloud agent configuration

4 participants