floss-toolbox icon indicating copy to clipboard operation
floss-toolbox copied to clipboard

[FEATURE] GitHub / GitLab - Check if repository empty

Open pylapp opened this issue 1 year ago • 4 comments

Is your feature request related to a problem?

As an organization administrator I want to,know if there are some empty or almost empty repositories So that I can check if some deelopers need help to full it or if there are dead repos

What solution would you like?

None

What alternatives have you considered?

None

Do you have any additional context?

No

pylapp avatar Jun 20 '25 12:06 pylapp

So after overviewing the repo, my game plan would be use BashScript, which i know very little, to check whether a repo is empty or not. I can learn Bash Script in a week or so. If I can get some guidance, I will be more than happy to contribute to the project

duy4nt avatar Oct 08 '25 13:10 duy4nt

Hey @duy4nt, welcome on board!

The need is quite simple. As the administrator of a GitHub or a GitLab organization, I want to know if I have some empty repositories. In that case it could mean in the end the repository is dead, or contributors do not need it, or have access issues, etc.

So, I need to make this operation quite quickly, e.g. by running a simple command. I list in the wiki the actual features for GitHub and GitLab.

You can provide two scripts, one for GitHub (in toolbox/github) and one for GitLab (in toolbox/gitlab). Maybe you should start by GitHub.

For this time I won't ask you to use current features or be integrated in the current stack ; a standalone script, if it does the job as expected, can be enough.

You can fin below the requirements:

  1. be able to stop the script if there are any error (e.g. set -euo pipefail for common Bash scripts)
  2. provide an help, e.g. if someone runs the script without suitable parameters, stop the script and displays the help
  3. you may need to use a personal access tokens ; in that case it must be defined in an environment variable
  4. the organization to process can be defined as a parameter or inside the code, it's up to you
  5. the logs must be clear with errors
  6. the logs must output, if they exist, the name and URL of the repositories in my organization which are empty

By "empty repository", I mean here:

  1. no files
  2. or one file (supposing it can be a default LICENSE or README)

To contribute, you should:

  1. fork the repo
  2. work on your side
  3. submit a pull request

For the tests, you have two solutions:

  1. test with your own organization you can create with empty and not empty repos ; thus in the end I will be able to test it with only changes in personal access token and organization name
  2. I will create fake repos in my side and provide you a read only personal access tokens for your tests ; but I prefer solution 1.

What do you think?

pylapp avatar Oct 08 '25 14:10 pylapp

hey , does this issue is already assigned , if not can i work on it and also i have a question , what exactly a empty repo means - having no files or only have a readme , and also it should also based on public or private repo type

nXtCyberNet avatar Oct 09 '25 05:10 nXtCyberNet

hey , does this issue is already assigned , if not can i work on it and also i have a question , what exactly a empty repo means - having no files or only have a readme , and also it should also based on public or private repo type

Hi @nXtCyberNet!

You can refer to the comment above for more details. By "empty" I mean no files or only one file (could be README or LICENSE). The issue is not assigned yet, I expect people bring meaningful pull requests before assigned issue and see after the job is not done.

So, in the end, feel free to work on this topic. Even if I have several assigned people on the issue I will see to manage the pull requests as best as I can for Hacktoberfest. You can also if you want work on other issues.

Could you explain how you plan to work on this issue and implement the solution?

pylapp avatar Oct 09 '25 05:10 pylapp