Repository navigation
test: run the push round-trip against a throwaway MediaWiki in CI - #10
Merged
Merged
Conversation
After each step, assert that the manifest revision, the baseline and the working file all match what the wiki actually stores, and that status reports unchanged. Add a second push (must be a no-op), a whitespace-only change (the wiki makes no new revision), and an out-of-band edit (push must refuse, in preview and with --apply). Restore the fixture with a direct API edit so it works after the conflict step.
scripts/test-wiki.sh starts mediawiki:1.45.6 in Docker, installs it on SQLite with a random admin password, and creates a bot password and a fixture page. just test-integration runs the round-trip test against it, and a new CI job runs that on every PR, gated by ok. No secrets are stored and no real wiki is touched. The live-wiki run moves to just test-live. Both recipes set WIKISYNC_REQUIRE_INTEGRATION, so missing config fails the run instead of skipping it. mw gains NewClientForAPI for a full api.php URL (the test wiki is plain http on localhost).
extractions/setup-just lists casey/just's releases through the GitHub API on every run, and the version input only filters that list. When the call returns nothing the step fails with 'no release for just matching version specifier'. That happened on two of eight installs on 2026-10-22, before any of our code ran. A local composite action now downloads just 1.40.0 directly and checks it against the SHA-256 from upstream's SHA256SUMS. All three jobs use it.
FetchPage, RevisionText and the token request decoded the response without
checking MediaWiki's {"error":{"code","info"}} envelope, so an API error
surfaced as a misleading 'no page in response' or 'no token'. They now
return the API's code and message.
createBotPassword prints the new password on success, and that output went to the job log. The credential only works on a container reachable from inside the job and deleted after it, but secrets don't belong in logs. Its stdout is now discarded; errors still go to stderr.
createBotPassword grants exactly what --grants lists, unlike Special:BotPasswords, which always adds 'basic' (it carries 'read'). With only 'editpage', the logged-in test bot got readapidenied on its first read after login, which CI showed once API errors were reported. Readiness now also requires the fixture page to be readable anonymously, not just siteinfo, and dumps the response and LocalSettings permission lines if it never is.
This was referenced Oct 22, 2026
Merged
CameronBrooks11
added a commit
that referenced
this pull request
Oct 22, 2026
* docs: say push --apply is CI-tested against MediaWiki, pending Appropedia The experimental note said push --apply was unverified against any live wiki. Since #10 it runs against a real MediaWiki 1.45 on every change; it is still not run against Appropedia itself (#12), so it stays experimental. * chore: bump version to 0.1.1
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.
What
Adds the middle testing layer: the push round-trip test runs against a
throwaway MediaWiki 1.45 in Docker on every PR. It needs no secrets and never
touches a real wiki.
scripts/test-wiki.sh up|downstartsmediawiki:1.45.6(Appropedia runs1.45.x), installs it on SQLite with a random admin password, creates a bot
password and a fixture page, waits until
api.phpanswers, and prints the envexports. CI and contributors use the same script.
just test-integrationruns it, then the round-trip test, then tears thecontainer down. New CI job Integration (MediaWiki), required through
ok.revision, baseline, working file and
statusmust match what the wiki stored.It also covers a second push (no-op), a whitespace-only change (null edit, no
new revision), and an out-of-band edit (
pushmust refuse in preview and with--apply), then restores the fixture byte-for-byte.just test-live. Both recipes setWIKISYNC_REQUIRE_INTEGRATION, so missing config fails instead of skipping.Checked locally:
just test-livewith no env exits 1.mw.NewClientForAPI(apiURL, ua)for a fullapi.phpURL; the test wiki isplain
httpon localhost.[doc()]sojust --listshows the right line.Verification
Locally:
go vetunder both tag sets,bash -nand shellcheck on the script,just --listoutput, and the fail-not-skip behaviour. Docker is not reachablefrom the session that wrote this, so this PR's CI run is the first execution of
the script. The maintenance-script options (
install --scriptpath=,createBotPassword32-character password and--grants,edit) were checkedagainst the REL1_45 sources.