dynamist / subgit

Sub-git repo handler
Apache License 2.0
0 stars 0 forks source link

Implement gitlab/github import feature #34

Closed Grokzen closed 1 year ago

Grokzen commented 1 year ago

So @naestia had the idea that we should be able to generate or "import" all git repos that is available from either my user account or an organisation account.

We have an example script of this already made on the side that supports this for our own needs, but this should be supported in the main tool if possible.

Implement the cli commands similar to this

subgit import github <username-or-organisation> <output-file>
subgit import gitlab <username-or-organisation-id> <output-file>

where we also define the output file. Note here that we need protection to avoid or to ask the user to overwrite existing configuration file. The output file maybe should be optional and it should default to .subgit.yml by default.

Things we should parse out from the repo is the clone url, repo name and default branch name and save this in the configuration file. Anything else is redundant by default and needs to be added by the user manually after.

So one thing here and one critical thing is that any dependencies we have or need in order to make the commands work like git-python or if we need any other libraries based on what the script translation will be, if we need additional python dependencies, they should be put in the extras_installs section in setup.py file and the commands should be enabled/disabled based on if the python imports exists and can be done.

holmboe commented 1 year ago

I am pondering if "query" would be a more appropriate subcommand than "import" for this?

In this case you would even skip the "" argument and just print to stdout in order to see what the result is, and the user could then redirect this to a file at their own will. Less things happening in the background is good when there is a way to simplify.