Skip to content

push_to_wiki: surface MW login reason/details on failure#15

Merged
daharoni merged 1 commit into
mainfrom
debug-wiki-login-failure
May 11, 2026
Merged

push_to_wiki: surface MW login reason/details on failure#15
daharoni merged 1 commit into
mainfrom
debug-wiki-login-failure

Conversation

@daharoni
Copy link
Copy Markdown
Contributor

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:

  • `"Incorrect password"`
  • `"User is locked"`
  • `"Bot password has been revoked"`
  • IP-restriction messages
  • ...

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

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>
@github-actions
Copy link
Copy Markdown
Contributor

Citations Summary

Status: ✅ All checks passed

Metric Count
Total citations 2
Added 0
Edited 0
Removed 0
Keys normalized 0

@daharoni daharoni merged commit cbd070f into main May 11, 2026
3 checks passed
@daharoni daharoni deleted the debug-wiki-login-failure branch May 11, 2026 16:27
@daharoni daharoni mentioned this pull request May 11, 2026
daharoni added a commit that referenced this pull request May 11, 2026
Used locally during wiki credential debugging \(see context from PR #15/#16\).
Adding to .gitignore so it can't be accidentally committed by anyone who
creates their own .secrets file in a clone of the repo.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant