OCA / data-protection

Data Protection
https://github.com/OCA/data-protection/wiki
GNU Affero General Public License v3.0
31 stars 68 forks source link

Migration to version 16.0 #67

Open sbidoul opened 1 year ago

sbidoul commented 1 year ago

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

tde-banana-odoo commented 1 year ago

Hello,

I could try to give a hand, as it is hacktoberfest. Is someone working on it, or do you have some plans for it ? As I can't really say when I will dive into it, if you have better plans I can look for something else :) .

pedrobaeza commented 1 year ago

Hi, Thibault, that would be great! We are the main maintainers of the modules, and for now we are not migrating them to 16.0, so they are free to be caught. The migration procedure may be a bit convoluted/outsider for you, used to Odoo single repository approach. Let me know if you need help or a meeting for commenting about it.

tde-banana-odoo commented 1 year ago

Followed various steps found in the migration doc, landed with https://github.com/OCA/data-protection/pull/69 with just the init (aka applying patches), still nothing else done. Note that I don't understand anything about the configuration files where I had a lot of conflicts (copier-answers, eslintrc, prettierrc, ...), I always took the 16.0 version ^^ .

tde-banana-odoo commented 1 year ago

Note that in 14.0 there are two addons (privacy, privacy_consent), while in the 15.0 branch there is only one (privacy). Is it intended ?

pedrobaeza commented 1 year ago

Weird... following technical steps in https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0#technical-method-to-migrate-a-module-from-150-to-160-branch you get only changes relative to the affected module, and then you can proceed with the migration itself. The reason why we have to catch the commit history is that the branches may evolve since the 16.0 branches creation.

Note that in 14.0 there are two addons (privacy, privacy_consent), while in the 15.0 branch there is only one (privacy). Is it intended ?

This is because the second module hasn't been migrated to 15.0 yet. You can proceed with the migration the same, but changing the command to point to 14.0 instead of 15.0.

tde-banana-odoo commented 1 year ago

Hello,

I applied the steps based on 14, and I also have a lot of conflicts in configuration files. I kept the 16.0 version beause I don't really understand how your repositories work (lot of boiler plate when coming from standard odoo addons ^^). Anyway, it seems the code itself is correct, just that all setup / configuration files are probably broken ^^ . What I did is to already work on that branch and make first migration commits, seems to be globally working when using it (completely not finished, just giving some time when I can :) ) .

Could be great if someone can have a look / help me with those initial commits and see what is required for files like copier-answers.yml, eslintrc.yml, ... Don't have much time to spend on those, prefer giving some hours to make the module works :) . It is also strange that a setup directory appears containing a duplicate of the code, is it something standard on your side ?

Cheers and sorry for those noob-to-oca-setup-thingies questions :D !

And happy diwali.

sbidoul commented 1 year ago

Hi @tde-banana-odoo,

I just tried this and there are no conflicts. Are you sure you did not forget -- $module in the format-patch command?

export module=privacy
git checkout -b 16.0-mig-$module origin/16.0
git format-patch --keep-subject --stdout origin/16.0..origin/14.0 -- $module | git am -3 --keep
tde-banana-odoo commented 1 year ago

Hem... I might have copy-pasted without seeing that $module was actually a variable. It's post OXP for everyone :roll_eyes: ... then ok, no conflicts since it applies only privacy and privacy_consent patches, thanks :) .

sbidoul commented 1 year ago

:) we probably need to clarify that wiki page too.

tde-banana-odoo commented 1 year ago

Having currently an error I don't really understand (see https://github.com/OCA/data-protection/actions/runs/3311887415/jobs/5467882622 ), what is the underlying issue ?

Run newfiles="$(git ls-files --others --exclude-from=.gitignore)"
Please check-in the following files:
setup/privacy/odoo/addons/privacy
setup/privacy/setup.py
setup/privacy_consent/odoo/addons/privacy_consent
setup/privacy_consent/setup.py
Error: Process completed with exit code 1.
sbidoul commented 1 year ago

The pre-commit step that runs the linters is finding a few missing files.

You need to

tde-banana-odoo commented 1 year ago

I fought against upgrade team to never use pre-commit ... but hey, sometimes you have to evolve.

pedrobaeza commented 1 year ago

pre-commit automates a lot of checks and auto-transformations that has allowed OCA to get a very high level of standardization, so I'm happy with it. I have create a wiki page for installing pre-commit: https://github.com/OCA/maintainer-tools/wiki/Install-pre-commit, plus added the reference in the migration guide.

tde-banana-odoo commented 1 year ago

Yep, I was the one who had to evolve :D I agree it can be necessary, anyway that's not the purpose of this issue to talk about tools :)

pedrobaeza commented 1 year ago

Indeed. If you want that we talk to your team/colleagues about pre-commit, just tell us and we arrange a meeting.