Add GitHub Copilot metrics dashboa autoCorrect AI dashboard#2
Conversation
Update README text and example code
Signed-off-by: ko-zu <causeless@gmail.com>
Agent-Logs-Url: https://github.com/DewDropstempest/psl/sessions/2e03a6fc-9a19-48f1-b069-17d77020600f Co-authored-by: DewDropstempest <123912597+DewDropstempest@users.noreply.github.com>
…he functionality of our application. By adding new scenarios and refactoring existing ones, we can ensure that the code remains robust and reliable. It is important to regularly review and enhance our test suite as the application evolves to catch potential bugs early in the development process.
Agent-Logs-Url: https://github.com/DewDropstempest/psl/sessions/544777bc-a666-4096-ba06-15835e5b4a1c Co-authored-by: DewDropstempest <123912597+DewDropstempest@users.noreply.github.com>
Agent-Logs-Url: https://github.com/DewDropstempest/psl/sessions/589aff3d-5c78-47b9-b37b-ede03411ce14 Co-authored-by: DewDropstempest <123912597+DewDropstempest@users.noreply.github.com>
DewDropstempest
left a comment
There was a problem hiding this comment.
- Repo copilot metrics status bar test developer admin
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9288a38f7f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| token = os.environ["COPILOT_METRICS_TOKEN"] | ||
| org = os.environ["ORG"] | ||
|
|
||
| url = f"https://api.github.com/orgs/{org}/copilot/usage" |
There was a problem hiding this comment.
Use supported Copilot metrics API route
The workflow calls https://api.github.com/orgs/{org}/copilot/usage, but GitHub’s Copilot metrics endpoints changed and the legacy set was shut down on April 2, 2026; organization usage data is now retrieved through /orgs/{org}/copilot/metrics/reports/.... In this job, a non-200 response triggers SystemExit, so the scheduled run never writes new data and the dashboard remains stale/empty.
Useful? React with 👍 / 👎.
| entry["total_suggestions_count"] = cc.get("total_suggestions_count", 0) | ||
| entry["total_acceptances_count"] = cc.get("total_acceptances_count", 0) | ||
| entry["total_lines_suggested"] = cc.get("total_lines_suggested", 0) | ||
| entry["total_lines_accepted"] = cc.get("total_lines_accepted", 0) |
There was a problem hiding this comment.
Map v2 completion counters from correct fields
In the copilot_ide_code_completions branch, the code reads total_*_count keys directly from cc, but the v2 path described in the comments stores metrics under nested totals (or deeper structures), so these lookups fall back to 0. When v2 payloads are returned, suggestions/acceptances/line KPIs and charts will be silently underreported as zero.
Useful? React with 👍 / 👎.
|
This self-hosted Copilot usage dashboard automatically fetches org-level metrics from the GitHub API daily through a scheduled GitHub Actions workflow and commits the data. A static HTML dashboard visualizes this information. New files
Manual setup requirementsA secret must be added by a repo or org admin before the workflow can operate:
Deploy the dashboard on GitHub Pages by setting the source to |
Check SSH status and prepare for pushssh -T git@github.com def init_omni_bridge(): if name == "main": In: /.gemini/commands/changelog.tomlInvoked via: /changelog 1.2.0 added "Support for default argument parsing."description = "Adds a new entry to the project's CHANGELOG.md file." Task: Update ChangelogYou are an expert maintainer of this software project. A user has invoked a command to add a new entry to the changelog. The user's raw command is appended below your instructions. Your task is to parse the Expected FormatThe command follows this format:
Behavior
|
This update introduces a self-hosted Copilot usage dashboard. A scheduled GitHub Actions workflow retrieves organizational metrics from the GitHub API daily and commits the data, which is then visualized via a static HTML dashboard.
New Files:
.github/workflows/copilot-metrics.yml— Executes daily at 06:00 UTC via cron, with manual execution possible throughworkflow_dispatch. It calls theGET /orgs/DewDropstempest/copilot/usageendpoint, normalizes the response formats from both v1 and v2 APIs, writes the data tocopilot-dashboard/data/metrics.json, and automatically commits changes if any data updates occur ([skip ci]).copilot-dashboard/index.html— A dark-themed static dashboard utilizing Chart.js via CDN. It displays five key performance indicator cards and four line charts covering active users, suggestions versus acceptances, acceptance rate percentage, and lines suggested versus accepted. The dashboard gracefully handles cases with no data.copilot-dashboard/data/metrics.json— An initial empty array seed file, populated automatically by the workflow.copilot-dashboard/README.md— A setup guide detailing Personal Access Token (PAT) creation, repository secret configuration (COPILOT_METRICS_TOKEN), manual workflow trigger procedures, and optional deployment to GitHub Pages.Manual Configuration Requirements:
An administrator of the repository or organization must add a secret before the workflow can be executed:
COPILOT_METRICS_TOKENmanage_billing: copilotpermission.The dashboard can be served via GitHub Pages by configuring the source directory to
/copilot-dashboardon the relevant branch.