Skip to content

refactor(core): simplify the pull API - #54

Merged
CameronBrooks11 merged 1 commit into
mainfrom
refactor/pull-api
Nov 13, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
refactor/pull-api

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

The pull path had layers left over from before batched fetching:

  • Pull takes the fetched pages (map[string]mw.FetchedPage, keyed by the title as requested) instead of a per-title callback. Its only caller, PullSet, already had the map and wrapped it back into a callback that couldn't fail.
  • Lister gains FetchPages and becomes Source, so main no longer passes the client twice (client, client.FetchPages).
  • A host and path travel together as core.Wiki, which ResolveWiki returns. Its private wiki type is gone.

Signatures:

before: PullSet(sel, list, fetch, root, host, path, force)
after:  PullSet(sel, src, root, wiki, force)

The diff is about neutral in size (+126/−119): most of it is test call sites moving to the new signatures. go vet and golangci-lint are clean with -tags integration, and nothing user-visible changes, so there's no changelog entry.

Closes #47

Pull fetched one title at a time through a callback, but its only
caller, PullSet, had already fetched every page in batches and wrapped
the map back into a callback that could not fail. Pull now takes the
fetched pages.

PullSet took 7 positional arguments, with the client passed twice
(client, client.FetchPages). Lister gains FetchPages and becomes
Source, and a host and path travel together as a Wiki, which
ResolveWiki now returns. PullSet(sel, src, root, wiki, force).

No change to behaviour or output.

Closes #47
@CameronBrooks11
CameronBrooks11 merged commit 1197ed5 into main Nov 13, 2026
9 checks passed
@CameronBrooks11
CameronBrooks11 deleted the refactor/pull-api branch November 13, 2026 17:15
CameronBrooks11 added a commit that referenced this pull request Nov 13, 2026
Prepares v0.5.1: the version constant becomes 0.5.1, and the CHANGELOG's
Unreleased section becomes 0.5.1. User-facing changes since v0.5.0: #52
(HTTP status on login and edit errors, #45), #53 (conflict check reads
the revision id only, #46), #61 (login failure and count wording, #56),
#62 (push read-back warning, #58). The rest are refactors with no change
in behaviour: #54, #55, #57, #59, #60. 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.

core: simplify the pull API

1 participant