FIX: Skip rebaking posts with inline GitHub PR oneboxes (#36576)

Posts and chat messages with inline oneboxes to GitHub PRs were being
unnecessarily rebaked when the PR status changed. This happened because
the check `cooked.include?("onebox")` matched both full oneboxes
(`class="onebox githubpullrequest"`) and inline oneboxes
(`class="inline-onebox"`).

Changed the check to match "githubpullrequest" specifically, which only
appears in full PR oneboxes that actually display the status.

Internal ref - t/169442
This commit is contained in:
Régis Hanol
2025-12-09 23:28:22 +01:00
committed by GitHub
parent 4cdac003b3
commit 2ea603cd21
2 changed files with 36 additions and 73 deletions
@@ -46,7 +46,7 @@ module Jobs
def has_github_pr_onebox?(cooked, pr_url)
# quick & dirty check to avoid doing unnecessary rebakes
cooked.present? && cooked.include?("onebox") && cooked.include?(pr_url)
cooked.present? && cooked.include?("githubpullrequest") && cooked.include?(pr_url)
end
end
end