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

Documentation for the best way to manage a high number of OCA repositories #575

Closed
conroyke56 opened this issue Aug 8, 2023 · 11 comments
Closed

Comments

@conroyke56
Copy link

conroyke56 commented Aug 8, 2023

Is your feature request related to a problem?
Yes, managing a large number of OCA repositories. I've cloned a vast amount of OCA repositories using the OCA maintainer tool's clone-all script. However, I'm now wondering the best method to make these repositories accessible from within my Odoo instance.

Describe the solution you'd like
I'm seeking a solution or guidance on the optimal way to integrate these 200+ repositories with my Odoo instance. A step-by-step guide, or perhaps an automated script/tool, would be immensely beneficial.

Describe alternatives you've considered

  1. Adding each repository individually, which seems highly inefficient given the volume.

  2. Copying the content of each repository over to a separate directory, but this also seems time-consuming.

Additional context
I would also appreciate advice on best practices for updating OCA modules. I am receptive to the possibility that I might have overlooked something in the existing documentation. If this is a common challenge among users, enhancing the documentation might aid many others in the community.

@conroyke56
Copy link
Author

conroyke56 commented Aug 8, 2023

So because I was looking for a way to manage this, I just went ahead and wrote a little phyton script as a tool. perhaps its useful to add to the oca maintainer tool.

Maybe now i have done this, i should convert this over to a pull request or something?
I am not really sure how to do that, or if this is best practice for managing a large number of repos.

Forgive me, I am very new to this.

This script is a very basic utility tool designed to allow users to interactively select directories from a predefined base directory.
The script provides a user interface through the command line, using the curses library, to display, navigate, and select/unselect directories. The script also offers functionality to set a base directory and add default directories.

When the script is run it:

  1. Loads any existing configuration from a file.
  2. Gives the user an option to set or change the base directory where the repos have been cloned to and set or change the default directories that should always exist in your Odoo config file.
  3. Displays an interactive list of directories from the base directory for the user to select.
  4. Once selections are made, it saves the selections to a file and prints out the selected paths combined with the default directories that can be copy and pasted to you Odoo config file.

The script also checks and prompts the user to install required Python libraries if they are not already present.

Future plans:
Adding exception handling in various parts of the script to make it robust.

Attached is the py file (as a txt, because I don't know how to upload a py file) and a brief readme.
readme Repo Select.txt

Repo Select PY v2.txt

@rvalyi
Copy link
Member

rvalyi commented Aug 8, 2023

pro-tip: https://github.com/acsone/git-aggregator

this is the basis. Atop of this you could use extra layers such as Doodba or Docky (and specially akretion/ak) but git-aggregator is definitely the basis. And yes to survive with Odoo, like it or not, you should have a pretty advanced git skills first.

@conroyke56
Copy link
Author

conroyke56 commented Aug 8, 2023

I’m not sure that’s effective with a huge number of repos? Like if you were to clone all.

Could you give an example?
I’m struggling to work it out.

Say I have a dodo instance, I want to clone all the OCA repos so they are available in Odoo.
I want branch 14.0.

How would I manage it with git aggregator?
Do I need to list all 200+ repos?

I wouldn’t say I have advanced git skills.
Maybe intermediate?
I mean I built that script, only took me about 8 hours haha.

I guess I could write a script that would create the yml file.

@pedrobaeza
Copy link
Member

That's not a real need. You don't need to clone the 200+ repos for any project.

@conroyke56
Copy link
Author

conroyke56 commented Aug 8, 2023

Why does the clone-all script exist?

For me when I’m developing and testing - Building for different scenarios - I do want to be able to just have it there ready.
Be able to update them at a push of a button.

When I deploy a production environment, I’d likely only deploy the necessary repos.
Perhaps my script is not a bad way to handle that situation.

@pedrobaeza
Copy link
Member

pedrobaeza commented Aug 8, 2023

You'll find that it's better to populate what you need instead of trying to have it all. The clone_all option is a very old one, useful in some automation scenarios, but not for real life.

Closing this, as this is not an issue, but a question.

@conroyke56
Copy link
Author

conroyke56 commented Aug 8, 2023

Do you think anyone will have any use for my script? Is it worth putting it in the maintainer repo to work alongside the clone-all script?

@pedrobaeza
Copy link
Member

Which script?

@conroyke56
Copy link
Author

conroyke56 commented Aug 8, 2023

Which script?

It’s in my second comment on this request.

#575 (comment)

I attached the script and a readme.

@pedrobaeza
Copy link
Member

pedrobaeza commented Aug 8, 2023

Well, the fact that there's no demand during all these years for something like that, may point to not being needed, but I let others to raise their hand to say if it's useful.

@conroyke56
Copy link
Author

Yeh. Totally understandable. Also handy for aggregating any number of repos. Doesn’t need to be large.

Much simpler to use than the main aggregator. I guess if someone is looking for a simple way to add multiple addons to Odoo at once, make it available, they will find it here with the script.

Thanks for your help 👍

I’m going to spend some time looking into the methods you suggest.
I enjoy learning all this. ✌️💛

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

No branches or pull requests

3 participants