Skip to content

Commit 4e04919

Browse files
Merge pull request #85 from dontcallmedom/fallback-no-pr-title
Add fallback for displaying PR number in digest when title not in API…
2 parents 2521daa + 1b09608 commit 4e04919

File tree

6 files changed

+40
-321
lines changed

6 files changed

+40
-321
lines changed

index.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ def listify(l):
211211
newissues = list(filter(isNew, list(filter(isIssue, filtered_events))))
212212
closedissues = list(filter(isClosed, list(filter(isIssue, filtered_events))))
213213
newpr = list(filter(isNew, list(filter(isPR, filtered_events))))
214+
# as of October 2025, the GitHub Events API doesn't include
215+
# title and html_url in PullRequestEvents
216+
# as fallback, calculate html_url manually
217+
for pr in newpr:
218+
html_url = pr["payload"]["pull_request"].get("html_url", None)
219+
if not html_url:
220+
import sys
221+
html_url = pr["payload"]["pull_request"]["url"].replace("/api.", "/").replace("/repos/", "/").replace("/pulls/","/pull/")
222+
pr["payload"]["pull_request"]["html_url"] = html_url
223+
214224
mergedpr = list(
215225
filter(isMerged, list(filter(isClosed, list(filter(isPR, filtered_events)))))
216226
)

templates/generic/digest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* {{name}} (+{{newpr.count}}/-{{mergedpr.count}}/💬{{prcommentscount}})
4646
{{#newpr.count}} {{.}} pull requests submitted:
4747
{{#newpr.list}}
48-
- {{{payload.pull_request.title}}} (by {{actor.display_login}})
48+
- {{{payload.pull_request.number}}} {{{payload.pull_request.title}}} (by {{actor.display_login}})
4949
{{{payload.pull_request.html_url}}} {{#payload.pull_request.labels}}[{{name}}] {{/payload.pull_request.labels}}
5050
{{/newpr.list}}
5151

templates/generic/digest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ <h3>{{name}} (+{{newissues.count}}/-{{closedissues.count}}/💬{{issuecommentsco
8080
<h3>{{name}} (+{{newpr.count}}/-{{mergedpr.count}}/💬{{prcommentscount}})</h3>
8181
{{#newpr.count}} <p class="new">{{.}} pull requests submitted:</p>
8282
<ul>{{#newpr.list}}
83-
<li>#{{payload.pull_request.number}} <a href="{{payload.pull_request.html_url}}">{{payload.pull_request.title}}</a> (by {{actor.display_login}}) {{#payload.pull_request.labels}}<span class="label" style="background-color: #{{color}}; color: #{{text_color}}">{{name}}</span> {{/payload.pull_request.labels}}</li>
83+
<li><a href="{{payload.pull_request.html_url}}">#{{payload.pull_request.number}} {{payload.pull_request.title}}</a> (by {{actor.display_login}}) {{#payload.pull_request.labels}}<span class="label" style="background-color: #{{color}}; color: #{{text_color}}">{{name}}</span> {{/payload.pull_request.labels}}</li>
8484
{{/newpr.list}}</ul>
8585
{{/newpr.count}}
8686

tests/digest-weekly-repofiltered.msg

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@ Pull requests
5353
-------------
5454
* w3c/webrtc-pc (+8/-1/💬10)
5555
8 pull requests submitted:
56-
- Revert "Respec now uses yarn instead of npm" (by vivienlacourba)
56+
- 948 Revert "Respec now uses yarn instead of npm" (by vivienlacourba)
5757
https://github.com/w3c/webrtc-pc/pull/948
58-
- Splitting transceiver direction into "direction" and "currentDirection". (by taylor-b)
58+
- 946 Splitting transceiver direction into "direction" and "currentDirection". (by taylor-b)
5959
https://github.com/w3c/webrtc-pc/pull/946
60-
- Effect of setting sender.track to null (by aboba)
60+
- 944 Effect of setting sender.track to null (by aboba)
6161
https://github.com/w3c/webrtc-pc/pull/944
62-
- Use of "stopped" in insertDTMF and replaceTrack (by aboba)
62+
- 940 (by aboba)
6363
https://github.com/w3c/webrtc-pc/pull/940
64-
- Removed "stopped" from removeTrack (by aboba)
64+
- 939 Removed "stopped" from removeTrack (by aboba)
6565
https://github.com/w3c/webrtc-pc/pull/939
66-
- What happens when setDirection() is called (by aboba)
66+
- 938 What happens when setDirection() is called (by aboba)
6767
https://github.com/w3c/webrtc-pc/pull/938
68-
- What happens when transceiver.stop() is called (by aboba)
68+
- 937 What happens when transceiver.stop() is called (by aboba)
6969
https://github.com/w3c/webrtc-pc/pull/937
70-
- Remove Issue 1: Current and Pending SDP (by aboba)
70+
- 936 Remove Issue 1: Current and Pending SDP (by aboba)
7171
https://github.com/w3c/webrtc-pc/pull/936
7272

7373

tests/digest-weekly.msg

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ Pull requests
5050
-------------
5151
* w3c/webrtc-pc (+8/-1/💬10)
5252
8 pull requests submitted:
53-
- Revert "Respec now uses yarn instead of npm" (by vivienlacourba)
53+
- 948 Revert "Respec now uses yarn instead of npm" (by vivienlacourba)
5454
https://github.com/w3c/webrtc-pc/pull/948
55-
- Splitting transceiver direction into "direction" and "currentDirection". (by taylor-b)
55+
- 946 Splitting transceiver direction into "direction" and "currentDirection". (by taylor-b)
5656
https://github.com/w3c/webrtc-pc/pull/946
57-
- Effect of setting sender.track to null (by aboba)
57+
- 944 Effect of setting sender.track to null (by aboba)
5858
https://github.com/w3c/webrtc-pc/pull/944
59-
- Use of "stopped" in insertDTMF and replaceTrack (by aboba)
59+
- 940 (by aboba)
6060
https://github.com/w3c/webrtc-pc/pull/940
61-
- Removed "stopped" from removeTrack (by aboba)
61+
- 939 Removed "stopped" from removeTrack (by aboba)
6262
https://github.com/w3c/webrtc-pc/pull/939
63-
- What happens when setDirection() is called (by aboba)
63+
- 938 What happens when setDirection() is called (by aboba)
6464
https://github.com/w3c/webrtc-pc/pull/938
65-
- What happens when transceiver.stop() is called (by aboba)
65+
- 937 What happens when transceiver.stop() is called (by aboba)
6666
https://github.com/w3c/webrtc-pc/pull/937
67-
- Remove Issue 1: Current and Pending SDP (by aboba)
67+
- 936 Remove Issue 1: Current and Pending SDP (by aboba)
6868
https://github.com/w3c/webrtc-pc/pull/936
6969

7070

0 commit comments

Comments
 (0)