Open dvonessen opened 1 year ago
There is already the --skip-archived
which I think would need to take precidence if both were set. Additionally I think the folder should be namespaced with ghorg e.g. ghorg_archive
to further prevent a collision if an org had a repo called archive
However this feature gets a bit wonky with gitlab and their nested groups/repo structure and the various flags for gitlab. I generally try to stay away from features that only work on some providers unless the feature is not possible via the provider api.
Hi, thank you for responding.
There is already the --skip-archived which I think would need to take precidence if both were set.
YES. Totally agree.
Additionally I think the folder should be namespaced with ghorg e.g. ghorg_archive to further prevent a collision if an org had a repo called archive.
Ha! I didn't thought about this, you are totally right. There is no complaint about ghorg_archive
(maybe make prefix configurable).
However this feature gets a bit wonky with gitlab and their nested groups/repo structure and the various flags for gitlab. I generally try to stay away from features that only work on some providers unless the feature is not possible via the provider api.
I do not understand your point. If the archived repository is in a subgroup it should replicate it to the filesystem and use multiple ghorg_archive
directories.
Would you consider this feature as not wanted?
Regards Daniel
If you want to tackle this feature feel free.
With GitLab you'll need to handle two cases, where the repos are all cloned into one directory and the other where --preserve-dir
is used. Which will mirror the subgroup folder structure into the clone dir. You might also need to handle the case where a user updates the --output-dir
. These are two things off the top of my head, there might be more things to watch out for.
If you can please also include integration tests for this flag that would be great too, they are under the /scripts
directory. I've created a repo https://github.com/forcePushToProduction/public-archived in the testing org. You can just test github I dont have a gitlab org setup to create an archived repo there yet. However if you are feeling real adventurous you can add a local GitLab integration test via docker https://github.com/gabrie30/ghorg/blob/master/scripts/local-gitlab/integration-tests.sh, the readme has some more info https://github.com/gabrie30/ghorg/blob/master/scripts/local-gitlab/README.md
Let me know if you run into any issues more than happy to help.
I will try my best, but it will take time. Maybe in 2024. But I will be a good golang training. :-)
Describe the solution you'd like I would like to clone all archived repositories to a configurable subfolder e.g.
archive
. That prevents cluttering the actual repos which are used more often but it helps to keep all on a local machine.