Skip to content

Commit ad21b3b

Browse files
janiszclaude
andcommitted
Make PR numbers clickable in table PRs column
Convert PR numbers from plain text to clickable GitHub links using rich_text cells with multiple link elements. Changes: - PR column now uses rich_text cell with link elements - Each PR is a clickable link: #1234#1234 - Multiple PRs separated by commas: #1234, #1235 - Empty state remains plain text: "—" Example table cell structure: { "type": "rich_text", "elements": [{ "type": "rich_text_section", "elements": [ {"type": "link", "url": "https://...", "text": "#1234"}, {"type": "text", "text": ", "}, {"type": "link", "url": "https://...", "text": "#1235"} ] }] } Users can now click PR numbers directly in Slack tables to view the pull requests on GitHub. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 0ad0625 commit ad21b3b

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

scripts/ci/backport_audit/report_slack.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,22 @@ def _create_issue_table_row(
118118

119119
pr_refs = jira_to_prs.get(jira_key, [])
120120
if pr_refs:
121-
pr_links = ", ".join([f"#{pr}" for pr in pr_refs])
121+
# Create rich text cell with clickable PR links
122+
pr_elements = []
123+
for i, pr in enumerate(pr_refs):
124+
if i > 0:
125+
pr_elements.append({"type": "text", "text": ", "})
126+
pr_elements.append({
127+
"type": "link",
128+
"url": f"https://github.com/stackrox/stackrox/pull/{pr}",
129+
"text": f"#{pr}",
130+
})
131+
pr_cell = {
132+
"type": "rich_text",
133+
"elements": [{"type": "rich_text_section", "elements": pr_elements}],
134+
}
122135
else:
123-
pr_links = "—"
136+
pr_cell = _create_table_cell_text("—")
124137

125138
# Format priority as Slack emoji
126139
if priority and priority != "No priority":
@@ -140,7 +153,7 @@ def _create_issue_table_row(
140153
_create_table_cell_rich_text(priority_display),
141154
_create_table_cell_text(severity_display),
142155
_create_table_cell_text(deadline_info),
143-
_create_table_cell_text(pr_links),
156+
pr_cell,
144157
]
145158

146159

0 commit comments

Comments
 (0)