Skip to content

feat(pull): pull the pages on your watchlist with --watchlist - #43

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/watchlist
Nov 13, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/watchlist

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

pull --watchlist pulls the pages on your watchlist, alongside any titles, --category and --prefix.

  • 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 on stderr, not pulled.
  • Translations and --max are handled as for --category, before any text is fetched.
  • No credentials: exit 2, naming the variables. A failed login: exit 1, before the watchlist is requested. A permissiondenied error names the missing grant.

On Appropedia (MediaWiki 1.45.5), an anonymous list=watchlistraw returns notloggedin, and ./bin/wikisync pull --host www.appropedia.org --dir <scratch> --watchlist without credentials exits 2 with the variable names.

Integration: scripts/test-wiki.sh now grants viewmywatchlist,editmywatchlist to the test bot password and creates a second one with only basic. TestLiveWatchlist logs 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 against WIKISYNC_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

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
@CameronBrooks11
CameronBrooks11 merged commit e6fbc65 into main Nov 13, 2026
11 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/watchlist branch November 13, 2026 02:18
CameronBrooks11 added a commit that referenced this pull request Nov 13, 2026
chore: bump version to 0.5.0

Prepares v0.5.0: the version constant becomes 0.5.0, and the
CHANGELOG's Unreleased section becomes 0.5.0. User-facing change since
v0.4.0: #43 (pull --watchlist pulls the pages on your watchlist, #22).
The tag is pushed after this merges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pull: pull the pages on your watchlist

1 participant