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

Allow using a subfolder for archived projects #359

Open
dvonessen opened this issue Oct 24, 2023 · 4 comments
Open

Allow using a subfolder for archived projects #359

dvonessen opened this issue Oct 24, 2023 · 4 comments

Comments

@dvonessen
Copy link
Contributor

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.

@gabrie30
Copy link
Owner

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.

@dvonessen
Copy link
Contributor Author

dvonessen commented Oct 30, 2023

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

@gabrie30
Copy link
Owner

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.

@dvonessen
Copy link
Contributor Author

dvonessen commented Oct 31, 2023

I will try my best, but it will take time. Maybe in 2024.
But I will be a good golang training. :-)

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

No branches or pull requests

2 participants