Commit graph

58 commits

Author SHA1 Message Date
jenkins-bot 68f8f589a3 Merge "Generate notifications: fix rollback session failure" 2016-07-19 21:23:15 +00:00
Matthew Flaschen ed626af0ad backfillUnreadWikis: Skip updateCount if race condition detected
Related doc fixes

Change-Id: I1b7545d2f86ec87e9701811ac5f4db0fec690681
2016-07-18 20:58:48 -04:00
Stephane Bisson 4e8e5a794f Generate notifications: fix rollback session failure
Change-Id: Ifbd90549accdbd0edeb979d27583e8f03f1366e5
2016-07-12 09:20:58 -04:00
Matthias Mullie 620d50f23f Change wfWikiId (lowercase d) to wfWikiID (uppercase D)
PHP can handle incorrect capitalization, but we should use the correct function
name.

Change-Id: I6db9bb90a8573f65cde503b771c9539faf38e75e
2016-06-29 15:11:21 +02:00
jenkins-bot 2eabf079f8 Merge "Clean up and fix updateEchoSchemaForSuppression.php" 2016-06-23 20:38:04 +00:00
Roan Kattouw 1d05d9298c backfillUnreadWikis.php: Add rebuild mode
In rebuild mode, we only process users who already have
a row in the euw table. This reduces the number of users
we have to process significantly. Thanks to Stephane
for this idea.

Also, don't force a recache of the alert and message counts,
it's OK to fetch them from cache. We also don't need to invalidate
any caches in this script, because the transition flag from
Ibcc8ac102 will ensure that the cached global counts are
correct.

Change-Id: I69c54cac47468647df2778b2d82f1b5dd9e574d3
2016-06-17 16:02:01 +01:00
Catrope 2771b94af7 Revert "Implement backfillUnreadWikis.php in terms of resetNotificationCount()"
Better idea: invalidate caches in this script, and write
a separate script to recompute existing euw rows.

This reverts commit c83af257d2.

Change-Id: I57bccfb726eada646cb318206d9091a20d59dcf5
2016-06-17 13:43:29 +00:00
Stephane Bisson 8520074d28 Maintenance script generates edit-thank notifications
Bug: T120152
Change-Id: I896fc133b781180b3bb8f1fbd2addaa99f9dc653
2016-06-16 17:46:51 +01:00
Stephane Bisson e8bc56e5d9 Don't set title for user-rights notifications
Same as I584c1150e4c98bb814e30bf6a6d3eb3e49ef6408
for the notifications generation script.

Change-Id: I3b13db662671a9e57f944171108a3b48544f784a
2016-06-14 10:38:41 -04:00
jenkins-bot d3e1846666 Merge "Implement backfillUnreadWikis.php in terms of resetNotificationCount()" 2016-06-11 15:54:55 +00:00
jenkins-bot 59473cc73a Merge "Add script to remove orphaned event rows" 2016-06-09 17:09:56 +00:00
Roan Kattouw c83af257d2 Implement backfillUnreadWikis.php in terms of resetNotificationCount()
This causes it to update the notification count cache as well.
Should we perhaps rename it to recacheNotificationCounts.php?

Bug: T132954
Change-Id: I540c4296f4fbadcf2267d77b53f71ee5c2eb8b52
2016-06-08 16:16:37 +02:00
Roan Kattouw 4c6cadfb27 Add script to remove orphaned event rows
Bug: T136425
Change-Id: Id42a893be81176f37d9d5e3fd7e850d3a6d42e10
2016-06-07 23:34:53 +02:00
Stephane Bisson 5072e87c0b backfillReadBundles.php: Use sub-select to target rows to update
UPDATE based on (user,display_hash) index

Bug: T136368
Change-Id: If3348c2e663517b632c9ff3194dd4a197c74159b
2016-06-07 14:01:32 +00:00
Roan Kattouw 99377e5525 Clean up and fix updateEchoSchemaForSuppression.php
This script was supposed to be run in production in 2013, but that
never happened. It was also never added to update.php.

* Use makeTitleSafe instead of newFromText, for correctness
* Fetch the columns that the update generator needs
* Replace wrapper for private method with closure
* Make the maintenance script logged

Bug: T136427
Bug: T50059
Change-Id: I6c2972120189f035483b5ca49610c008c4ba2c88
2016-06-06 23:56:28 +02:00
Roan Kattouw ca598c3420 backfillUnreadBundles.php: Use the correct database
Change-Id: Id2706b3baa410b7f42b8c7febdb96cd142558988
2016-06-06 21:11:19 +02:00
Stephane Bisson b3d168964c Maintenance: Backfill read timestamp on bundled notifications
This maintenance script sets the correct read_timestamp
on notifications that have been read as part of a
bundle.

