Vauxoo / maintainer-quality-tools

QA tools for Odoo maintainers
GNU Affero General Public License v3.0
3 stars 9 forks source link

[IMP] travis_makepot: Add compatibility with GitLab CI #278

Closed luisg123v closed 6 years ago

luisg123v commented 6 years ago

This makes possible to push .po* changes to GitLab using the script travis_makepot. This work taking all URL details from the environment variables available on GitLab CI.

Note: for this to work, the script travis_gitlab_translate_env needs to be sourced first.

This is one more step to solve https://github.com/Vauxoo/maintainer-quality-tools/issues/265

luisg123v commented 6 years ago

@moylop260 What do you think about this? Note: This is WIP.

I'd like your opinion about replacing vauxoo-dev by Vauxoo to retrieve the actual repository URL where .po* files will be pushed.

moylop260 commented 6 years ago

I didn't understand the point

luisg123v commented 6 years ago

@moylop260 Sorry, I'll try to explain it clearer:

When tests are run under GitLab CI, there's no way to know the targeted branch/repo.. So, for example, if you'd create an MR from vauxoo-dev/MQT:master-awesome-feature-moy, to be merged into Vauxoo/MQT:master, you won't be able to access the repo name "Vauxoo", nor the branch name "master".

If you recall, in the script travis_gitlab_translate_env, we gues the branch name taking its value from the variable $VERSION:

https://github.com/Vauxoo/maintainer-quality-tools/blob/cb4db27038817557ec11e849b5d58d7e6017c711/travis/travis_gitlab_translate_env#L29-L30

In this case, we'd also need the repo name "Vauxoo", to know the full repo's URL. What I'm currently doing is 'vauxoo-dev/MQT'.replace('vauxoo-dev', 'Vauxoo') which of course is not ideal.