Closed DevOps-zhuang closed 18 hours ago
@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! :-)
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) (assigning_team
)?
{
"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 @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) (
assigning_team
)?{ "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.
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) (
assigning_team
)?{ "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 } } ]
checked with GitHub experts. The explanation for the team is provided below "assigning_team": {"description": "The team through which the assignee is granted access to GitHub Copilot, if applicable.",....} so the 'assigning_team' here means 'the team where the user was assigned/received copilot license', not the team the user belongs to...so if the account was not assigned copilot through teams, the assigin-team here is blank, so I am doubting whether it is worth adding the teams here, it will create more confusion... your suggestion? thanks.
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]