Skip to content
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

Non-existent repo callout and repo-list output for which repo being processed #45

Open
esleyshaffer opened this issue May 3, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@esleyshaffer
Copy link

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
@pmartindev pmartindev added the enhancement New feature or request label Nov 10, 2023
@vagabond2522

This comment was marked as spam.

@gerkelly69
Copy link

@gerkelly69
Copy link

/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

LuCaSiNo40 added a commit to LuCaSiNo40/gh-repo-stats that referenced this issue Jan 10, 2025
Related to mona-actions#45

Add repository processing status and handle non-existent repositories in `gh-repo-stats`.

* Add a new column `status` to the .csv file to indicate the status of each repository ('completed', 'not found', 'error').
* Update the `ParseRepoData` function to include the `status` parameter and write it to the .csv file.
* Display the currently processed repository in the output when using `--repo-list`.
* Identify non-existent repositories in the `--repo-list` file and mark them as 'not found' in the output and .csv file.
* Update the header of the .csv file to include the new `status` column.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/mona-actions/gh-repo-stats/issues/45?shareId=XXXX-XXXX-XXXX-XXXX).
@LuCaSiNo40 LuCaSiNo40 mentioned this issue Jan 10, 2025
@LuCaSiNo40
Copy link

✨✨ Here's an AI-assisted sketch of how you might approach this issue saved by @LuCaSiNo40 using Copilot Workspace v0.27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants
@pmartindev @esleyshaffer @gerkelly69 @vagabond2522 @LuCaSiNo40 and others