push_to_wiki: surface MW login reason/details on failure#15
Merged
Conversation
The current login error handler prints only `result` (always the generic bucket "Failed" / "Aborted" / etc.), throwing away the `reason` field that MediaWiki includes with non-Success responses. That makes auth failures undiagnosable from CI logs without re-running. Surface `reason` and the optional `details` field. Neither contains the password or any other secret — they're MW's human-readable error strings like "Incorrect password", "User is locked", "Bot password has been revoked", or IP-restriction messages. Motivated by the recent post-merge sync of #14 failing with bare `Login failed: Failed` — the same secrets had succeeded 5 minutes earlier for #13's sync, so the actual reason matters for triage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Citations Summary
|
Merged
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.
The current login error handler in `scripts/push_to_wiki.py` prints only the `result` field (always the generic bucket "Failed" / "Aborted" / "WrongPass" / etc.) and throws away the `reason` field that MediaWiki includes with non-Success responses. That makes auth failures undiagnosable from CI logs without re-running and guessing.
Surface `reason` and the optional `details` field on login failure. Neither contains the password or any other secret — they're MW's human-readable error strings:
Motivation
The post-merge sync of #14 failed with bare `Login failed: Failed` — and the same secrets succeeded 5 minutes earlier for #13. Manual re-dispatch produced the same opaque error. The actual reason matters for triage, but the current code hides it.
With this patch the next failure logs e.g. `Login failed: Failed — Incorrect password` and we can fix the underlying issue directly.
Tests
112/112 pass. (No new tests — this is a print-only diagnostic change.)
🤖 Generated with Claude Code