A couple minor improvement suggestions. Great tooling btw! 🏆
When using --repo-list, it would be nice to know which repository is being processed by showing that in the output. Currently there's only a rate limit callout with wording stating "getting repositories for org". For repos with thousands of records it can take a very long time to run, so knowing which repo it's on is helpful. Note that running against the entire org, without --repo-list, does show the repo being processed, so it seems to be limited to --repo-list only. See output below for example.
When using --repo-list, any repos included that don't exist are not identified in the output as an issue. They are not included in the .csv either, which I guess is expected, but if you have a large list you're left wondering why the count of the results is off from the number of repos in the repo-list file.
Possible Solutions:
Include summary in host output with list of repos and the overall status of collecting stats from the repos.
Add column status, or something like that, in the .csv and include status of 'completed', 'not found', 'error'. If not found, then all stats could be 0 with the status 'not found'. If some of the stats were retrieved but not all. due to API limit or some other issue, having status of 'error' would let us know we're missing data.
Sample of testing around the issues mentioned. Repo name and org were swapped to generic in the output below.
/github/migration/stats$ cat ./repo-list.txt
ActiveRepo
NonExistentRepo
/github/migration/stats$ gh repo-stats --org myorg --repo-list ./repo-list.txt
######################################################
######################################################
############# GitHub repo list and sizer #############
######################################################
######################################################
User provided a repo list file. Mapping contents...
------------------------------------------------------
Getting repositories for org: myorg
Rate limits remaining: 4978 GraphQL points 4962 REST calls
Rate limits remaining: 4977 GraphQL points 4960 REST calls
Rate limits remaining: 4975 GraphQL points 4958 REST calls
Rate limits remaining: 4974 GraphQL points 4957 REST calls
Gathered all repositories for org: myorg
######################################################
The script has completed
Results file:[myorg-all_repos-202305031643.csv]
######################################################
/github/migration/stats$ cat ./myorg-all_repos-202305031643.csv
Org_Name,Repo_Name,Is_Empty,Last_Push,Last_Update,isFork,Repo_Size(mb),Record_Count,Collaborator_Count,Protected_Branch_Count,PR_Review_Count,Milestone_Count,Issue_Count,PR_Count,PR_Review_Comment_Count,Commit_Comment_Count,Issue_Comment_Count,Issue_Event_Count,Release_Count,Project_Count,Branch_Count,Tag_Count,Discussion_Count,Has_Wiki,Full_URL,Migration_Issue
myorg,activerepo,false,2023-05-03T15:56:07Z,2023-04-27T21:10:23Z,false,56,56,19,2,0,0,2,11,0,0,1,21,0,0,7,0,0,true,https://github.com/myorg/activerepo,FALSE
A couple minor improvement suggestions. Great tooling btw! 🏆
When using --repo-list, it would be nice to know which repository is being processed by showing that in the output. Currently there's only a rate limit callout with wording stating "getting repositories for org". For repos with thousands of records it can take a very long time to run, so knowing which repo it's on is helpful. Note that running against the entire org, without --repo-list, does show the repo being processed, so it seems to be limited to --repo-list only. See output below for example.
When using --repo-list, any repos included that don't exist are not identified in the output as an issue. They are not included in the .csv either, which I guess is expected, but if you have a large list you're left wondering why the count of the results is off from the number of repos in the repo-list file.
Possible Solutions:
status
, or something like that, in the .csv and include status of 'completed', 'not found', 'error'. If not found, then all stats could be 0 with the status 'not found'. If some of the stats were retrieved but not all. due to API limit or some other issue, having status of 'error' would let us know we're missing data.Sample of testing around the issues mentioned. Repo name and org were swapped to generic in the output below.