-
Notifications
You must be signed in to change notification settings - Fork 274
add seat analysis support for Github Enterprise, since newly released… #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add seat analysis support for Github Enterprise, since newly released… #49
Conversation
… Github API support enterprise level seat information in 6/21, thanks for check.
@martedesco could you please help check it? I already test it for real orgs. and mock data with both enterprise and orgs. since I don't have a formal copilot enabled github enterprise, I didn't test that scenarios. hope it works, since the only difference is the API URL. thanks! :-) |
README.md
Outdated
@@ -72,11 +72,11 @@ The language breakdown analysis tab also displays a table showing the Accepted P | |||
|
|||
## Seat Analysis | |||
|
|||
 | |||
 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently I don't have access to https://private-user-images.githubusercontent.com/54096296/334353713-d1fa9d1d-4fab-4e87-84ba-7be189dd4dd0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5ODc0MTYsIm5iZiI6MTcxODk4NzExNiwicGF0aCI6Ii81NDA5NjI5Ni8zMzQzNTM3MTMtZDFmYTlkMWQtNGZhYi00ZTg3LTg0YmEtN2JlMTg5ZGQ0ZGQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIxVDE2MjUxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE1MWE2YmEwYThkODU5MGVmZDc1MDZjNWY5M2MzNzQzNzFjNTZjNjA1Njk0ZDdhZjc1ZjQ5YWJhYjcxMmRiYmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.rjuRIhggtvKfIXZxCnQQSsDqrhOt1_jK3jdbbDvn2_A
I assume this might apply to other users as well.
Please consider either including the image file in the repo or embedding the image as a base64 encoded string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, and I want to follow the format like 'https://github.com/github-copilot-resources/copilot-metrics-viewer/assets/3329307/79867d5f-8933-4509-a58a-8c6deeb47536', however, didn't find the assets folder in the repo. I guess it is from the other way to update the image files, then used in readme? thanks.
I tried to post the files here, and then get the url, will try use it in readme. though not sure whether it is a popular way :-)
Thanks @DevOps-zhuang for providing these valuable contributions to the project as a reaction to my message in #41. Maybe there's also the chance to provide analytics for the assigning GitHub Enterprise team(s) ( {
"total_seats": 1,
"seats": [
{
"created_at": "2021-08-03T18:00:00-06:00",
"updated_at": "2021-09-23T15:00:00-06:00",
"pending_cancellation_date": null,
"last_activity_at": "2021-10-14T00:53:32-06:00",
"last_activity_editor": "vscode/1.77.3/copilot/1.86.82",
"assignee": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
// ...
"type": "User",
"site_admin": false
},
"assigning_team": {
"id": 1,
"node_id": "MDQ6VGVhbTE=",
"url": "https://api.github.com/teams/1",
"html_url": "https://github.com/orgs/github/teams/justice-league",
"name": "Justice League",
"slug": "justice-league",
"description": "A great team.",
"privacy": "closed",
"notification_setting": "notifications_enabled",
"permission": "admin",
"members_url": "https://api.github.com/teams/1/members{/member}",
"repositories_url": "https://api.github.com/teams/1/repos",
"parent": null
}
}
] |
thanks for suggesiton, It is a good suggesiton, and I just added 'seat' support for seat analysis in my local environemtn, it works for the mock data. then when I swith to real org, it is just blank, I just found there is no "assigning_team" returned in my environment at all, though there are 16 teams, almost every developer are within one team. and I am checking with Github team for it, not sure whether it is data error. will keep monitoring it. |
checked with GitHub experts. The explanation for the team is provided below |
The code changes include updating the `SeatsAnalysisViewer.vue` component to display the assigning team of each seat. This is achieved by adding a new table column and binding the `item.team` property to it. This commit message follows the conventional format of starting with a type (`feat` for feature) followed by a concise and descriptive summary of the changes.
why hasnt this been merged. it works beautifully :D |
@martedesco please consider looking into this any time soon |
Add seat analysis support for Github Enterprise, since newly released Github API support enterprise level seat information in 6/21, thanks for check.
https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-enterprise
Updates to the README:
README.md
: The image source and some descriptions in theSeat Analysis
section have been updated to reflect the current state of the project.Changes to the
getSeatsApi
function:src/api/ExtractSeats.ts
: ThegetSeatsApi
function has been modified to handle both "organization" and "enterprise" scopes. It now constructs the API URL based on theVUE_APP_SCOPE
environment variable. The function also uses theVUE_APP_GITHUB_TOKEN
environment variable and throws an error if it's not set. [1] [2] [3]Changes to the
Seat
model:src/model/Seat.ts
: A new propertyteam
has been added to theSeat
model.Changes to the sample response data:
src/assets/enterprise_response_sample_seats.json
andsrc/assets/organization_response_sample_seats.json
: Thelogin
property of theassignee
object has been updated in the sample response data. [1] [2] [3]Changes to the Vue components:
src/components/SeatsAnalysisViewer.vue
: Theteam
property has been added to the table in theSeatsAnalysisViewer
component. [1] [2]src/components/ApiResponse.vue
andsrc/components/MainComponent.vue
: Some conditional rendering based on thevueAppScope
andisScopeOrganization
properties have been commented out. [1] [2] [3] [4]