Add multi-organization scope support with metrics aggregation and user deduplication + Champions page
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:
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
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?
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.
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);
Any update on this PR?