[MediaWiki-commits] [Gerrit] Log publishing errors to eventlogging for future analysis an... - change (mediawiki...ContentTranslation)

2015-04-09 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Log publishing errors to eventlogging for future analysis and 
fix
..


Log publishing errors to eventlogging for future analysis and fix

Uses Schema:ContentTranslationError
https://meta.wikimedia.org/wiki/Schema:ContentTranslationError

Change-Id: I0c6e8b99ac7e6e02a15bd1bdd57d2b321dcd49d2
---
M ContentTranslation.hooks.php
M modules/eventlogging/ext.cx.eventlogging.js
M modules/publish/ext.cx.publish.js
3 files changed, 16 insertions(+), 2 deletions(-)

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



diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php
index 268239a..d2bb80d 100644
--- a/ContentTranslation.hooks.php
+++ b/ContentTranslation.hooks.php
@@ -112,6 +112,7 @@
public static function addEventLogging( array $schemas ) {
$schemas['ContentTranslation'] = 11628043;
$schemas['ContentTranslationCTA'] = 11616099;
+   $schemas['ContentTranslationError'] = 11767097;
}
 
/**
diff --git a/modules/eventlogging/ext.cx.eventlogging.js 
b/modules/eventlogging/ext.cx.eventlogging.js
index c4c7e1b..5accd61 100644
--- a/modules/eventlogging/ext.cx.eventlogging.js
+++ b/modules/eventlogging/ext.cx.eventlogging.js
@@ -61,8 +61,9 @@
 * @param {string} targetLanguage Target language code
 * @param {string} sourceTitle Source title
 * @param {string} targetTitle Target title
+* @param {string} trace Error trace
 */
-   publishFailed: function ( sourceLanguage, targetLanguage, 
sourceTitle, targetTitle ) {
+   publishFailed: function ( sourceLanguage, targetLanguage, 
sourceTitle, targetTitle, trace ) {
mw.track( 'event.ContentTranslation', {
version: 1,
token: mw.user.id(),
@@ -73,6 +74,17 @@
sourceTitle: sourceTitle,
targetTitle: targetTitle
} );
+   mw.track( 'event.ContentTranslationError', {
+   version: 1,
+   token: mw.user.id(),
+   session: mw.user.sessionId(),
+   context: 'publish-failure',
+   sourceLanguage: sourceLanguage,
+   targetLanguage: targetLanguage,
+   sourceTitle: sourceTitle,
+   targetTitle: targetTitle,
+   trace: trace.substring( 0, 500 )
+   } );
},
 
/**
diff --git a/modules/publish/ext.cx.publish.js 
b/modules/publish/ext.cx.publish.js
index 233ffa2..42e9508 100644
--- a/modules/publish/ext.cx.publish.js
+++ b/modules/publish/ext.cx.publish.js
@@ -283,7 +283,8 @@
mw.cx.sourceLanguage,
mw.cx.targetLanguage,
mw.cx.sourceTitle,
-   this.targetTitle
+   this.targetTitle,
+   JSON.stringify( details )
);
mw.hook( 'mw.cx.error' ).fire( mw.msg( 'cx-publish-page-error' 
) );
mw.log( '[CX] Error while publishing:', code, trace );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c6e8b99ac7e6e02a15bd1bdd57d2b321dcd49d2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Log publishing errors to eventlogging for future analysis an... - change (mediawiki...ContentTranslation)

2015-04-08 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/202993

Change subject: Log publishing errors to eventlogging for future analysis and 
fix
..

Log publishing errors to eventlogging for future analysis and fix

Uses Schema:ContentTranslationError
https://meta.wikimedia.org/wiki/Schema:ContentTranslationError

Change-Id: I0c6e8b99ac7e6e02a15bd1bdd57d2b321dcd49d2
---
M ContentTranslation.hooks.php
M modules/eventlogging/ext.cx.eventlogging.js
M modules/publish/ext.cx.publish.js
3 files changed, 16 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/93/202993/1

diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php
index 268239a..d2bb80d 100644
--- a/ContentTranslation.hooks.php
+++ b/ContentTranslation.hooks.php
@@ -112,6 +112,7 @@
public static function addEventLogging( array $schemas ) {
$schemas['ContentTranslation'] = 11628043;
$schemas['ContentTranslationCTA'] = 11616099;
+   $schemas['ContentTranslationError'] = 11767097;
}
 
/**
diff --git a/modules/eventlogging/ext.cx.eventlogging.js 
b/modules/eventlogging/ext.cx.eventlogging.js
index c4c7e1b..09c7bf7 100644
--- a/modules/eventlogging/ext.cx.eventlogging.js
+++ b/modules/eventlogging/ext.cx.eventlogging.js
@@ -61,8 +61,9 @@
 * @param {string} targetLanguage Target language code
 * @param {string} sourceTitle Source title
 * @param {string} targetTitle Target title
+* @param {string} trace Error trace
 */
-   publishFailed: function ( sourceLanguage, targetLanguage, 
sourceTitle, targetTitle ) {
+   publishFailed: function ( sourceLanguage, targetLanguage, 
sourceTitle, targetTitle, trace ) {
mw.track( 'event.ContentTranslation', {
version: 1,
token: mw.user.id(),
@@ -73,6 +74,17 @@
sourceTitle: sourceTitle,
targetTitle: targetTitle
} );
+   mw.track( 'event.ContentTranslationError', {
+   version: 1,
+   token: mw.user.id(),
+   session: mw.user.sessionId(),
+   context: 'publish-failure',
+   sourceLanguage: sourceLanguage,
+   targetLanguage: targetLanguage,
+   sourceTitle: sourceTitle,
+   targetTitle: targetTitle,
+   trace: trace
+   } );
},
 
/**
diff --git a/modules/publish/ext.cx.publish.js 
b/modules/publish/ext.cx.publish.js
index 233ffa2..42e9508 100644
--- a/modules/publish/ext.cx.publish.js
+++ b/modules/publish/ext.cx.publish.js
@@ -283,7 +283,8 @@
mw.cx.sourceLanguage,
mw.cx.targetLanguage,
mw.cx.sourceTitle,
-   this.targetTitle
+   this.targetTitle,
+   JSON.stringify( details )
);
mw.hook( 'mw.cx.error' ).fire( mw.msg( 'cx-publish-page-error' 
) );
mw.log( '[CX] Error while publishing:', code, trace );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c6e8b99ac7e6e02a15bd1bdd57d2b321dcd49d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com

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