Page MenuHomePhabricator

Track failed/timed-out messages updates and display them to the administrator
Closed, ResolvedPublic

Description

Currently we're tracking message updates and displaying groups that are being processed. When a MessageUpdate job fails or times out, we add an error log but that is not actionable or easy to look back on. Eventually we want to stop imports / exports from translatewiki.net based on these failures, so it's important to display them clearly to translation administrators.

This could be done by,

Display current failures to administrators on Special:ManageMessageGroups with the list of groups, and the message updates that failed in a dialog.

  • Each message listed should link to the message on the wiki, it's history
  • For the group it would be useful to have the remote repository URL

Track historical data via Special:Log. Eventually when administrators mark failures as fixed it can be tracked here as well.

Implementation

Updates to Group Synchronization Cache

The current errors until they are resolved by the administrator will be tracked via the Group synchronization cache.

We will track,

  1. the groups that are in error
  2. each message update that failed

The way I'm planning to track errors:

Store groups that have errors:

  • Key: gsc_%error%_$groupId (prefixed with hash)
  • Hash: substr( hash( 'sha256', $groupId ), 0, 40 );
  • Value: JSON serialized- GroupSynchronizationResponse (without the $remainingMessages)
  • Exp Time: None
  • Tag: gsc_%group_with_error%

Each message that have error will be added:

  • Key: gsc_%error%_$groupId_$messageKey (prefixed with hash)
  • Hash: substr( hash( 'sha256', $key ), 0, 40 ) where $key = $groupId . '_' . $messageKey;
  • Value: MessageUpdateParameter object
  • Exp Time: None
  • Tag: gsc_%error%_$groupId

Class changes:

  • Add new property for MessageUpdateParameter: $result (string) (This will have the error)

New methods to be added:

  • addGroupErrors(GroupSynchornizationResponse $response): void - To add groups and their remaining messages to the cache
  • getGroupsWithErrors(): string[] - Returns groupIds that have errors
  • getGroupErrors(): GroupSynchronizationResponse (with remainingMessages set)

Event Timeline

abi_ triaged this task as Medium priority.Feb 2 2021, 8:43 PM

Change 662991 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Add code to track failed groups and their messages

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

Change 666522 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Move code to display group synchronization information to another class

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

Change 666522 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Move code to display group synchronization information to another class

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

Change 662991 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Add code to track groups with errors and failed messages

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

abi_ moved this task from In Progress to Done on the Language-Team (Language-2021-April-June) board.

This has been deployed on translatewiki.net and is working as expected.

These two things are not done:

  1. For the group it would be useful to have the remote repository URL - There is no easy way to do this as we don't have access to repoconfig.yaml in the Translate extension.
  2. Track historical data via Special:Log. Eventually when administrators mark failures as fixed/resolved it can be tracked here as well. - This is being tracked separately in the parent task.