Skip to content

Commit

Permalink
Add issueReport.js, see #207
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 16, 2023
1 parent 5645a8f commit 04c8afc
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
65 changes: 65 additions & 0 deletions github-dashboard/issueReport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright 2023, University of Colorado Boulder

const buildLocal = require( '../../perennial-alias/js/common/buildLocal' );
const { Octokit } = require( 'octokit' ); // eslint-disable-line require-statement-match
const octokit = new Octokit( {
auth: buildLocal.phetDevGitHubAccessToken
} );

// List all users for the organization
const getUsersFromGitHub = async () => { // eslint-disable-line no-unused-vars
const result = await octokit.request( 'GET /orgs/phetsims/members', {
org: 'phetsims',
per_page: 100
} );

// console.log( result.data.length );
const logins = result.data.map( member => member.login );
return logins;
};

// Users that have >=1 ready for review issue as of Feb 16, 2023
const getUsersStatic = async () => {
return [
'AgustinVallejo',
'amanda-phet',
'arouinfar',
'chrisklus',
'emily-phet',
'JacquiHayes',
'jbphet',
'jessegreenberg',
'jonathanolson',
'kathy-phet',
'Luisav1',
'matthew-blackman',
'Matthew-Moore240',
'mattpen',
'oliver-phet',
'pixelzoom',
'samreid',
'veillette',
'zepumph'
];
};
const getUsers = getUsersStatic;

// https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#list-users
( async () => {
const users = await getUsers();

for ( let i = 0; i < users.length; i++ ) {
const user = users[ i ];

const result = await octokit.request( 'GET /search/issues', {
accept: 'application/vnd.github+json',
// q: `is:issue is:open label:status:ready-for-review assignee:${user} org:phetsims`,
q: `is:issue is:open assignee:${user} org:phetsims`,
per_page: 100,
page: 1
} );
// console.log( result.data.items.length );
// console.log( result.data.items );
console.log( `${user}: ${result.data.items.length}` );
}
} )();
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "phet-info",
"version": "1.0.0",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/phetsims/phet-info.git"
},
"devDependencies": {
"@octokit": "~4.2.0"
}
}

0 comments on commit 04c8afc

Please sign in to comment.