Bug #16844

Don't use the same working copy in Weblate as in update_weblate_git.py

Added by intrigeri 2019-06-27 17:59:20 . Updated 2019-07-13 18:54:00 .

Status:
Resolved
Priority:
Elevated
Assignee:
intrigeri
Category:
Infrastructure
Target version:
Start date:
Due date:
% Done:

0%

Feature Branch:
https://salsa.debian.org/hefee/puppet-tails/tree/hefee/16844-different-working-directory
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Translation Platform
Deliverable for:
309

Description

update_weblate_git.py assumes ownership of its working copy during some of the time it’s running. If Weblate tries to pull or commit during that time, all kind of bad things™ can happen.

Presumably, update_weblate_git.py could have its own working copy and merge from the Weblate’s one before it sync’s with the canonical (“main”) Git repo.


Subtasks


Related issues

Related to Tails - Bug #16874: Weblate commits changes to wiki/src/templates/page.tmpl Resolved
Blocks Tails - Feature #15087: Public call for testing Resolved 2017-12-19

History

#1 Updated by intrigeri 2019-07-01 09:11:31

  • Priority changed from Normal to Elevated
  • Target version set to Tails_3.16

ab0169d1ad230078207961744e36427a87831b82 in puppet-tails.git creates another race condition: we’re sometimes rewriting history of the Git repo that we share with Weblate.

#2 Updated by intrigeri 2019-07-05 15:16:07

#3 Updated by Anonymous 2019-07-05 15:16:45

  • Assignee set to hefee

#4 Updated by hefee 2019-07-06 21:28:11

@intrigeri: I added a image for the workflow at translate-server.git named git_repository_details.svg- please comment.

#5 Updated by hefee 2019-07-08 21:48:18

  • Status changed from Confirmed to In Progress
  • Assignee changed from hefee to intrigeri
  • Feature Branch set to https://salsa.debian.org/hefee/puppet-tails/tree/hefee/16844-different-working-directory

I pushed now a script to merge Weblate changes. It needs more puppet changes from your side:

  • a new clone for the staging repo.
    - a remote named “weblate” that is connected to the weblate repo
    - a remote named “origin” that is connected to main repo
    -> replace XX_STAGING_REPO_XX within files/weblate/scripts/cron.sh
  • weblate repo needs to pull and push to this staging repo not to main repo anymore
    - cron remote needs to do the same

#6 Updated by intrigeri 2019-07-09 13:51:17

> * a new clone for the staging repo.

You’re aware that we already have a repo dedicated to the staging website, right? It’s in ~weblate/repositories/vcs/staging/. Here and on the SVG I don’t understand if “a new clone for the staging repo” is that existing repo or a new one. If it’s a new one, the let’s give it a different name, otherwise we’ll get endlessly confused.

> - a remote named “weblate” that is connected to the weblate repo
> - a remote named “origin” that is connected to main repo
> -> replace XX_STAGING_REPO_XX within files/weblate/scripts/cron.sh

OK. I assume this must be a non-bare repo — correct?

> * weblate repo needs to pull and push to this staging repo not to main repo anymore
> - cron remote needs to do the same

Pushing to a non-bare repo is tricky… and reintroduces the same kind of race condition issues that we’re trying to fix here. What about this instead:

  • weblate does not push at all
  • update_weblate_git.py merges from the repo that’s dedicated to weblate

?

#7 Updated by intrigeri 2019-07-09 13:51:59

  • Assignee changed from intrigeri to hefee

#8 Updated by hefee 2019-07-09 15:40:27

  • Assignee changed from hefee to intrigeri

After discussion - be more presice:

a new clone for the integration repo.
- non-bare
- a remote named “weblate” that is connected to the weblate.git repo alias ~weblate/repositories/vcs/index
- a remote named “origin” that is connected to coninical repo
-> replace XX_STAGING_REPO_XX within files/weblate/scripts/cron.sh

weblate.git repo pulls from cannonical repo (like it is already)
does not push at all
- cron remote is also connected to canonical repo (like it is already)

me has to look at how to disable pushing from Weblate.

#9 Updated by hefee 2019-07-12 10:44:36

> me has to look at how to disable pushing from Weblate.

Okay that is easy, if we remove the push url than weblate won’t push anymore. And disable “automatically push changes on every commit” at the index component:

https://docs.weblate.org/en/latest/admin/continuous.html?highlight=push#push-changes

#10 Updated by hefee 2019-07-12 11:35:28

  • related to Bug #16874: Weblate commits changes to wiki/src/templates/page.tmpl added

#11 Updated by intrigeri 2019-07-12 19:32:12

> Okay that is easy, if we remove the push url than weblate won’t push anymore.

… and the good news is that IIRC, we need to change this in one single place in the admin interface :)

I’ll let you do it, OK?

> And disable “automatically push changes on every commit” at the index component:

I’m not sure I get this part: only on one component or on each of them?

#12 Updated by intrigeri 2019-07-13 18:54:00

  • Status changed from In Progress to Resolved

>> Okay that is easy, if we remove the push url than weblate won’t push anymore.

I’ve just emptied the push URL for the index component and this should be inherited by all other components.

>> And disable “automatically push changes on every commit” at the index component:

> I’m not sure I get this part: only on one component or on each of them?

I guess that’s what https://git.tails.boum.org/puppet-tails/commit/?id=e93d95d7c387758e52c4069ce0249d6c9a34932f did.

⇒ I think we’re done here \o/