Repository navigation
feat(pull): pull the pages on your watchlist with --watchlist - #43
Merged
Merged
Conversation
pull --watchlist lists the logged-in user's watchlist through generator=watchlistraw and pulls its pages alongside any titles, categories and prefixes. Reading a watchlist needs a login, so --watchlist logs in with the same per-wiki bot password as push --apply; the bot password needs the "View your watchlist" grant. The rest of pull stays anonymous. Watching a page also watches its talk page, so talk namespaces are left out; watched titles with no page are counted and reported, not pulled. Translations and --max are handled as for --category, before any text is fetched. Without credentials pull --watchlist exits 2 and names the variables; a failed login exits 1 before the watchlist is requested. A permissiondenied error names the missing grant. The integration wiki now creates a second bot password without the watchlist grants, and a new integration test logs in, watches a page and a missing title, and checks the listing and both error paths. It runs only against that throwaway wiki, since it changes the watchlist. Closes #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pull --watchlistpulls the pages on your watchlist, alongside any titles,--categoryand--prefix.--watchlistlogs in with the same per-wiki bot password aspush --apply. The bot password needs the View your watchlist grant. The rest ofpullstays anonymous.--maxare handled as for--category, before any text is fetched.permissiondeniederror names the missing grant.On Appropedia (MediaWiki 1.45.5), an anonymous
list=watchlistrawreturnsnotloggedin, and./bin/wikisync pull --host www.appropedia.org --dir <scratch> --watchlistwithout credentials exits 2 with the variable names.Integration:
scripts/test-wiki.shnow grantsviewmywatchlist,editmywatchlistto the test bot password and creates a second one with onlybasic.TestLiveWatchlistlogs in, watches the fixture page and a missing title, and checks the listing (page present, talk page and missing title left out, missing counted), the anonymous error and the no-grant hint. It runs only againstWIKISYNC_TEST_API_URL, never a real wiki's host, since it changes the account's watchlist.Each new unit test fails when the behaviour it names is broken: keeping talk pages or missing titles, not parsing
missing, the wrong generator, the grant hint never or always shown, the watchlist alone not counting as a selection, watched pages or the missing count dropped, skipping the login, and not refusing missing credentials.Closes #22