-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for watchlist expiry #1090
Support for watchlist expiry #1090
Conversation
I think it's a great idea! Gadgets like Twinkle is what we suspected would be a major consumer. I certainly have no need to watch someone's user talk indefinitely after issuing them a single warning, same with an XfD I created, but I would for a temporary period if I could. I think people will appreciate this functionality in Twinkle.
The preferences are tied to specific actions such as delete/rollback/etc., so for action=watch there's no preference to fallback to. I have not done much for code review, but as long as the "watchlist" and "watchlistexpiry" parameters are set it the APIs should accept it. Note also you can supply any arbitrary value accepted by PHP's Thanks for doing this work! |
It'd be nice I suppose to supply an action to the watch API and have it use the default pref for that action. Pie in the sky! (ETA: T262912) @MusikAnimal Do you know if there's a timeline or plan for rollout (to enwiki or elsewhere)? Just wondering if/when I'll need to start debugging, etc. |
I don't know that we have an exact timeline yet, but I expect it wouldn't get to any group 2 wikis for another month or so. There'll be a post at WP:VPT a week or two in advance. |
41ff65e
to
09b65b2
Compare
09b65b2
to
e4b3d3e
Compare
Rebased, etc. Moved 3 commits into 2, so that each is logically and functionally sound. Only major change from above is to support I should add that one other way of doing this would be to expand morebits' functions to take a second parameter, and use it if necessary. That'd simplify things here a little bit, but I think it's preferable to bring morebits more in line with how the API actually treats things (noting that things are still in flux). |
e4b3d3e
to
426cffd
Compare
426cffd
to
3228902
Compare
3228902
to
b9891be
Compare
b9891be
to
c10b0f2
Compare
c10b0f2
to
6efc903
Compare
The latest release schedule has this slated to head out everywhere December 1. I wonder if there's any value in pushing out most of this beforehand, hopefully flushing out any bugs in the background reworking. Refamiliarizing myself with it, I think what'd be needed is mainly just removing the expiry options from This is live on testwiki atm, I'll try and keep that updated with this. |
2c88cd3
to
2deba92
Compare
0fa66a0
to
893a36e
Compare
…stFromPreferences Predictably, adds `ctx.watchlistExpiry`. More notably, this also restructures how watchlisting is handled. In particular, `setWatchlist` has been expanded to incorporate `setWatchlistFromPreferences`, which is thus obsoleted and done away with. Correspondingly, `xfd`, `arv`, and `image` have had their ad hoc systems replaced with simple `setWatchlist` calls. Support for the `unwatch` option has also been added, although remains unused by Twinkle itself (note the potential linguistic confusion between "no" and "unwatch"). `undelete`, which does not support watching a page ([phab:T247915]]), of course does not support watchlist expiry. - arv: Work with new enums/remove fromPreferences (spiWatchReport) - image: Work with new enums (deliWatchPage, deliWatchUser) - xfd: Work with new enums (xfdWatchPage, xfdWatchDiscussion, xfdWatchList, xfdWatchUser, xfdWatchRelated)
The meat of the backend was done in `twinkleconfig`. New expiry options have been added to `watchlistEnums`, at the levels of: 1 week, 1 month, 3 months, and 6 months (6 months is the current maximum: https://phabricator.wikimedia.org/T249672). Additionally, I've converted any watchlist booleans to enums; this is not strictly necessary to enable watchlist expiry, but it gives every preference the same level of granularity, and I think would/should be expected. To do this, though, I've added a bit of code to handle conversion of booleans to enums (`true` to `yes`, `false` to `no`). As such, I've bumped the config version to 2.1; there's no major change to the overall structure, but it indicates that a number of preferences have been changed and will be processed differently going forward. That is, old values will work, but new values will not necessarily work on old code. This also adds new options for speedy and fluff (`watchSpeedyExpiry` and `watchRevertedExpiry`) to allow users to specify watchlist behavior, including expiry; both modules had non-standard watch options - fluff's agf/norm/vand and speedy's list of CSD criteria. The conversion of boolean options (prod, tag, warn, welcome) required no changes due to the changes made to morebits' `setWatchlist` in the commit before this (85bb43d). xfd, on the other hand, needed some extra love when nominating modules. Since the `watch` API action only supports watch/unwatch and not `preferences` (T262912), we have to check it ourself using `mw.user.options.get('watchdefault')`. Changes: - xfd: Handle expanded enum options in watching of modules - fluff: New expiry option `watchRevertedExpiry` - speedy: New expiry option `watchSpeedyExpiry` Config changes: - prod: `prodWatchPages` no longer boolean - tag: `watchTaggedPages`, `watchMergeDiscussions` no longer boolean - warn: `watchWarnings` no longer boolean - welcome: `watchWelcomes` no longer boolean
893a36e
to
677d243
Compare
Deployed! I think having the expiry options available and used would just lead to a swallowed API warning, but I've disabled them for the nonce. |
This is still pretty rough — I whipped it up some time last month — but wanted to put this up as a starting point, in case there's any discussion. Watchlist expiries in core can be tested at testWiki, but aren't enabled on enWiki (I'm not sure there's been any discussion about that process).
Basically, this:
watchlistEnums
in twinkleconfigsetWatchlist
and doing away withsetWatchlistFromPreferences
.The major sticking points are:
action=watch
has no way to default to prefs, so can either easily be mostly correct or rather convlutedly be correct (seetwinklexfd
)).@MusikAnimal This is your baby as far as I see, so I'd love your thoughts/feedback on any/all of this at your leisure. I only played with it minimally after it first went live, so I may have missed some specifics in the implementation...