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 almost 2 years ago. Updated 5 months ago.

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

100%

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

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 gitResolved

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

Bug #15356: Automate adding new components to WeblateDuplicate

Bug #15402: update hook for Main git when handling push from weblateResolved

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

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

Feature #16842: update_weblate_git.py: don't create merge commits when we could fast-forwardResolved


Related issues

Related to 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
Blocked by Tails - Feature #16328: Merge a stricter version of check_po whose expectations are realistic into our master branch Resolved 01/08/2019

History

#2 Updated by u almost 2 years ago

#3 Updated by u almost 2 years 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 almost 2 years ago

  • Description updated (diff)

#5 Updated by u over 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 over 1 year ago

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

#7 Updated by intrigeri over 1 year ago

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

#8 Updated by u over 1 year 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 about 1 year ago

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

#10 Updated by u about 1 year ago

  • Assignee changed from u to hefee

#11 Updated by CyrilBrulebois 12 months ago

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

#12 Updated by intrigeri 11 months ago

#13 Updated by intrigeri 11 months ago

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

#14 Updated by intrigeri 11 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 11 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 11 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 11 months ago

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

#18 Updated by intrigeri 11 months ago

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

#19 Updated by intrigeri 11 months ago

#20 Updated by intrigeri 11 months ago

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

#21 Updated by intrigeri 11 months ago

  • Description updated (diff)

#22 Updated by intrigeri 11 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 10 months ago

  • Description updated (diff)

#24 Updated by hefee 10 months ago

  • Description updated (diff)

update description with current plan from Jan 2018.

#25 Updated by hefee 10 months ago

  • Description updated (diff)

#26 Updated by CyrilBrulebois 7 months ago

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

#27 Updated by hefee 7 months ago

  • Target version deleted (Tails_3.15)

#28 Updated by intrigeri 5 months ago

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

#29 Updated by intrigeri 5 months ago

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

#30 Updated by intrigeri 5 months ago

  • Status changed from Confirmed to Resolved
  • Affected tool set to Translation Platform

This. Is. Now. Live. Believe it or not. Go, robots, go!

#31 Updated by intrigeri 5 months ago

  • Assignee deleted (hefee)

Also available in: Atom PDF