copilot-metrics-viewer icon indicating copy to clipboard operation
copilot-metrics-viewer copied to clipboard

Possible to extend this viewer to Copilot chat as a copilot extensions?

Open DevOps-zhuang opened this issue 1 year ago • 1 comments

One concern is about the priviledge. currently, only org admin can fetch metrics data from Github API. and we want every user in the org can view its org's metrics from chat .

based on [https://docs.github.com/en/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github#fetching-resources-from-the-github-api]

Requests to your Copilot agent will receive an X-Github-Token header. This header contains an API token that can be used to fetch resources from the GitHub API on behalf of the user interacting with your agent. The permissions of this token are the overlap of the user's own permissions and the permissions granted to your GitHub App installation.

DevOps-zhuang avatar Dec 13 '24 03:12 DevOps-zhuang

the way I understand it, overlap means - if user has permission to view metrics, and that's the permission API was registered with - you can request that scope.

If a user doesn't have access to manage copilot, but app registration requested that scope - the on behalf of call is going to fail.

karpikpl avatar Jan 04 '25 04:01 karpikpl