Skip to content

Commit d58ebbe

Browse files
committed
Propagate the GitHub PR too
1 parent 94a8074 commit d58ebbe

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

.evergreen/functions.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ functions:
667667
<<: *compass-env
668668
DEBUG: ${debug|}
669669
GITHUB_TOKEN: ${generated_token}
670+
GITHUB_PR_NUMBER: ${github_pr_number}
670671
EVERGREEN_TASK_URL: https://spruce.mongodb.com/task/${task_id}
671672
script: |
672673
set -e

.github/workflows/test-installers.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
nonce:
2121
type: string
2222
description: 'A random string to track the run from dispatch to watching'
23+
github_pr_number:
24+
type: string
25+
description: 'Number of the PR that triggered this run'
2326
evergreen_task_url:
2427
type: string
2528
description: 'URL to the Evergreen job that triggered this run'
@@ -28,11 +31,14 @@ run-name: Test Installers ${{ github.event.inputs.dev_version || github.ref_name
2831

2932
jobs:
3033
summarize:
31-
if: ${{ github.event.inputs.evergreen_task_url }}
3234
runs-on: ubuntu-latest
3335
steps:
34-
- name: Add a summary to the job
35-
run: echo "Triggered by ${{ github.event.inputs.evergreen_task_url }}" >> $GITHUB_STEP_SUMMARY
36+
- name: Add URL for the GitHub PR
37+
if: ${{ github.event.inputs.github_pr_number }}
38+
run: echo "[GitHub PR ${{ github.event.inputs.github_pr_number }}](https://github.com/mongodb-js/compass/pull/${{ github.event.inputs.github_pr_number }})" >> $GITHUB_STEP_SUMMARY
39+
- name: Add URL for the Evergreen task
40+
if: ${{ github.event.inputs.evergreen_task_url }}
41+
run: echo "[Evergreen Task](${{ github.event.inputs.evergreen_task_url }})" >> $GITHUB_STEP_SUMMARY
3642
test:
3743
name: ${{ matrix.package }} test ${{ matrix.test }} (${{ matrix.hadron-distribution }})
3844
strategy:

packages/compass-smoke-tests/src/cli.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ yargs(hideBin(process.argv))
146146
default: getDefaultRef(),
147147
}),
148148
async ({ bucketName, bucketKeyPrefix, ref, githubPrNumber }) => {
149-
const { GITHUB_TOKEN } = process.env;
149+
const {
150+
GITHUB_TOKEN,
151+
DEV_VERSION_IDENTIFIER,
152+
GITHUB_PR_NUMBER,
153+
EVERGREEN_TASK_URL,
154+
} = process.env;
155+
150156
assert(
151157
typeof GITHUB_TOKEN === 'string',
152158
'Expected a GITHUB_TOKEN environment variable'
@@ -165,8 +171,9 @@ yargs(hideBin(process.argv))
165171
githubPrNumber,
166172
})
167173
: ref,
168-
devVersion: process.env.DEV_VERSION_IDENTIFIER,
169-
evergreenTaskUrl: process.env.EVERGREEN_TASK_URL,
174+
devVersion: DEV_VERSION_IDENTIFIER,
175+
githubPrNumber: GITHUB_PR_NUMBER,
176+
evergreenTaskUrl: EVERGREEN_TASK_URL,
170177
bucketName,
171178
bucketKeyPrefix,
172179
});

packages/compass-smoke-tests/src/dispatch.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ type DispatchOptions = {
122122
bucketName: string;
123123
bucketKeyPrefix: string;
124124
devVersion?: string;
125+
githubPrNumber?: string;
125126
evergreenTaskUrl?: string;
126127

127128
/**
@@ -136,6 +137,7 @@ export async function dispatchAndWait({
136137
devVersion,
137138
bucketName,
138139
bucketKeyPrefix,
140+
githubPrNumber,
139141
evergreenTaskUrl,
140142
watchPollDelayMs = 5000,
141143
}: DispatchOptions) {
@@ -151,6 +153,7 @@ export async function dispatchAndWait({
151153
dev_version: devVersion,
152154
bucket_name: bucketName,
153155
bucket_key_prefix: bucketKeyPrefix,
156+
github_pr_number: githubPrNumber,
154157
evergreen_task_url: evergreenTaskUrl,
155158
nonce,
156159
},

0 commit comments

Comments
 (0)