Switch Copilot changelog monitor to GitHub Models workflow, align team-metrics docs with Direct API support, and implement team-metrics fallback strategy#375
Conversation
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/3e188959-4e61-4f2f-8e06-d00346c29fd9 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/3e188959-4e61-4f2f-8e06-d00346c29fd9 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/3e188959-4e61-4f2f-8e06-d00346c29fd9 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
| @@ -0,0 +1,134 @@ | |||
| import { resolve } from 'node:path'; | |||
There was a problem hiding this comment.
I thought we can achieve it using running an agent in CI CD - is there a way to run agent from workflows?
because this is non-deterministic, agent should go to blog, read announcements and decide what to do.
There was a problem hiding this comment.
Good question. For this scheduled check, I kept a deterministic workflow/script path (commit 553b136) because there isn’t a stable first-class “run Copilot agent in Actions and auto-decide” pattern we can rely on here without introducing external LLM orchestration, extra secrets, and nondeterministic issue noise. If you want, I can add an opt-in workflow_dispatch experimental job that calls a model for triage while keeping the current deterministic daily guardrail.
There was a problem hiding this comment.
@copilot I think the deterministic doesn't make sense, I'd rather use github models. Is there a workflow permission that would allow it, or I need a PAT with that access?
There was a problem hiding this comment.
You can start with ${{ github.token }} (no PAT) for a workflow calling GitHub Models, as long as the job has the needed permission (typically models: read, plus any repo scopes like contents: read / issues: write you use). If org/repo policy denies model access for GITHUB_TOKEN, then use a fine-grained PAT secret with models:read. In this repo, the Models path is already validated against models:read tokens (current head: f335546). No UI changes here, so no screenshot is applicable.
There was a problem hiding this comment.
@copilot so make the change, remove files from deterministic flow, add a workflow that uses LLM to do it
There was a problem hiding this comment.
Implemented in 0374913: removed the deterministic changelog monitor files and switched to an LLM-based workflow using GitHub Models (models: read permission) to analyze the changelog feed and open deduplicated issues. Also added bounded issue pagination and stricter model-output parsing/validation. No UI changes were made in this update, so screenshot is N/A.
| 1. Downloading per-user daily metrics from the organization/enterprise endpoint | ||
| 2. Resolving team membership via the GitHub Teams API | ||
| 3. Filtering and aggregating per-user data in-memory for each team | ||
| This application computes team metrics by combining Copilot usage report data with team membership data, then aggregating results for the selected team. |
There was a problem hiding this comment.
this is wrong, I don't need this analysis as part of the Deployment.md - that should be part of the PR - comment so I can decide which route to go.
support for teams smaller than 5 people.
comparing teams
is it going to work with all team types? enterprise teams?
for those requests, should we try teams API first (depending on date rage), fallback to direct user calls if data is not there?
Make sure that with historical mode, user data is saved so we can query any team, any user for any data in the past
There was a problem hiding this comment.
Done — I removed that analysis block from DEPLOYMENT.md in commit f335546.
Recommended route for implementation:
- Support teams <5: keep fallback to Teams API + user-day usage aggregation, because
user-teams-1-daycan omit small teams. - Team comparison: yes, still works if both compared teams are materialized through the same fallback-aware membership resolution.
- Team types: org teams are straightforward; enterprise teams should work when membership resolution handles enterprise endpoints and org overrides consistently.
- Fetch order: for direct mode, try team report mapping first for the requested range, then fallback to Teams API membership + user-day report when team mapping is missing/incomplete.
- Historical mode: keep persisting raw user-day records on sync so any team/user can be recomputed for any past date range later.
There was a problem hiding this comment.
Implemented in commit 3c482e4: team-scoped metrics now try native team report data first, then fall back to team-membership + user-day aggregation when team report data is empty/unavailable (covers small/incomplete team mappings). Added regression tests for direct-mode preference and fallback behavior. No UI changes in this commit, so screenshot is N/A.
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/23104ef2-7212-48db-bcd2-d3c1e91089dd Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/63c9a2c3-cc9f-4f0e-a53c-e4b403b30cb8 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/872c8a0e-b40a-4951-a384-9a4a5725e343 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/872c8a0e-b40a-4951-a384-9a4a5725e343 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/872c8a0e-b40a-4951-a384-9a4a5725e343 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/872c8a0e-b40a-4951-a384-9a4a5725e343 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github-copilot-resources/copilot-metrics-viewer/sessions/872c8a0e-b40a-4951-a384-9a4a5725e343 Co-authored-by: karpikpl <3539908+karpikpl@users.noreply.github.com>
🚀 Preview Deployment ReadyPreview URL: https://cmv-app.happyground-1e6ee49e.eastus2.azurecontainerapps.io Deployed: PR #375 | 528d833 | 2026-05-27T04:44:34Z
|
GitHub now exposes team-level Copilot metrics inputs via API, and this repo now supports a fallback-aware team metrics strategy in both Direct API and historical modes. This PR updates automation, docs, and team metrics resolution behavior to reflect that reality.
Changelog monitoring automation (LLM-based)
.github/workflows/copilot-metrics-changelog-monitor.yml.github/scripts/copilot-changelog-monitor.mjstests/copilot-changelog-monitor.spec.tsmodels: readpermissionDocs: remove outdated “team view requires DB mode” guidance
README.mdoperating mode matrix and explanatory text to state that team-scoped views are available in Direct API mode (rolling window).DEPLOYMENT.mdarchitecture and Docker Compose guidance with current behavior.DEPLOYMENT.mdto keep deployment docs focused.Team metrics implementation updates (from review feedback)
team_slugwhen requesting aggregate reports.Regression coverage
tests/metrics-util-v2-team-path.spec.tsExample workflow step introduced: