A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 6, 10:45 UTC
[CI] Merge `cleanup_pr_body.yml` and `reminder_comment.yml` (#37552)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Harry Mellor committed
Mar 19, 2026 at 12:55 UTC
a32eaf5bb288fd925d66716a7050cc4444a7dfb1
4 files changed
+96
-136
.github/scripts/cleanup_pr_body.sh
deleted
-50
@@ -1,50 +0,0 @@
1
-#!/bin/bash
2
-
3
-set -eu
4
-
5
-# ensure 1 argument is passed
6
-if [ "$#" -ne 1 ]; then
7
- echo "Usage: $0 <pr_number>"
8
- exit 1
9
-fi
10
-
11
-PR_NUMBER=$1
12
-OLD=/tmp/orig_pr_body.txt
13
-NEW=/tmp/new_pr_body.txt
14
-
15
-gh pr view --json body --template "{{.body}}" "${PR_NUMBER}" > "${OLD}"
16
-cp "${OLD}" "${NEW}"
17
-
18
-# Remove markdown comments (like the <!-- markdownlint-disable --> at the start)
19
-sed -i '/<!--.*-->$/d' "${NEW}"
20
-
21
-# Remove "PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED."
22
-sed -i '/PLEASE FILL IN THE PR DESCRIPTION HERE.*$/d' "${NEW}"
23
-
24
-# Remove all lines after and including "**BEFORE SUBMITTING, PLEASE READ THE CHECKLIST BELOW AND FILL IN THE DESCRIPTION ABOVE**"
25
-sed -i '/\*\*BEFORE SUBMITTING, PLEASE READ.*\*\*/,$d' "${NEW}"
26
-
27
-# Remove HTML <details> section that includes <summary> text of "PR Checklist (Click to Expand)"
28
-python3 - <<EOF
29
-import regex as re
30
-
31
-with open("${NEW}", "r") as file:
32
- content = file.read()
33
-
34
-pattern = re.compile(r'(---\n\n)?<details>.*?<summary>.*?PR Checklist \(Click to Expand\).*?</summary>.*?</details>', re.DOTALL)
35
-content = re.sub(pattern, '', content)
36
-
37
-with open("${NEW}", "w") as file:
38
- file.write(content)
39
-EOF
40
-
41
-# Run this only if ${NEW} is different than ${OLD}
42
-if ! cmp -s "${OLD}" "${NEW}"; then
43
- gh pr edit --body-file "${NEW}" "${PR_NUMBER}"
44
- echo
45
- echo "Updated PR body:"
46
- echo
47
- cat "${NEW}"
48
-else
49
- echo "No changes needed"
50
-fi
.github/workflows/cleanup_pr_body.yml
deleted
-32
@@ -1,32 +0,0 @@
1
-name: Cleanup PR Body
2
-
3
-on:
4
- pull_request_target:
5
- types: [opened, reopened, edited]
6
-
7
-permissions:
8
- pull-requests: write
9
-
10
-jobs:
11
- update-description:
12
- runs-on: ubuntu-latest
13
-
14
- steps:
15
- - name: Checkout repository
16
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17
-
18
- - name: Set up Python
19
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
20
- with:
21
- python-version: '3.12'
22
- cache: 'pip'
23
-
24
- - name: Install Python dependencies
25
- run: |
26
- python3 -m pip install --upgrade pip
27
- python3 -m pip install regex
28
-
29
- - name: Update PR description
30
- env:
31
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
- run: bash .github/scripts/cleanup_pr_body.sh "${{ github.event.number }}"
.github/workflows/new_pr_bot.yml
new
+96
@@ -0,0 +1,96 @@
1
+name: New PR Bot
2
+
3
+on:
4
+ pull_request_target:
5
+ types: [opened]
6
+
7
+permissions:
8
+ pull-requests: write
9
+
10
+jobs:
11
+ update-description:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Update PR description
15
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
16
+ with:
17
+ script: |
18
+ const { owner, repo } = context.repo;
19
+ const pr_number = context.issue.number;
20
+
21
+ const { data: pr } = await github.rest.pulls.get({
22
+ owner,
23
+ repo,
24
+ pull_number: pr_number,
25
+ });
26
+
27
+ let body = pr.body || '';
28
+ const original = body;
29
+
30
+ // Remove markdown comments (<!-- ... -->)
31
+ body = body.replace(/^<!--.*-->$/gm, '');
32
+
33
+ // Remove "PLEASE FILL IN THE PR DESCRIPTION HERE ..."
34
+ body = body.replace(/^PLEASE FILL IN THE PR DESCRIPTION HERE.*$/gm, '');
35
+
36
+ // Remove all lines after and including "**BEFORE SUBMITTING, PLEASE READ ..."
37
+ body = body.replace(/\*\*BEFORE SUBMITTING, PLEASE READ.*\*\*[\s\S]*$/, '');
38
+
39
+ // Remove <details> section containing "PR Checklist (Click to Expand)"
40
+ body = body.replace(/(---\n\n)?<details>[\s\S]*?<summary>[\s\S]*?PR Checklist \(Click to Expand\)[\s\S]*?<\/summary>[\s\S]*?<\/details>/g, '');
41
+
42
+ if (body !== original) {
43
+ await github.rest.pulls.update({
44
+ owner,
45
+ repo,
46
+ pull_number: pr_number,
47
+ body,
48
+ });
49
+ console.log('Updated PR body');
50
+ } else {
51
+ console.log('No changes needed');
52
+ }
53
+
54
+ reminder-comment:
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - name: Post welcome comment for first-time contributors
58
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
59
+ with:
60
+ script: |
61
+ const { owner, repo } = context.repo;
62
+ const prAuthor = context.payload.pull_request.user.login;
63
+
64
+ const { data: searchResults } = await github.rest.search.issuesAndPullRequests({
65
+ q: `repo:${owner}/${repo} type:pr author:${prAuthor}`,
66
+ per_page: 1,
67
+ });
68
+
69
+ const authorPRCount = searchResults.total_count;
70
+ console.log(`Found ${authorPRCount} PRs by ${prAuthor}`);
71
+
72
+ if (authorPRCount === 1) {
73
+ console.log(`Posting welcome comment for first-time contributor: ${prAuthor}`);
74
+ await github.rest.issues.createComment({
75
+ owner,
76
+ repo,
77
+ issue_number: context.issue.number,
78
+ body: [
79
+ '\u{1f44b} Hi! Thank you for contributing to the vLLM project.',
80
+ '',
81
+ '\u{1f4ac} Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.',
82
+ '',
83
+ 'Just a reminder: PRs would not trigger full CI run by default.',
84
+ '',
85
+ 'Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.',
86
+ '',
87
+ 'To run CI, PR reviewers can either: Add `ready` label to the PR or enable auto-merge.',
88
+ '',
89
+ 'If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.',
90
+ '',
91
+ '\u{1f680}',
92
+ ].join('\n'),
93
+ });
94
+ } else {
95
+ console.log(`Skipping comment for ${prAuthor} - not their first PR (${authorPRCount} PRs found)`);
96
+ }
.github/workflows/reminder_comment.yml
deleted
-54
@@ -1,54 +0,0 @@
1
-name: PR Reminder Comment Bot
2
-permissions:
3
- pull-requests: write
4
-on:
5
- pull_request_target:
6
- types: [opened]
7
-jobs:
8
- pr_reminder:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - name: Remind to run full CI on PR
12
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
13
- with:
14
- script: |
15
- try {
16
- // Get the PR author
17
- const prAuthor = context.payload.pull_request.user.login;
18
-
19
- // Check if this is the author's first PR in this repository
20
- // Use GitHub's search API to find all PRs by this author
21
- const { data: searchResults } = await github.rest.search.issuesAndPullRequests({
22
- q: `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${prAuthor}`,
23
- per_page: 100
24
- });
25
-
26
- const authorPRCount = searchResults.total_count;
27
-
28
- console.log(`Found ${authorPRCount} PRs by ${prAuthor}`);
29
-
30
- // Only post comment if this is the first PR (only one PR by this author)
31
- if (authorPRCount === 1) {
32
- console.log(`Posting welcome comment for first-time contributor: ${prAuthor}`);
33
- await github.rest.issues.createComment({
34
- owner: context.repo.owner,
35
- repo: context.repo.repo,
36
- issue_number: context.issue.number,
37
- body: '👋 Hi! Thank you for contributing to the vLLM project.\n\n' +
38
- '💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.\n\n' +
39
- 'Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run `fastcheck` CI which starts running only a small and essential subset of CI tests to quickly catch errors. \n\n' +
40
- 'You ask your reviewers to trigger select CI tests on top of `fastcheck` CI. \n\n' +
41
- 'Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.\n\n' +
42
- 'To run CI, PR reviewers can either: Add `ready` label to the PR or enable auto-merge.\n\n' +
43
- 'If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.\n\n' +
44
- '🚀'
45
- });
46
- } else {
47
- console.log(`Skipping comment for ${prAuthor} - not their first PR (${authorPRCount} PRs found)`);
48
- }
49
- } catch (error) {
50
- console.error('Error checking PR history or posting comment:', error);
51
- // Don't fail the workflow, just log the error
52
- }
53
- env:
54
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}