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

Add multi teams support and update seat management tab to suppoft filter when clicking a card.

Open DevOps-zhuang opened this issue 9 months ago • 16 comments

1, add teams support like multi-team dashboards. 2, for seat managemnet, display more cards and when click a card, it will filter the data, only show filter data in below tables.

image image

This pull request introduces several changes to the project, focusing on adding support for multiple teams, improving error handling, and updating configurations. The most important changes include updates to environment variables, modifications to the Dockerfile, enhancements in API handling, and new components for multi-team metrics.

Environment Variable Updates:

  • .env: Updated VUE_APP_GITHUB_ORG to CopilotDemo and added VUE_APP_SHOW_MULTIPLE_TEAMS to support multiple teams. [1] [2]
  • README.md: Documented the new VUE_APP_SHOW_MULTIPLE_TEAMS environment variable.

Dockerfile Modifications:

  • Dockerfile: Changed the base image to node:22, added commands to update the caniuse-lite database, fix ESLint errors, and handle build errors.
  • Dockerfile: Added command to start the Nginx server.

API Enhancements:

  • src/api/GitHubApi.ts: Refactored API calls to handle multiple teams, added error handling, and improved the fetching of team metrics. [1] [2]

Component Updates for Multi-Team Support:

  • src/components/MainComponent.vue: Integrated a new MultiTeamsMetricsViewer component and updated logic to handle multiple teams. [1] [2] [3] [4] [5] [6]
  • src/components/MetricsViewer.vue: Combined data by day for better visualization and updated charts accordingly. [1] [2]

Minor Updates:

  • public/assets/app-config.js: Added VUE_APP_SHOW_MULTIPLE_TEAMS to the configuration.
  • src/App.vue: Updated footer text and version number. [1] [2]
  • src/api/MetricsToUsageConverter.ts: Commented out debug logs.

DevOps-zhuang avatar Mar 14 '25 08:03 DevOps-zhuang

I'll work on the merge

karpikpl avatar Mar 15 '25 02:03 karpikpl

Hi @DevOps-zhuang,

I was trying to use multi teams support which is implemented in this branch before it gets merged into the main branch. While attempting to build a Docker image using the code from this branch, I encountered the following error:

[nuxi]  ERROR  Nuxt Build Error: Could not resolve "../api/GitHubApi" from "app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts"
10.89 file: /app/app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts
10.89 
10.89     file: app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts
10.89     at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:396:41)
10.89     at error (node_modules/rollup/dist/es/shared/parseAst.js:392:42)
10.89     at ModuleLoader.handleInvalidResolvedId (node_modules/rollup/dist/es/shared/node-entry.js:20212:24)
10.89     at node_modules/rollup/dist/es/shared/node-entry.js:20172:26

Could you please look into this and suggest a resolution? Alternatively, let me know if any dependencies or configurations need to be updated for this feature to work seamlessly when building Docker images.

Thanks & Regards, Satish

paobulas avatar Mar 21 '25 09:03 paobulas

the merge is not complete on this, it needs more changes

karpikpl avatar Mar 21 '25 19:03 karpikpl

I think the issue is caused that this branch version is not using he Nuxt framework. I you needed, I can share my docker image so that you can use it quickly? Thanks.

Jun Qian.

发件人: Pardhusri Satish Babu Obulasetti @.> 发送时间: 2025年3月21日 17:39 收件人: github-copilot-resources/copilot-metrics-viewer @.> 抄送: Junqian Zhuang @.>; Mention @.> 主题: Re: [github-copilot-resources/copilot-metrics-viewer] Add multi teams support and update seat management tab to suppoft filter when clicking a card. (PR #177)

Hi @DevOps-zhuanghttps://github.com/DevOps-zhuang,

I was trying to use multi teams support which is implemented in this branch before it gets merged into the main branch. While attempting to build a Docker image using the code from this branch, I encountered the following error:

[nuxi] ERROR Nuxt Build Error: Could not resolve "../api/GitHubApi" from "app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts"

10.89 file: /app/app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts

10.89

10.89 file: app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts

10.89 at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:396:41)