Bug: T136368
Change-Id: I735fb230a14f95e0a983e733ec160eb8811b3197
2016-06-02 13:42:09 -04:00
Roan Kattouw 0807c3c5ad NotifUser: Refactor getNotificationCount() and friends, add caching for global counts
Previously, getNotificationCount() only looked at local notifications,
and foreign notifications were added in separately by getMessageCount()
and getAlertCount(). This didn't make any sense and resulted in
counter-intuitive things like I4d49b543.

Instead, add a $global flag to getNotificationCount(). If $global=false,
the local count is returned as before, but if $global=true, the
global count (=local+foreign) is returned. If $global is omitted,
the user's cross-wiki notification preference determines which is returned.

Update getLastUnreadNotificationCount() in the same way, since it had
the same issues.

Also add caching for global counts and timestamps, using a global
memc key.

Bug: T133623
Change-Id: If78bfc710acd91a075771b565cc99f4c302a104d
2016-05-02 16:16:57 -07:00
Stephane Bisson 9d6e6528ba Support generating sample notifications by types
Also added the force (-f) option to
bypass the confirmation. Very useful
when using the script in a loop.

Change-Id: I98c3e0408033903f8e2fb0afab773d4952a4e6d3
2016-03-02 15:04:56 -05:00
Stephane Bisson 74879c39fb Truncate secondary link labels
Bug: T121822
Change-Id: I3e36a6cd4bc8da96879158e1d7b65fd3a1d582fb
2016-02-18 06:55:36 -05:00
Stephane Bisson 467eeaf2e9 generateSampleNotifications.php: Generate OpenStackManager notifications
Change-Id: Iaddfa08e42735fd6befbe4c7b3e54b3f4e7f62d9
2016-02-15 19:55:47 +00:00
Stephane Bisson 88b16a0c81 Generate bundled page-linked notifications in test script
Change-Id: I6414c920e3a29ea5048819433aa86f41d8f54e69
2016-02-12 14:45:32 -05:00
jenkins-bot 9c7c869a29 Merge "Generate CX notifications in maintenance script" 2016-02-12 19:38:12 +00:00
Stephane Bisson 442f812774 Add subject to email notification body
Bug: T121831
Change-Id: Ib1a9212202d2c84de8d968d043f65e24b2d94fae
2016-02-10 12:34:26 -05:00
Stephane Bisson 522a79393d Generate CX notifications in maintenance script
Change-Id: Iec2f4b9d0815da1bf8ccdd5610f403133eeb4262
2016-02-08 10:37:49 -05:00
Stephane Bisson cbe602ee64 Generate sample notifications
Maintenance script that generates sample
notifications for Echo.

Change-Id: I5c88920a417a04cfd06d281f23b4c77368091776
2016-01-28 10:45:57 -05:00
Roan Kattouw 9f7fba935f Add progress markers to backfillUnreadWikis.php
Change-Id: I43fe3d9998b5ebf3ddbec9ced0394c70293b6f18
2016-01-18 19:14:34 -08:00
jenkins-bot 027e9b7431 Merge "Backfill echo_unread_wikis table" 2016-01-11 22:31:38 +00:00
Aaron Schulz 576303e03a Use Maintenance DB transaction methods
Change-Id: I0acde61f57240c95d8f2b8afd55bffbe7b5b98fb
2015-12-31 15:12:05 -08:00
Matthias Mullie ecd150888e Backfill echo_unread_wikis table
Bug: T119523
Change-Id: I13a7d349e7e3a66eb4e9ea3b26578fdd877e83a6
2015-12-16 19:52:16 +01:00
Geoffrey Mon 13948c949f Replace EchoBatchRowUpdate with BatchRowUpdate
Also removes tests for the class.

Bug: T119253
Change-Id: I4c0d7187c2b847297dd0867faecba26185cfba37
Depends-On: Iccafbbdb06711463fee0f30a11326c7771df30e2
2015-12-16 16:36:59 +00:00
Thiemo Mättig 66d5e17a25 Fix broken and incomplete PHPDoc tags
Change-Id: I0c8928a2dbf67cb15841fae6cc55c363357ec265
2015-12-14 11:03:09 +01:00
James D. Forrester 1e01328018 build: Enable phpcs rule 'MediaWiki.VariableAnalysis.UnusedGlobalVariables' and make pass
Change-Id: I1af3e34531ff9d02183a7ad0052712d9f137609c
2015-10-29 17:25:51 +00:00
James D. Forrester a49e3a592e build: Enable phpcs rule 'Squiz.Classes.ValidClassName.NotCamelCaps' and make pass
Change-Id: I3d8b9c04ef2be3fe456c2c66bb10afa11ba0cd45
2015-10-29 18:24:45 +01:00
James D. Forrester 852ddaf903 build: Enable phpcs rule 'MediaWiki.Usage.DirUsage.FunctionFound' and make pass
Change-Id: I05c9299944a5a8e215ecb2996f1a3846e257e12c
2015-10-29 12:57:40 +01:00
James D. Forrester becbea0941 build: Enable phpcs rule 'Squiz.WhiteSpace.LanguageConstructSpacing.Incorrect' and make pass
Change-Id: I9379c18263474ed13921791b920c7b06e58a84ad
2015-10-29 12:56:33 +01:00
Siebrand Mazeland 33126b69aa Update formatting
In preparation of Code Sniffer based updates.

