Project

General

Profile

Feature #15082

Feature #10034: Translation web platform

Feature #15079: Integrate the platform with our Git and ikiwiki infrastructure

Have the Weblate Git communicate with our main Git repository

Added by u over 1 year ago. Updated 14 days ago.

Status:
Confirmed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
03/01/2018
Due date:
% Done:

43%

Spent time:
(Total: 0.50 h)
QA Check:
Feature Branch:
Type of work:
Sysadmin
Blueprint:
Starter:
Affected tool:

Description

(plan created by intrigeri and hefee - Jan 2018)

Translation Server

  • Have a (rough) review of used scripts and interaction of components (#16326).

Weblate

  • We have to make sure that Weblate git only contains reviewed translations.
  • maybe have pre-commit hooks that run check_po on the commit.
  • Weblate should push by commit. Or if that to much noise once per hour. If once per hour we need a cronjob for this on the weblate VM.

MAIN GIT

  • get pre-receive hook reviewed (#15402).
  • On merge, our main git has to verify that weblate tries to push only po files, modified or new ones, and nothing else. Email on error to weblate admins and tails-l10n.

Subtasks

Bug #15185: Automatically update Weblate components on mdwn file add/rename/delete in tails.bo gitResolvedhefee

Bug #16490: translation-server: detect weblate components correctly.Resolvedgroente

Bug #15356: Automate adding new components to WeblateDuplicatehefee

Bug #15402: Pre-receive hook for Main git when handling pushs from weblateIn Progresshefee

Bug #16712: Run tests for tails-weblate-update.hookNewintrigeri

Feature #15673: Import non active languages from Weblate's Git repository into our main tails.gitConfirmedintrigeri

Bug #15675: Weblate's git repo contains manual modifications which are not translationsResolvedhefee

Feature #16102: List of potential checks we might want to do on PO filesIn Progresshefee

Feature #16326: Review the Weblate-based infrastructure that updates and pushes PO filesConfirmedintrigeri


Related issues

Blocked by Tails - Feature #16328: Merge a stricter version of check_po whose expectations are realistic into our master branch Confirmed 01/08/2019
Blocked by Tails - Feature #15355: Make the ikiwiki PO plugin able to update PO files for languages that are disabled on the website In Progress 03/01/2018

History

#2 Updated by u over 1 year ago

#3 Updated by u about 1 year ago

  • Subject changed from Have the interface communicate with our main Git repository to Have the Weblate Git communicate with our main Git repository

Only reviewed and i18inspector checked translations should make it into our main repository. We need to add hooks to Weblate and Git for this.

#4 Updated by u about 1 year ago

  • Description updated (diff)

#5 Updated by u about 1 year ago

Current pre-receive hook for Main Git (works) - but instead of comparing the committer email we might also want to add an env variable to detect when weblate is pushing.

#!/usr/bin/env python3
# Pre-receive or update hook for main git
# Weblate is only allowed to push po files.

import re, subprocess, sys

expected = "tails-l10n@b.o" # fixme
regex = re.compile(".*\.po$")

# read references from stdin
oldref, newref, refname = sys.stdin.read().split()

# get list of modified revisions
rev_list = subprocess.run("git rev-list %s..%s"%(oldref,newref), check=True, shell=True, stdout=subprocess.PIPE)
revlist = rev_list.stdout.decode().split("\n")
for rev in revlist:
    # Email address of committer, not author
    committer = subprocess.run("git cat-file commit %s | grep 'committer' | grep -o -P '(?<=\<).*(?=\>)'"%rev, shell=True, stdout=subprocess.PIPE)
    # Which files have been modified
    files = subprocess.run("git diff-tree --no-commit-id --name-only -r %s"%rev, shell=True, stdout=subprocess.PIPE)
    if expected == committer.stdout.decode().strip() and not regex.search(files.stdout.decode()):
        print ("[POLICY] Weblate is only allowed to modify po files.")
        sys.exit(-1)
~                    

#6 Updated by bertagaz about 1 year ago

  • Target version changed from Tails_3.7 to Tails_3.8

#7 Updated by intrigeri 11 months ago

  • Target version changed from Tails_3.8 to Tails_3.9

#8 Updated by u 9 months ago

  • Target version changed from Tails_3.9 to Tails_3.10.1

Won't be able to do this in the next 48 hours (release of 3.9)

#9 Updated by intrigeri 7 months ago

  • Target version changed from Tails_3.10.1 to Tails_3.11

#10 Updated by u 7 months ago

  • Assignee changed from u to hefee

#11 Updated by CyrilBrulebois 5 months ago

  • Target version changed from Tails_3.11 to Tails_3.12

#12 Updated by intrigeri 4 months ago

#13 Updated by intrigeri 4 months ago

  • Blocked by Bug #15408: Consider forcing wrapping of po files at 79 chars per line added

#14 Updated by intrigeri 4 months ago

  • Blocked by Bug #15362: Pre-commit hook/Run check_po whenever we try to commit a po file in all Git repositories added

#15 Updated by intrigeri 4 months ago

  • Blocked by Feature #16328: Merge a stricter version of check_po whose expectations are realistic into our master branch added

#16 Updated by intrigeri 4 months ago

  • Blocked by deleted (Bug #15362: Pre-commit hook/Run check_po whenever we try to commit a po file in all Git repositories)

#17 Updated by intrigeri 4 months ago

  • Blocked by deleted (Bug #15408: Consider forcing wrapping of po files at 79 chars per line)

#18 Updated by intrigeri 4 months ago

  • Blocked by deleted (Bug #15403: Unify po headers)

#19 Updated by intrigeri 4 months ago

#20 Updated by intrigeri 4 months ago

  • Target version changed from Tails_3.12 to Tails_3.14

#21 Updated by intrigeri 4 months ago

  • Description updated (diff)

#22 Updated by intrigeri 4 months ago

  • Blocked by Feature #15355: Make the ikiwiki PO plugin able to update PO files for languages that are disabled on the website added

#23 Updated by hefee 3 months ago

  • Description updated (diff)

#24 Updated by hefee 3 months ago

  • Description updated (diff)

update description with current plan from Jan 2018.

#25 Updated by hefee 3 months ago

  • Description updated (diff)

Also available in: Atom PDF