Live Pull Request Status on GitHub Oneboxes ✨

AI-generated summary

The discourse-github plugin introduces live pull request status indicators for GitHub PR oneboxes, automatically updating via webhooks to reflect states such as Draft, Open, Approved, Changes Requested, Merged, or Closed. This new built-in feature replaces the previous github-status-theme component, offering advantages like support for private repositories, review-based status detection, and functionality in chat messages.

Feedback from the community highlights several points. tobiaseigen expressed a preference for the previous text-based status labels, noting that icons alone may be unclear to users less familiar with GitHub; zogstrip acknowledged this, leading to a pull request that adds both icons and text descriptions Cite. Initial display issues were noted by JammyDodger, but zogstrip clarified that oneboxes require rebaking to update, a process subsequently performed by fzngagan.

A technical issue was reported by Moin, who observed that status icons disappeared in translated versions of posts. zogstrip initially attributed this to translation handling, but Moin clarified that the issue persisted even without translation, prompting zogstrip to investigate. Additionally, rishabh announced support for PR statuses on inline oneboxes via a new pull request. Finally, bird inquired about potential support for Gitea due to accessibility issues with GitHub in certain regions.

We’re excited to announce a new feature for the discourse-github plugin: live pull request status indicators on GitHub PR oneboxes! :tada:

When you paste a GitHub pull request URL in a post or chat message, Discourse now displays a visual status icon that shows the current state of the PR — and keeps it up-to-date automatically via webhooks. :counterclockwise_arrows_button:

What It Does

GitHub PR oneboxes now display a status icon that reflects the current state of the pull request:

Status Color Description
:memo: Draft Gray PR is marked as draft
:unlocked: Open Gray PR is open and awaiting review
:white_check_mark: Approved Green PR has been approved by reviewers
:large_orange_diamond: Changes Requested Orange Reviewers have requested changes
:purple_circle: Merged Purple PR has been merged
:red_circle: Closed Red PR was closed without merging

The icons use GitHub’s native iconography and color scheme, so they’ll feel familiar to anyone who uses GitHub regularly. :eyes:

Examples

Here’s what the different statuses look like in action:

Draft PR:

Open PR:

Approved PR:

Changes Requested:

Merged PR:

Closed PR:

Where It Works :round_pushpin:

The live status appears on:

  • Forum posts — Any post containing a GitHub PR onebox
  • Chat messages — If you have the Chat plugin enabled, PR oneboxes in chat also display live status :speech_balloon:

Chat example:

Note: Inline oneboxes (when a link appears inline in text rather than as a full preview) do not display status icons.

Real-Time Updates via Webhooks :high_voltage:

The most powerful aspect of this feature is that PR statuses update automatically when changes occur on GitHub. When a PR is opened, closed, merged, converted to/from draft, or receives a review, Discourse automatically updates any posts or chat messages containing that PR’s onebox.

Smart Review Status :magnifying_glass_tilted_left:

The feature doesn’t just show basic open/closed status — it also fetches review information to determine if a PR has been approved or has changes requested. It intelligently handles multiple reviewers by:

  • Taking the latest review from each reviewer
  • Showing “changes requested” if any reviewer has requested changes
  • Showing “approved” only if reviews exist and none request changes

Migrating from the GitHub Status Theme Component :warning:

This feature replaces the GitHub Status Indicators theme component. The two are not compatible and should not be used together.

If you’re currently using the theme component, you should:

  1. Disable and remove the github-status-theme theme component
  2. Enable this new built-in feature via site settings

The new implementation offers several advantages over the theme component:

  • :locked: Works with private repositories (via API authentication)
  • :white_check_mark: Includes approval/changes requested status from reviews
  • :high_voltage: Real-time updates via webhooks
  • :speech_balloon: Works in chat messages
  • :hammer_and_wrench: No theme component maintenance required

Getting Started :rocket:

For setup instructions, configuration options, and technical details, see the discourse-github plugin documentation.

Feedback :speech_balloon:

We’d love to hear your feedback on this feature! If you encounter any issues or have suggestions for improvements, please let us know in the replies below. :folded_hands:

33 Likes

Wow! I love this! :star_struck: The only feedback I have is that I miss the spelling out of the status in words that we used to have previously. The colored icons are cool but I don’t recognize what they mean immediately because I don’t spend alot of time in github.

Time will tell, but I think others who are looking for the status of bug fixes or new features might have the same problem and think something has changed in Discourse that has not been.

4 Likes

The icons do have a title on mouse hover, but that only works on desktop.

2 Likes

This made me realize we could have both worlds :wink:

https://github.com/discourse/discourse/pull/36637

8 Likes

Should this one say ‘merged’ now? It’s still showing as ‘opened’ for me:

2 Likes

We haven’t rebaked any of the oneboxes on meta just yet.

2 Likes

Ah, my bad. I was expecting too much magic :magic_wand::slight_smile:

2 Likes

I rebaked the one you referenced. Does it look correct now?

4 Likes

I noticed that I can only see the status as long as I don’t read the topic in another language. Is that a known trade-off?

1 Like

The oneboxes aren’t part of the raw content of the posts so they aren’t translated.

1 Like

My question was not about translation, but about the status icon. I wonder why it doesn’t work the same way in the translated post.

The theme component worked in both


Oh right. Not sure why. I’ll have a look :eyes:

2 Likes

Is there any news on updating the onebox in the translated version of the post?

Excited to share that we now support PR statuses on inline oneboxes:

9 Likes

Has the community considered supporting Gitea? :grinning_face: Due to some special reasons, GitHub is either inaccessible or very slow.

2 Likes