Change-Id: Id5d43332b44a37665d57dc24ef8c432bc65b2f6a
2015-10-03 23:28:54 -04:00
Alex Monk 6157c1e7bb Make processEchoEmailBatch check that Echo is actually enabled before doing anything
Like CentralAuth does in createLocalAccount.php. In large wiki clusters where
you want Echo on for some wikis and not others, but don't want to keep a list
of Echo wikis (say, you want to make it on by default), this makes it possible
to safely run the script even on wikis where Echo is not enabled, where it will
just do nothing.

See also Ibde4c0c1, I741d2485

Bug: T59375
Change-Id: I3537206fccb459eb80de9fd61d2213dfb525c5f0
2015-05-31 13:25:37 +01:00
Stephane Bisson 3bfa823922 Maintenance script sends notifications immediately
Update the "processEchoEmailBatch" to allow sending all
notifications immediately even if configured to be
daily or weekly.

Change-Id: I6ebeea86708247700d1950e0f6471c7b3d1fecd2
2015-05-27 14:02:51 +02:00
bsitu b35f27c291 Delete invalid records from echo_target_page
Remove the records:

* If a page is no longer valid

* If a notification somehow has been read

* If a notification is no longer a bundle base and has not been removed

Change-Id: I282568691d6649c6e3263aea598c3bba29119a29
2014-08-19 11:34:01 -07:00
bsitu 76d8822b84 Remove invalid maintenance scripts
These maintenance scripts have never run before and will never run in
the future.  We decided that we don't understand user_properties table
enough to mess with it, and we went with another simpler approach instead

Change-Id: Ic33375a579267aca40a54d74f839fee042afc24f
2013-07-03 12:09:45 -07:00
Erik Bernhardson f38ce97efd Database updates for respecting oversight within Echo
Provides the first step of adding and populating a new database field
for Echo oversight deployment.  The new field is populated via a
maintenance script and Event::loadFromRow will accept both new and old
results.  Everything will still run when the 2 now unused fields are
later dropped from the db.

Bug: 48059
Change-Id: I24d4b61a061f94ed9aaaa6087f33b2ab37f773cd
2013-06-10 14:52:18 -07:00
bsitu 11aa91f1a0 Fix the maintenance script
It should wait for slave during each batch update

Change-Id: Iba8b172016317236981c11b4f9af9bb1723516ec
2013-05-03 18:52:05 -07:00
bsitu 5df153591d Add extra db slave wait to digest email cron
Change-Id: Iaa5fc89750b2a4bbe5d52bb9e75c2ac90fc3304b
2013-05-02 14:12:40 -07:00
kaldari 95c9825b83 Adding maintenance file for updating user caches after CopyExistingEmailPreference
Change-Id: If938e352e4aaa44d1e9e0718cc1bece26c7a7f74
2013-04-29 18:40:12 -07:00
lwelling 7c3bd0f3a0 Maintenance script to copy the preference of existing users who have opted out
of talk page email notifications to the analogous setting in the Echo version of
talk notifications

Change-Id: I5cdaf261d042f3586d2d02fed672ee35df5a9b90
2013-04-29 16:16:19 -04:00
kaldari 1d52f9c835 A maintenance script for pre-emptively updating email notice option
This script is designed to be run prior to the Echo deployment.

Change-Id: I66f532f21183109c6c3c997fa0e666cb19bfc832
2013-04-29 11:44:44 -07:00
Reedy adffeae19d Move maintenance scripts to maintenance directory
Left fixme comment

Change-Id: I30207558d21bb73c6caa6dd722016bc51b257395
2013-04-22 22:52:21 +01:00
jenkins-bot 4ee55737e8 Merge "Let maintenance script wait for slaves on the correct cluster" 2013-04-11 17:57:34 +00:00
Matthias Mullie 836aae69d2 Let maintenance script wait for slaves on the correct cluster
Change-Id: I45872e0912ed5949586a15ae77123c8f1bb6151c
2013-04-11 10:34:20 -07:00