Skip to content

Conversation

@YoavLax
Copy link

@YoavLax YoavLax commented Oct 23, 2025

This PR introduces support for aggregating GitHub Copilot metrics across multiple organizations, enabling unified visibility and analysis of Copilot usage for teams working across organizational boundaries.

🆕 New Features
Multi-Organization Scope: Added new multi-organization scope type to fetch and aggregate metrics from multiple GitHub organizations simultaneously
Environment Configuration: Introduced NUXT_PUBLIC_GITHUB_ORGS environment variable for comma-separated organization list configuration
Parallel Data Fetching: Implemented concurrent API calls to multiple organizations with intelligent caching per organization

📊 Data Aggregation & Deduplication
Metrics Aggregation: Created aggregateMetricsByDate() function to merge metrics across organizations by date
Smart User Counting: Uses MAX aggregation for total_active_users instead of SUM to prevent double-counting users who are active in multiple organizations
Seats Deduplication: Implemented deduplicateSeats() to merge seat assignments across organizations, keeping the most recent activity per user
Teams Organization Tracking: Extended team data to track which organization each team belongs to, enabling proper team comparisons across orgs

Example configuration:
image

Technical Highlights
Maintains backward compatibility with existing single-organization scope
Preserves per-organization caching for optimal performance
Conservative user counting approach (MAX vs SUM) ensures accurate metrics without inflation
Fully type-safe TypeScript implementation with updated serialization methods

ylax1 added 6 commits October 23, 2025 21:43
…dpoint

Update AgentModeViewer labels, tooltips and table headers from "Total Users with Activity" to "Average Daily Users with Activity" and clarify tooltip text. Calculate daily averages in server/api/github-stats.ts for overall user totals and per-model totals (divide summed counts by number of days) so UI and API consistently report average daily engaged users.
- Add new ChampionsViewer.vue providing a Top 5 Teams card and an All Teams leaderboard
  with search, sorting, team detail links and visual rank badges.
- Load teams and per-team metrics, compute average acceptance rate and weekday avg active users,
  and support multi-organization display names.
- Integrate component into MainComponent: import ChampionsViewer, add 'champions' tab and
  render the viewer in the v-window.
…umulative totals for acceptance rate

- Add Total Suggestions and Total Acceptances columns to ChampionsViewer table (with icons and locale-formatted counts)
- Include totalSuggestions/totalAcceptances in TeamWithMetrics and populate when loading team metrics
- Change acceptance rate calculation in ChampionsViewer to use cumulative totals (total_acceptances / total_suggestions) and return totals from loadMetricsForTeam
- Update TeamsComponent average acceptance rate computation to use cumulative totals per team (consistent with MetricsViewer)
@YoavLax YoavLax changed the title Add multi-organization scope support with metrics aggregation and user deduplication Add multi-organization scope support with metrics aggregation and user deduplication + Champions page Oct 26, 2025
@karpikpl
Copy link
Collaborator

would it be possible just to re-use NUXT_PUBLIC_GITHUB_ORG and do multi-orgs when field has comma separated list?

getting metrics on enterprise level doesn't already provide org aggregated metrics?

…ted)

- Update README to document NUXT_PUBLIC_GITHUB_ORG as single or comma-separated list and remove references to NUXT_PUBLIC_GITHUB_ORGS
- Parse comma-separated githubOrg in Options runtime config to populate githubOrgs and enable multi-organization scope
- Remove githubOrgs runtime config entry from nuxt.config.ts (use githubOrg for both single and multi-org)
- Update getDisplayName to derive org list from githubOrg for multi-organization scope
@YoavLax
Copy link
Author

YoavLax commented Oct 27, 2025

Hi @karpikpl , i've consolidated and updated the NUXT_PUBLIC_GITHUB_ORG to support multi-orgs when field has comma separated list.
Enterprise level provides the aggregation for all organization, and in some cases you would want only specific ones.
Also, i added a CHAMPIONS page where you have comparison between the teams from all orgs.

@lvthillo
Copy link
Contributor

It might not be part of this PR, but it would be very useful if the list of organizations could also be retrieved dynamically within GitHub Enterprise, for example via listInstallations of a GitHub app. So, installing the app on an organization would make this organization available within the metrics viewer.

const installations = await octokit.paginate(octokit.rest.apps.listInstallations);

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.

4 participants