Add support for more timeline events
This PR adds support for displaying more types of timeline events, mostly PR-related:
- [auto-merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request) and [merge queue](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request-with-a-merge-queue) events, which can be observed in PRs to [servo/servo](https://github.com/servo/servo).
While implementing this, I've noticed that some occurrences of the "removed from merge queue" event made by _github-merge-queue_ bot are present in API responses but hidden in the GH web UI. Unfortunately we have no way to reliably determine which should be shown and which should not, because the timeline REST API doesn't tell us why a PR was removed from the merge queue.
<img src="https://github.com/user-attachments/assets/fdc6a243-69d9-4740-9618-396ff3e190f0" width=420 />
<p></p>
- issue `transferred` events: unfortunately the GH API doesn't include the repository from which the issue is transferred in the event payload, so we must resort to a generic message that says _"from another repository"_. Nevertheless, I think that displaying these events sometimes helps to better understand the context of a conversation.
For those, I've reused the same icon as the cross-referenced event because the GitHub UI does the same, and I think that it actually fits well.
<img src="https://github.com/user-attachments/assets/8b9db396-6a26-4f38-8742-c3b54b0ee8cb" width=420 />
<p></p>
I have also added a commit to remove the arguably redundant "closed" event in the PR timeline that follows the "merged" one (you might have already noticed that in the first screenshot), so that the app is more consistent with the GitHub UI.
I recommend reviewing this commit by commit, as I've refactored some switch statements to use the Java 17+ syntax. The desugaring library update was required to leverage the `Stream.toList()` method.
合并状态:已合并 合并于 2025-03-19 关闭于 2025-03-19 0 条评论