jenkins-bot has submitted this change and it was merged.

Change subject: Add export features to repong
......................................................................


Add export features to repong

- Can now indicate to only export for languages with translations in the latest 
n hours.
- Can now indicate to not export certain languages.
- Can now indicate to force export of certain languages.

Example configuration:

Example from repoconfig.commit.json:

"europeana": {
        "group": "out-europeana",
        "export-threshold": 75,
        "export-hours": 200,
        "no-export-languages": 
"ady,aeb,bbc,be-x-old,crh,dk,en,fiu-vro,gan,gom,got,hif,iu,kbd,kk,kk-cn,kk-kz,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,test,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-hk,zh-min-nan,zh-mo,zh-my,zh-sg,zh-tw,zh-yue",
        "always-export-languages": "nl, fr",
        "export-threshold": 75,
        "repos": {
                "europeana": {
                        "type": "git",
                        "url": 
"g...@github.com:europeana/Europeana1914-1918.git"
                }
        }
}

Change-Id: Ic6cc5821093caa400976a15f055e41bf4d030b03
---
M repong/repong.php
1 file changed, 25 insertions(+), 1 deletion(-)

Approvals:
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified

Objections:
  Nikerabbit: There's a problem with this change, please improve



diff --git a/repong/repong.php b/repong/repong.php
index 325b26c..95f9960 100644
--- a/repong/repong.php
+++ b/repong/repong.php
@@ -43,11 +43,22 @@
 
        public function export() {
                $exporter = $this->meta['export'];
+               $hours = '';
                $group = " --group='" . $this->config['group'] . "'";
                $lang = " --lang='*'";
                $skip = " --skip='en,qqq'";
                $threshold = ' --threshold=35';
                $base = " --target='" . $this->meta['basepath'] . "'";
+
+               if ( isset( $this->config['export-hours'] ) ) {
+                       $hours = (int)$this->config['export-hours'];
+                       $hours = " --hours='$hours'";
+               }
+
+               if ( isset( $this->config['no-export-languages'] ) ) {
+                       $skip = $this->config['no-export-languages'];
+                       $skip = " --skip='$skip'";
+               }
 
                if ( isset( $this->config['export-threshold'] ) ) {
                        $threshold = (int)$this->config['export-threshold'];
@@ -55,7 +66,7 @@
                }
 
                // First normal export
-               $command = "$exporter$group$lang$skip$threshold$base";
+               $command = "$exporter$hours$group$lang$skip$threshold$base";
                echo "$command\n";
 
                $process = new Process( $command );
@@ -72,6 +83,19 @@
                $process->mustRun();
                $process->setTimeout( 30 );
                print $process->getOutput();
+
+               // Last languages that have a forced export
+               if ( isset( $this->config['always-export-languages'] ) ) {
+                       $lang = $this->config['always-export-languages'];
+                       $lang = " --lang='$lang'";
+                       $command = "$exporter$hours$group$lang$base";
+                       echo "$command\n";
+
+                       $process = new Process( $command );
+                       $process->mustRun();
+                       $process->setTimeout( 120 );
+                       print $process->getOutput();
+               }
        }
 
        public function commit() {

-- 
To view, visit https://gerrit.wikimedia.org/r/290201
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6cc5821093caa400976a15f055e41bf4d030b03
Gerrit-PatchSet: 2
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to