grunt patch fails for every ticket: Trac returns a bot challenge instead of the attachment list
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript
- 領域
- cli
調査の方向性
tasks/patch_wordpress.js の getPatchFromTicket() と getPatch() から始めます。ここでは、200 以外のレスポンスが fileFail() に到達します。Issue にある curl コマンドで 403 のチャレンジレスポンスを再現し、その後、現在のメッセージがどのように組み立てられているかを追跡します。ボット保護のレスポンスが識別され、空のパッチや一般的な使用方法エラーとして扱われるのではなく、明確に報告されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
grunt patch:<ticket> no longer works for any ticket. Trac now answers requests from non-browser clients with a proof-of-work bot interstitial instead of the page, so the attachment list can never be read and no patch is ever found.
This is a server-side change at WordPress.org, not a regression in this package — but the package cannot currently do its job, and the error it prints sends people looking in the wrong place.
Reproduction
Using the tool's own literal User-Agent against its own endpoint:
curl -s -o /dev/null -w '%{http_code}\n' \
-A "grunt-patch-wordpress; https://github.com/WordPress/grunt-patch-wordpress" \
"https://core.trac.wordpress.org/attachment/ticket/62281/"
Result: 403. The body is a Checking your browser… page — a SHA-256 hashcash challenge that sets an _hcc cookie and escalates to an "I am human" checkbox on repeat requests.
The same applies to /raw-attachment/ticket/<id>/<file>, so the download step in getPatch() is blocked as well as the listing step. Sending a browser User-Agent instead returns a bare nginx 403. Verified 2026-08-06 from an ordinary home connection, not a datacentre IP.
What the user sees
Both request sites treat any non-200 the same way:
tasks/patch_wordpress.js:238-244—getPatchFromTicket()emitsfileFailon a non-200tasks/patch_wordpress.js:279-283—getPatch()does the same
fileFail() then prints "Nothing to patch." followed by the four-point usage help — "enter a ticket number, enter a ticket url, enter a patch url". So a contributor whose ticket definitely has patches on it is told, in effect, that they typed the command wrong. The 403 is in the emitted message but is buried under generic usage advice, and nothing indicates the request was blocked rather than empty.
Suggested direction
The real fix is almost certainly not in this package. Two paths, neither of which this repo controls:
- An allowlist for an identified client User-Agent, which would need Systems.
- A structured read API. meta #8202 proposes JSON endpoints exposing ticket metadata and the attachment list (filename, author, date, size), which would remove the scraping dependency entirely rather than restoring it. It is assigned and has an implementation in progress.
What is in scope here, and worth doing regardless: say what actually happened. Detecting the challenge response and printing something like "Trac returned a bot-protection challenge (403); this tool cannot currently fetch attachments" would stop people debugging their own ticket number, and would make the scale of the problem visible instead of looking like scattered user error.
Related
- #83 (list PRs along with patches) needs the same ticket data, and would be unblocked by the same API rather than by more scraping.
- Worth noting for #70: whatever succeeds this tool will hit exactly this wall unless it consumes a real API, so the successor's data source may matter more than its build tooling.
- 主要言語
- JavaScript
- スター
- 51
- フォーク
- 14
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WordPress/grunt-patch-wordpress のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
WordPress/grunt-patch-wordpress#95 · コメント 1 件 · リアクション 1 件 ·
-
Expand NPM usersオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
WordPress/grunt-patch-wordpress#70 · コメント 2 件 ·
WordPress/grunt-patch-wordpress の issue をすべて見る
似ている issue
-
bug CI breakage triage needed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
oppia/oppia#27517 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
draftomen enhancement size: S
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
andreagrandi/draftomen#761 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
HarperFast/harper#2866 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
HarperFast/harper-pro#927 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
anthropics/skills#1897 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信