10.89 at error (node_modules/rollup/dist/es/shared/parseAst.js:392:42)

10.89 at ModuleLoader.handleInvalidResolvedId (node_modules/rollup/dist/es/shared/node-entry.js:20212:24)

10.89 at node_modules/rollup/dist/es/shared/node-entry.js:20172:26

Could you please look into this and suggest a resolution? Alternatively, let me know if any dependencies or configurations need to be updated for this feature to work seamlessly when building Docker images.

Thanks & Regards, Satish

― Reply to this email directly, view it on GitHubhttps://github.com/github-copilot-resources/copilot-metrics-viewer/pull/177#issuecomment-2742826050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM4XDKDCF3N4YQBCDRH7LUT2VPMZTAVCNFSM6AAAAABZAGEWV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBSHAZDMMBVGA. You are receiving this because you were mentioned.Message ID: @.***> [图像已被发件人删除。 paobulas]paobulas left a comment (github-copilot-resources/copilot-metrics-viewer#177)https://github.com/github-copilot-resources/copilot-metrics-viewer/pull/177#issuecomment-2742826050

Hi @DevOps-zhuanghttps://github.com/DevOps-zhuang,

I was trying to use multi teams support which is implemented in this branch before it gets merged into the main branch. While attempting to build a Docker image using the code from this branch, I encountered the following error:

[nuxi] ERROR Nuxt Build Error: Could not resolve "../api/GitHubApi" from "app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts"

10.89 file: /app/app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts

10.89

10.89 file: app/components/MultiTeamsMetricsViewer.vue?vue&type=script&lang.ts

10.89 at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:396:41)

10.89 at error (node_modules/rollup/dist/es/shared/parseAst.js:392:42)

10.89 at ModuleLoader.handleInvalidResolvedId (node_modules/rollup/dist/es/shared/node-entry.js:20212:24)

10.89 at node_modules/rollup/dist/es/shared/node-entry.js:20172:26

Could you please look into this and suggest a resolution? Alternatively, let me know if any dependencies or configurations need to be updated for this feature to work seamlessly when building Docker images.

Thanks & Regards, Satish

― Reply to this email directly, view it on GitHubhttps://github.com/github-copilot-resources/copilot-metrics-viewer/pull/177#issuecomment-2742826050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM4XDKDCF3N4YQBCDRH7LUT2VPMZTAVCNFSM6AAAAABZAGEWV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBSHAZDMMBVGA. You are receiving this because you were mentioned.Message ID: @.***>

DevOps-zhuang avatar Mar 24 '25 02:03 DevOps-zhuang

@DevOps-zhuang could you please share me the docker image?

paobulas avatar Mar 24 '25 09:03 paobulas

@DevOps-zhuang could you please share me the docker image?

will send you

@DevOps-zhuang could you please share me the docker image?

docker login -u metricviewer -p XXX copilotx.azurecr.io

docker pull copilotx.azurecr.io/copilot/copilot-metrics-viewer:2025-0226-MultiTeamsSupport

DevOps-zhuang avatar Mar 26 '25 15:03 DevOps-zhuang

Hi @DevOps-zhuang,

Thank you for sharing the Docker image.

Unfortunately, I am unable to get any output from the web page when using your Docker image (copilotx.azurecr.io/copilot/copilot-metrics-viewer:2025-0226-MultiTeamsSupport).

Docker output log:

paobulas@ubuntu ~/workspace/GitHub-Copilot-Metrics/copilot-metrics-viewer-zhuang
 % docker run -p 8080:80 --env-file ./.env copilotx.azurecr.io/copilot/copilot-metrics-viewer:2025-0226-MultiTeamsSupport 
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/99-config-app.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/03/27 16:00:59 [notice] 1#1: using the "epoll" event method
2025/03/27 16:00:59 [notice] 1#1: nginx/1.27.2
2025/03/27 16:00:59 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14) 
2025/03/27 16:00:59 [notice] 1#1: OS: Linux 6.8.0-1021-azure
2025/03/27 16:00:59 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/03/27 16:00:59 [notice] 1#1: start worker processes
2025/03/27 16:00:59 [notice] 1#1: start worker process 31
2025/03/27 16:00:59 [notice] 1#1: start worker process 32
2025/03/27 16:00:59 [notice] 1#1: start worker process 33
2025/03/27 16:00:59 [notice] 1#1: start worker process 34
2025/03/27 16:00:59 [notice] 1#1: start worker process 35
2025/03/27 16:00:59 [notice] 1#1: start worker process 36
2025/03/27 16:00:59 [notice] 1#1: start worker process 37
2025/03/27 16:00:59 [notice] 1#1: start worker process 38
2025/03/27 16:00:59 [notice] 1#1: start worker process 39
2025/03/27 16:00:59 [notice] 1#1: start worker process 40
2025/03/27 16:00:59 [notice] 1#1: start worker process 41
2025/03/27 16:00:59 [notice] 1#1: start worker process 42
172.17.0.1 - - [27/Mar/2025:16:01:05 +0000] "GET /assets/app-config.js HTTP/1.1" 200 447 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"
172.17.0.1 - - [27/Mar/2025:16:02:03 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"
172.17.0.1 - - [27/Mar/2025:16:07:07 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"
172.17.0.1 - - [27/Mar/2025:16:08:25 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"
172.17.0.1 - - [27/Mar/2025:16:08:25 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

Screenshot from 2025-03-27 21-37-22

Could you please help me resolve this issue? Or have I missed something here?

paobulas avatar Mar 27 '25 16:03 paobulas

Are u tying against organization? It support organization level, and the .env should be look like below: The VUE_APP_SHOW_MULTIPLE_TEAMS=true

@.***

发件人: Pardhusri Satish Babu Obulasetti @.> 发送时间: 2025年3月28日 0:14 收件人: github-copilot-resources/copilot-metrics-viewer @.> 抄送: Junqian Zhuang @.>; Mention @.> 主题: Re: [github-copilot-resources/copilot-metrics-viewer] Add multi teams support and update seat management tab to suppoft filter when clicking a card. (PR #177)

Hi @DevOps-zhuanghttps://github.com/DevOps-zhuang,

Thank you for sharing the Docker image.

Unfortunately, I am unable to get any output from the web page when using your Docker image (copilotx.azurecr.io/copilot/copilot-metrics-viewer:2025-0226-MultiTeamsSupport).

Docker output log:

@.*** ~/workspace/GitHub-Copilot-Metrics/copilot-metrics-viewer-zhuang

% docker run -p 8080:80 --env-file ./.env copilotx.azurecr.io/copilot/copilot-metrics-viewer:2025-0226-MultiTeamsSupport

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration

/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/

/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh

10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf

10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf

/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh

/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh

/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh

/docker-entrypoint.sh: Launching /docker-entrypoint.d/99-config-app.sh

/docker-entrypoint.sh: Configuration complete; ready for start up

2025/03/27 16:00:59 [notice] 1#1: using the "epoll" event method

2025/03/27 16:00:59 [notice] 1#1: nginx/1.27.2

2025/03/27 16:00:59 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14)

2025/03/27 16:00:59 [notice] 1#1: OS: Linux 6.8.0-1021-azure

2025/03/27 16:00:59 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576

2025/03/27 16:00:59 [notice] 1#1: start worker processes

2025/03/27 16:00:59 [notice] 1#1: start worker process 31

2025/03/27 16:00:59 [notice] 1#1: start worker process 32

2025/03/27 16:00:59 [notice] 1#1: start worker process 33

2025/03/27 16:00:59 [notice] 1#1: start worker process 34

2025/03/27 16:00:59 [notice] 1#1: start worker process 35

2025/03/27 16:00:59 [notice] 1#1: start worker process 36

2025/03/27 16:00:59 [notice] 1#1: start worker process 37

2025/03/27 16:00:59 [notice] 1#1: start worker process 38

2025/03/27 16:00:59 [notice] 1#1: start worker process 39

2025/03/27 16:00:59 [notice] 1#1: start worker process 40

2025/03/27 16:00:59 [notice] 1#1: start worker process 41

2025/03/27 16:00:59 [notice] 1#1: start worker process 42

172.17.0.1 - - [27/Mar/2025:16:01:05 +0000] "GET /assets/app-config.js HTTP/1.1" 200 447 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

172.17.0.1 - - [27/Mar/2025:16:02:03 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

172.17.0.1 - - [27/Mar/2025:16:07:07 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

172.17.0.1 - - [27/Mar/2025:16:08:25 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

172.17.0.1 - - [27/Mar/2025:16:08:25 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

Screenshot.from.2025-03-27.21-37-22.png (view on web)https://github.com/user-attachments/assets/cae2cbcd-8f62-414d-89de-62c1ed67dc4e

Could you please help me resolve this issue? Or have I missed something here?

― Reply to this email directly, view it on GitHubhttps://github.com/github-copilot-resources/copilot-metrics-viewer/pull/177#issuecomment-2758616352, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM4XDKBBZT5DWOZEEDZYL3L2WQPVPAVCNFSM6AAAAABZAGEWV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJYGYYTMMZVGI. You are receiving this because you were mentioned.Message ID: @.***> [图像已被发件人删除。 paobulas]paobulas left a comment (github-copilot-resources/copilot-metrics-viewer#177)https://github.com/github-copilot-resources/copilot-metrics-viewer/pull/177#issuecomment-2758616352

Hi @DevOps-zhuanghttps://github.com/DevOps-zhuang,

Thank you for sharing the Docker image.

Unfortunately, I am unable to get any output from the web page when using your Docker image (copilotx.azurecr.io/copilot/copilot-metrics-viewer:2025-0226-MultiTeamsSupport).

Docker output log:

@.*** ~/workspace/GitHub-Copilot-Metrics/copilot-metrics-viewer-zhuang

% docker run -p 8080:80 --env-file ./.env copilotx.azurecr.io/copilot/copilot-metrics-viewer:2025-0226-MultiTeamsSupport

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration

/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/

/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh

10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf

10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf

/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh

/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh

/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh

/docker-entrypoint.sh: Launching /docker-entrypoint.d/99-config-app.sh

/docker-entrypoint.sh: Configuration complete; ready for start up

2025/03/27 16:00:59 [notice] 1#1: using the "epoll" event method

2025/03/27 16:00:59 [notice] 1#1: nginx/1.27.2

2025/03/27 16:00:59 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14)

2025/03/27 16:00:59 [notice] 1#1: OS: Linux 6.8.0-1021-azure

2025/03/27 16:00:59 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576

2025/03/27 16:00:59 [notice] 1#1: start worker processes

2025/03/27 16:00:59 [notice] 1#1: start worker process 31

2025/03/27 16:00:59 [notice] 1#1: start worker process 32

2025/03/27 16:00:59 [notice] 1#1: start worker process 33

2025/03/27 16:00:59 [notice] 1#1: start worker process 34

2025/03/27 16:00:59 [notice] 1#1: start worker process 35

2025/03/27 16:00:59 [notice] 1#1: start worker process 36

2025/03/27 16:00:59 [notice] 1#1: start worker process 37

2025/03/27 16:00:59 [notice] 1#1: start worker process 38

2025/03/27 16:00:59 [notice] 1#1: start worker process 39

2025/03/27 16:00:59 [notice] 1#1: start worker process 40

2025/03/27 16:00:59 [notice] 1#1: start worker process 41

2025/03/27 16:00:59 [notice] 1#1: start worker process 42

172.17.0.1 - - [27/Mar/2025:16:01:05 +0000] "GET /assets/app-config.js HTTP/1.1" 200 447 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

172.17.0.1 - - [27/Mar/2025:16:02:03 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

172.17.0.1 - - [27/Mar/2025:16:07:07 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

172.17.0.1 - - [27/Mar/2025:16:08:25 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

172.17.0.1 - - [27/Mar/2025:16:08:25 +0000] "GET /assets/app-config.js HTTP/1.1" 304 0 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"

Screenshot.from.2025-03-27.21-37-22.png (view on web)https://github.com/user-attachments/assets/cae2cbcd-8f62-414d-89de-62c1ed67dc4e

Could you please help me resolve this issue? Or have I missed something here?

― Reply to this email directly, view it on GitHubhttps://github.com/github-copilot-resources/copilot-metrics-viewer/pull/177#issuecomment-2758616352, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM4XDKBBZT5DWOZEEDZYL3L2WQPVPAVCNFSM6AAAAABZAGEWV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJYGYYTMMZVGI. You are receiving this because you were mentioned.Message ID: @.***>

DevOps-zhuang avatar Mar 28 '25 01:03 DevOps-zhuang

@DevOps-zhuang,

I am using it for organization only. Still I am unable to see any metrics.

Please find my .env file details below:

# Determines if mocked data should be used instead of making API calls.
NUXT_PUBLIC_IS_DATA_MOCKED=false

# Determines the scope of the API calls. 
# Can be 'enterprise' or 'organization' to target API calls to an enterprise or an organization respectively.
NUXT_PUBLIC_SCOPE=organization

# Determines the enterprise or organization name to target API calls.
NUXT_PUBLIC_GITHUB_ORG=<My organization name>

NUXT_PUBLIC_GITHUB_ENT=

# Determines the team name if exists to target API calls.
NUXT_PUBLIC_GITHUB_TEAM=

NUXT_PUBLIC_USING_GITHUB_AUTH=false

# Determines the GitHub Personal Access Token to use for API calls.
# Create with scopes copilot, manage_billing:copilot or manage_billing:enterprise, read:enterprise AND read:org
NUXT_GITHUB_TOKEN=<my pat token>

NUXT_SESSION_PASSWORD=TOUXIQsPl5kbCJ0qnBV2R7i56Nft42Gl

# for Github OAuth
# NUXT_OAUTH_GITHUB_CLIENT_ID=
# NUXT_OAUTH_GITHUB_CLIENT_SECRET=

# Determines if the application should support multiple teams.
VUE_APP_SHOW_MULTIPLE_TEAMS=true
# to use a corporate proxy
# HTTP_PROXY=http://proxy.company.com:8080

paobulas avatar Mar 28 '25 12:03 paobulas

@karpikpl @paobulas Thanks's for your support, I just update the latest code to support NUXT, it works on my machines now, can you check the latest code? the branch is same: https://github.com/DevOps-zhuang/copilot-metrics-viewer/tree/add-multi-teams-support

image

DevOps-zhuang avatar Mar 28 '25 12:03 DevOps-zhuang

@paobulas thanks's for your patience, for the docker image I provides, please use the old .env, which is like below. and I just updated my branch to support NUXT, hope it can run on your environment with the latest change as well, thanks. Uploading .env.md…

DevOps-zhuang avatar Mar 28 '25 12:03 DevOps-zhuang

docke image is also built based on this branch, I already tested it, it works. https://github.com/DevOps-zhuang/copilot-metrics-viewer/pkgs/container/copilot-metrics-viewer/385109083?tag=add-multi-teams-support

DevOps-zhuang avatar Apr 01 '25 06:04 DevOps-zhuang

@DevOps-zhuang i tested changes from your branch and the data is displayed in table. However it was observed that panels below the table are not reflecting as per selection.

VNSRAVIS avatar Apr 01 '25 10:04 VNSRAVIS

@DevOps-zhuang i tested changes from your branch and the data is displayed in table. However it was observed that panels below the table are not reflecting as per selection.

Thanks, you found a bug! it worked in non-Nuxt version, and for Nuxt version, I need to do some changes, I am fixing it now, thanks for your test!

DevOps-zhuang avatar Apr 02 '25 01:04 DevOps-zhuang

@DevOps-zhuang During testing I found differnce between 'Total Suggestions' in Home page and in 'Multi-Teams' page and corresponding metrics.

I’m unable to find an API that lists teams in GitHub Enterprise to find Teams slug. Is this the reason to not support 'Multi-Teams' at enterprise level? Any idea if the API is in development?

paobulas avatar Apr 10 '25 10:04 paobulas

@DevOps-zhuang During testing I found differnce between 'Total Suggestions' in Home page and in 'Multi-Teams' page and corresponding metrics. Yes, it is always different, for organization level. the 'Total Suggestions' in Home (Metric Page) is always grater than the one in 'Mulit-Teams' page. the main scenarios are not limited to below:

  1. there are copilot seats belong to Organization directly, not belong to team. 2)for some teams, or some days for some teams, there are less than 5 copilot seats, so there is no metric fetched from github API, so it is not counted in team level, however, such data are in organization level.

I’m unable to find an API that lists teams in GitHub Enterprise to find Teams slug. Is this the reason to not support 'Multi-Teams' at enterprise level? Any idea if the API is in development? Yes, your observation is quite good! there is no API to get teams from enterprise level, since teams are always in organization level. it is teams-->organization-->enterprise. so we don't support 'Multi-teams' against enterprise level.

but, there is one specified enterprise called dedicated enterprise/copilot standalone, with such enterprise, there is no organization at all. so teams are within enterprise level. I am considering adding support for it in future. need more design, since it takes effort to tell it is 'normal' enterprise or 'dedicated' enterprise.

And, since we support Nuxt now, you can change the URL in the brower to fetch for more organization, even special team. like https://[youserver]/orgs/[yourorgname], it will show multi-teams support for specified org.

thanks for your test and observation!

DevOps-zhuang avatar Apr 11 '25 13:04 DevOps-zhuang

@DevOps-zhuang Is this feature ready? If so, could you please merge it into the main branch?

Also, are there any plans to implement health checks on the dashboard to surface backend errors?

paobulas avatar Jun 24 '25 08:06 paobulas

@DevOps-zhuang - I've merged team metrics - can you test? I don't have access to an org that's big enough :/

karpikpl avatar Aug 09 '25 06:08 karpikpl

@karpikpl I did a quick test, and it works, and I am adding more comments:

  1. it is better to add a table view to compare more teams, as a add-on to current graph reports.

  2. since the API support fetching more than 28 days, like >60 days. however, in my test, it is still fixed to 28 days, image

and I am also posting some snapshot from my branch, just FYI>

image image

DevOps-zhuang avatar Aug 11 '25 04:08 DevOps-zhuang

@DevOps-zhuang so what happens when you change the time range? on my mock data, changing the dates does apply to teams tab.

I can add multi-teams tab, I was worried it's going to be a lot of API calls

karpikpl avatar Aug 11 '25 14:08 karpikpl

1, curre tly, by default, it will show latest 28 days metrics. like for today, it is 7/15 to 8/11 on my real test. 2, once I select the date range, like 06/15 to 8/11. it works. like below: image 3. when I selected time ranger which is not valid, like older than 05/02, a 422 error occurs, like below image

so I am wonderring maybe it is better to just limit the time range to the scope the API get by default, disable the otehr selection, just like the below. anyway, it works now, maybe I can add such limit later this week. image

DevOps-zhuang avatar Aug 11 '25 15:08 DevOps-zhuang