From 612c21b484bbe9a9d5707d64bfc72a136bcb9905 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 12 Aug 2024 17:20:41 -0500 Subject: [PATCH 1/2] DRIVERS-2956 Add Script to Cherry-Pick PRs --- .evergreen/github_app/README.md | 23 +++- .evergreen/github_app/apply-labels.mjs | 19 +-- .evergreen/github_app/apply-labels.sh | 14 +- .evergreen/github_app/assign-reviewer.mjs | 19 +-- .evergreen/github_app/assign-reviewer.sh | 12 +- .evergreen/github_app/backport-pr.sh | 120 ++++++++++++++++++ .../github_app/create_or_modify_comment.mjs | 42 +----- .../github_app/create_or_modify_comment.sh | 12 +- .evergreen/github_app/get-access-token.sh | 64 ++++++++++ .evergreen/github_app/get_backport_target.mjs | 39 ++++++ .evergreen/github_app/setup-secrets.sh | 8 ++ .evergreen/github_app/utils.mjs | 61 +++++++++ .evergreen/github_app/utils.sh | 20 +++ .evergreen/install-node.sh | 4 +- .evergreen/secrets_handling/setup-secrets.sh | 11 +- 15 files changed, 364 insertions(+), 104 deletions(-) create mode 100755 .evergreen/github_app/backport-pr.sh create mode 100755 .evergreen/github_app/get-access-token.sh create mode 100644 .evergreen/github_app/get_backport_target.mjs create mode 100755 .evergreen/github_app/setup-secrets.sh create mode 100644 .evergreen/github_app/utils.mjs create mode 100755 .evergreen/github_app/utils.sh diff --git a/.evergreen/github_app/README.md b/.evergreen/github_app/README.md index 373f6b11..8f89439e 100644 --- a/.evergreen/github_app/README.md +++ b/.evergreen/github_app/README.md @@ -2,7 +2,7 @@ ## create_or_modify_comment -Uses `mongodb-drivers-comment-bot` to create/update comments on PRs +Uses `mongodb-drivers-pr-bot` to create/update comments on PRs with the results of an EVG task. We offer a convenience script to install node, fetch secrets and run the app: @@ -14,7 +14,7 @@ Note: this script be run on a Linux EVG Host or locally. It will self-manage th ## apply-labels -Uses `mongodb-drivers-comment-bot` to apply labels according to [labeler](https://github.com/actions/labeler) config, +Uses `mongodb-drivers-pr-bot` to apply labels according to [labeler](https://github.com/actions/labeler) config, without the need for a `pull_request_target` trigger. Note: only the `changed-files: > any-glob-to-any-file:` config is currently implemented. @@ -29,7 +29,7 @@ Note: this script can be run on a Linux EVG Host or locally. It will self-manag ## add-reviewer -Uses `mongodb-drivers-comment-bot` to apply add a random reviewer based on a text file. +Uses `mongodb-drivers-pr-bot` to apply add a random reviewer based on a text file. We offer a convenience script to install node, fetch secrets and run the app: @@ -39,3 +39,20 @@ bash assign-reviewer.sh -o "" -n "" -h " ``` Note: this script can be run on a Linux EVG Host or locally. It will self-manage the credentials it needs. + +## backport-pr + +Uses `mongodb-drivers-pr-bot` to backport a PR from one branch to another. It is triggered by the magic +comment "drivers-pr-bot please backport to {target_branch}". The script should be run in an EVG task on a merge. +If the matching comment is found, it will attempt to create a new branch and cherry-pick the commit, and then +create a PR with the change. If the cherry-pick fails, it will create a comment on the PR with the instructions +to make the cherry-pick manually. + +If the PR is merged and the task has already run before the magic comment is made, you can make the magic comment +and then manually restart the task to pick up the backport. + +The script is called as: + +```bash +bash backport-pr.sh {owner} {repo} {target_sha} +``` diff --git a/.evergreen/github_app/apply-labels.mjs b/.evergreen/github_app/apply-labels.mjs index cd9ed895..6ade38e2 100644 --- a/.evergreen/github_app/apply-labels.mjs +++ b/.evergreen/github_app/apply-labels.mjs @@ -1,20 +1,13 @@ /** - * Apply default GitHub PR labels using the mongodb-drivers-comment-bot. + * Apply default GitHub PR labels using the mongodb-drivers-pr-bot. */ import * as fs from "fs"; import { parse } from 'yaml'; import * as process from "process"; import { program } from 'commander'; -import { App } from "octokit"; +import { getOctokit } from './utils.mjs'; import { minimatch } from 'minimatch'; -const appId = process.env.GITHUB_APP_ID; -const privateKey = process.env.GITHUB_SECRET_KEY.replace(/\\n/g, '\n'); -if (appId == '' || privateKey == '') { - console.error("Missing GitHub App auth information"); - process.exit(1) -} - // Handle cli. program .version('1.0.0', '-v, --version') @@ -34,13 +27,7 @@ const { } = options; // Set up the app. -const installId = process.env['GITHUB_APP_INSTALL_ID_' + owner.toUpperCase()]; -if (installId == '') { - console.error(`Missing install id for ${owner}`) - process.exit(1) -} -const app = new App({ appId, privateKey }); -const octokit = await app.getInstallationOctokit(installId); +const octokit = await getOctokit(owner); const headers = { "x-github-api-version": "2022-11-28", }; diff --git a/.evergreen/github_app/apply-labels.sh b/.evergreen/github_app/apply-labels.sh index f4545da2..4089a024 100755 --- a/.evergreen/github_app/apply-labels.sh +++ b/.evergreen/github_app/apply-labels.sh @@ -5,14 +5,10 @@ SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) . $SCRIPT_DIR/../handle-paths.sh pushd $SCRIPT_DIR -# Bootstrap the secrets. -. ../secrets_handling/setup-secrets.sh drivers/comment-bot +# Bootstrap the app. +source utils.sh +bootstrap -# Install node and activate it. -bash ../install-node.sh -source ../init-node-and-npm-env.sh - -# Install and run the app. -npm install -node apply-labels.mjs "$@" +# Run the app. +node assign-reviewer.mjs "$@" popd diff --git a/.evergreen/github_app/assign-reviewer.mjs b/.evergreen/github_app/assign-reviewer.mjs index 377e8cd8..6e71fb2b 100644 --- a/.evergreen/github_app/assign-reviewer.mjs +++ b/.evergreen/github_app/assign-reviewer.mjs @@ -1,17 +1,10 @@ /** - * Create or modify a GitHub comment using the mongodb-drivers-comment-bot. + * Create or modify a GitHub comment using the mongodb-drivers-pr-bot. */ import * as fs from "fs"; import * as process from "process"; import { program } from 'commander'; -import { App } from "octokit"; - -const appId = process.env.GITHUB_APP_ID; -const privateKey = process.env.GITHUB_SECRET_KEY.replace(/\\n/g, '\n'); -if (appId == '' || privateKey == '') { - console.error("Missing GitHub App auth information"); - process.exit(1) -} +import { getOctokit } from './utils.mjs'; // Handle cli. program @@ -32,13 +25,7 @@ const { } = options; // Set up the app. -const installId = process.env['GITHUB_APP_INSTALL_ID_' + owner.toUpperCase()]; -if (installId == '') { - console.error(`Missing install id for ${owner}`) - process.exit(1) -} -const app = new App({ appId, privateKey }); -const octokit = await app.getInstallationOctokit(installId); +const octokit = await getOctokit(owner); const headers = { "x-github-api-version": "2022-11-28", }; diff --git a/.evergreen/github_app/assign-reviewer.sh b/.evergreen/github_app/assign-reviewer.sh index 9f79fb8e..4089a024 100755 --- a/.evergreen/github_app/assign-reviewer.sh +++ b/.evergreen/github_app/assign-reviewer.sh @@ -5,14 +5,10 @@ SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) . $SCRIPT_DIR/../handle-paths.sh pushd $SCRIPT_DIR -# Bootstrap the secrets. -. ../secrets_handling/setup-secrets.sh drivers/comment-bot +# Bootstrap the app. +source utils.sh +bootstrap -# Install node and activate it. -bash ../install-node.sh -source ../init-node-and-npm-env.sh - -# Install and run the app. -npm install +# Run the app. node assign-reviewer.mjs "$@" popd diff --git a/.evergreen/github_app/backport-pr.sh b/.evergreen/github_app/backport-pr.sh new file mode 100755 index 00000000..abd6fdee --- /dev/null +++ b/.evergreen/github_app/backport-pr.sh @@ -0,0 +1,120 @@ +#!/usr/bin/env bash +set -eu + +SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) +. $SCRIPT_DIR/../handle-paths.sh +pushd $SCRIPT_DIR + +owner=$1 +repo=$2 +target_sha=$3 + +# Ensure that all variables required to run are given, otherwise throw +# an error. +for VARNAME in owner repo target_sha; do +[[ -z "${!VARNAME:-}" ]] && echo "ERROR: $VARNAME not set" && exit 1; +done + +# Bootstrap the app. +source utils.sh +bootstrap + +# Run the app. + +# First find the target branch. +echo "Getting target branch..." +target_branch=$(node get_backport_target.mjs -o $owner -n $repo -h $target_sha) +if [ -z "${target_branch}" ]; then + echo "No matching cherry-pick comment!" + popd + exit 0 +fi +echo "Target branch: $target_branch" +echo "Getting target branch... done." + +# Get a github access token for the git checkout. +echo "Getting github token..." +token=$(bash ./get-access-token.sh $repo $owner) +if [ -z "${token}" ]; then + echo "Failed to get github access token!" + popd + exit 1 +fi +echo "Getting github token... done." + +# Make the git checkout and create a new branch. +echo "Creating the git checkout..." +dirname=$(mktemp -d) +branch="cherry-pick-$target_branch-$target_sha" +git clone https://github.com/$owner/$repo.git $dirname + +pushd $dirname +git config user.email "167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com" +git config user.name "mongodb-dbx-release-bot[bot]" +git remote set-url origin https://x-access-token:${token}@github.com/$owner/$repo.git +git checkout -b $branch "origin/$target_branch" +echo "Creating the git checkout... done." + +# Attempt to make the cherry-pick. +echo "Creating the cherry-pick..." +old_title=$(git --no-pager log $target_sha --pretty=%B | head -n 1) +title="${old_title} [${target_branch}]" +body="Cherry-pick of $target_sha to $target_branch" +if git cherry-pick -x -m1 $target_sha; then + # If the cherry-pick succeeds, push the branch and make a PR. + echo "Creating the cherry-pick..." + echo "Creating the PR..." + git push origin $branch + resp=$(curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $token" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + -d "{\"title\":\"${title}\",\"body\":\"${body}\",\"head\":\"${branch}\",\"base\":\"${target_branch}\"}" \ + --url https://api.github.com/repos/$owner/$repo/pulls) + echo $resp | jq '.html_url' + echo "Creating the PR... done." +else + # If the cherry-pick fails, make a comment. + echo "Creating the cherry-pick... failed!" + echo "Creating the PR comment..." + message="Sorry, unable to cherry-pick to $target_branch" + cat << EOF >> comment.txt +$message, please backport manually. Here are approximate instructions: + +1. Checkout backport branch and update it. + +``` +git checkout ${target_branch} +git pull +``` + +2. Cherry pick the first parent branch of the this PR on top of the older branch: +``` +git cherry-pick -x -m1 ${target_sha} +``` + +3. You will likely have some merge/cherry-pick conflicts here, fix them and commit: + +``` +git commit -am {message} +``` + +4. Push to a named branch: + +``` +git push origin ${target_branch}:{remote_submit_branch} +``` + +5. Create a PR against branch ${target_branch}. I would have named this PR: + +> "$title" +EOF + node create_or_modify_comment.sh -o $owner -n $repo -m $message -c comment.txt -h $target_sha + rm comment.txt + echo "Creating the PR comment... done." +fi + +popd +rm -rf $dirname +popd diff --git a/.evergreen/github_app/create_or_modify_comment.mjs b/.evergreen/github_app/create_or_modify_comment.mjs index a1703765..f5e6d46e 100644 --- a/.evergreen/github_app/create_or_modify_comment.mjs +++ b/.evergreen/github_app/create_or_modify_comment.mjs @@ -1,17 +1,10 @@ /** - * Create or modify a GitHub comment using the mongodb-drivers-comment-bot. + * Create or modify a GitHub comment using the mongodb-drivers-pr-bot. */ import * as fs from "fs"; import * as process from "process"; import { program } from 'commander'; -import { App } from "octokit"; - -const appId = process.env.GITHUB_APP_ID; -const privateKey = process.env.GITHUB_SECRET_KEY.replace(/\\n/g, '\n'); -if (appId == '' || privateKey == '') { - console.error("Missing GitHub App auth information"); - process.exit(1) -} +import { getOctokit, findComment } from './utils.mjs'; // Handle cli. program @@ -35,38 +28,13 @@ const { const bodyText = fs.readFileSync(commentPath, { encoding: 'utf8' }); // Set up the app. -const installId = process.env['GITHUB_APP_INSTALL_ID_' + owner.toUpperCase()]; -if (installId == '') { - console.error(`Missing install id for ${owner}`) - process.exit(1) -} -const app = new App({ appId, privateKey }); -const octokit = await app.getInstallationOctokit(installId); +const octokit = await getOctokit(owner); const headers = { "x-github-api-version": "2022-11-28", }; -// Find the matching pull request. -let resp = await octokit.request("GET /repos/{owner}/{repo}/pulls?state=open&per_page=100", { - owner, - repo, - headers -}); -const issue = resp.data.find(pr => pr.head.sha === targetSha); -if (issue == null) { - console.error(`ERROR: Could not find matching pull request for sha ${targetSha}`) - process.exit(1) -} -const { number: issueNumber } = issue - -// Find a matching comment if it exists, and update it. -resp = await octokit.request("GET /repos/{owner}/{repo}/issues/{issue_number}/comments", { - owner, - repo, - issue_number: issueNumber, - headers -}); -const comment = resp.data.find(comment => comment.body.includes(bodyMatch)); +// Find a matching comment. +const comment = await findComment(octokit, owner, repo, targetSha, bodyMatch, "open"); if (!comment) { // create comment. await octokit.request("POST /repos/{owner}/{repo}/issues/{issue_number}/comments", { diff --git a/.evergreen/github_app/create_or_modify_comment.sh b/.evergreen/github_app/create_or_modify_comment.sh index 7abc1e6f..fddcd212 100755 --- a/.evergreen/github_app/create_or_modify_comment.sh +++ b/.evergreen/github_app/create_or_modify_comment.sh @@ -5,14 +5,10 @@ SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) . $SCRIPT_DIR/../handle-paths.sh pushd $SCRIPT_DIR -# Bootstrap the secrets. -. ../secrets_handling/setup-secrets.sh drivers/comment-bot +# Bootstrap the app. +source utils.sh +bootstrap -# Install node and activate it. -bash ../install-node.sh -source ../init-node-and-npm-env.sh - -# Install and run the app. -npm install +# Run the app. node create_or_modify_comment.mjs "$@" popd diff --git a/.evergreen/github_app/get-access-token.sh b/.evergreen/github_app/get-access-token.sh new file mode 100755 index 00000000..df37e06c --- /dev/null +++ b/.evergreen/github_app/get-access-token.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# Get an installation access token. +# Adapted from +# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app#example-using-bash-to-generate-a-jwt +set -eu + +SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) +. $SCRIPT_DIR/../handle-paths.sh +pushd $SCRIPT_DIR > /dev/null + +source ./secrets-export.sh + +client_id="$GITHUB_APP_ID" + +repo=$1 +org=${2:-mongodb} + +pem=$(echo "$GITHUB_SECRET_KEY" | sed 's/\\n/\n/g') + +now=$(date +%s) +iat=$((${now} - 60)) # Issues 60 seconds in the past +exp=$((${now} + 600)) # Expires 10 minutes in the future + +b64enc() { openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n'; } + +header_json='{ + "typ":"JWT", + "alg":"RS256" +}' +# Header encode +header=$( echo -n "${header_json}" | b64enc ) + +payload_json='{ + "iat":'"${iat}"', + "exp":'"${exp}"', + "iss":'"${client_id}"' +}' +# Payload encode +payload=$( echo -n "${payload_json}" | b64enc ) + +# Signature +header_payload="${header}"."${payload}" +signature=$( + openssl dgst -sha256 -sign <(echo -n "${pem}") \ + <(echo -n "${header_payload}") | b64enc +) + +# Create JWT. +JWT="${header_payload}"."${signature}" + +# Get an installation access token. +installation_id=$GITHUB_APP_INSTALL_ID_MONGODB +if [ "$org" == "mongodb-labs" ]; then + installation_id=$GITHUB_APP_INSTALL_ID_MONGODB_LABS +fi +rep=$(curl --silent --request POST \ +--url "https://api.github.com/app/installations/$installation_id/access_tokens" \ +--header "Accept: application/vnd.github+json" \ +--header "Authorization: Bearer $JWT" \ +--header "X-GitHub-Api-Version: 2022-11-28" \ +-d '{"repositories":["'$repo'"],"permissions":{"pull_requests":"write","contents":"write"}}') +echo $rep | jq -r '.token' + +popd > /dev/null diff --git a/.evergreen/github_app/get_backport_target.mjs b/.evergreen/github_app/get_backport_target.mjs new file mode 100644 index 00000000..f60d95c1 --- /dev/null +++ b/.evergreen/github_app/get_backport_target.mjs @@ -0,0 +1,39 @@ +/** + * Look for a cherry-pick target based on a comment in a PR. + */ +import * as fs from "fs"; +import * as process from "process"; +import { program } from 'commander'; +import { getOctokit, findComment } from './utils.mjs'; + +const BODY_MATCH = "drivers-pr-bot please backport to "; + +// Handle cli. +program + .version('1.0.0', '-v, --version') + .usage('[OPTIONS]...') + .requiredOption('-o, --repo-owner ', 'The owner of the repo (e.g. mongodb).') + .requiredOption('-n, --repo-name ', 'The name of the repo (e.g. mongo-go-driver).') + .requiredOption('-h, --head-sha ', 'The sha of the head commit') + .parse(process.argv); + +const options = program.opts(); +const { + repoOwner: owner, + repoName: repo, + headSha: targetSha + } = options; + +// Set up the app. +const octokit = await getOctokit(owner); +const headers = { + "x-github-api-version": "2022-11-28", +}; + +// Find a matching comment. +const comment = await findComment(octokit, owner, repo, targetSha, BODY_MATCH, "closed"); +if (!comment) { + process.exit(0); +} +const target = comment.body.replace(BODY_MATCH, '') +console.log(target); diff --git a/.evergreen/github_app/setup-secrets.sh b/.evergreen/github_app/setup-secrets.sh new file mode 100755 index 00000000..81a33b13 --- /dev/null +++ b/.evergreen/github_app/setup-secrets.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -eu + +SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) +. $SCRIPT_DIR/../handle-paths.sh +pushd $SCRIPT_DIR > /dev/null +. $SCRIPT_DIR/../secrets_handling/setup-secrets.sh drivers/comment-bot +popd > /dev/null diff --git a/.evergreen/github_app/utils.mjs b/.evergreen/github_app/utils.mjs new file mode 100644 index 00000000..a16f5b26 --- /dev/null +++ b/.evergreen/github_app/utils.mjs @@ -0,0 +1,61 @@ +import * as process from "process"; +import { App } from "octokit"; + +async function getOctokit(owner) { + /** + * Get an octokit client for a given owner name (e.g. mongodb or mongodb-labs). + */ + const appId = process.env.GITHUB_APP_ID; + const privateKey = process.env.GITHUB_SECRET_KEY.replace(/\\n/g, '\n'); + if (appId == '' || privateKey == '') { + console.error("Missing GitHub App auth information"); + process.exit(1) + } + + const installId = process.env['GITHUB_APP_INSTALL_ID_' + owner.toUpperCase()]; + if (installId == '') { + console.error(`Missing install id for ${owner}`) + process.exit(1) + } + const app = new App({ appId, privateKey }); + return await app.getInstallationOctokit(installId); +} + + +async function findComment(octokit, owner, repo, targetSha, bodyMatch, state) { + /** + * Find a matching PR comment for a given merged sha and match text. + */ + const headers = { + "x-github-api-version": "2022-11-28", + }; + let resp = await octokit.request("GET /repos/{owner}/{repo}/pulls?per_page=100&state={state}&sort=updated&direction=desc", { + owner, + repo, + state, + headers + }); + const issue = resp.data.find(pr => { + if (state === "open") { + return pr.head.sha.startsWith(targetSha); + } else { + return pr.merge_commit_sha.startsWith(targetSha) + } + }) + if (issue == null) { + console.error(`ERROR: Could not find matching pull request for sha "${targetSha}"`) + process.exit(1) + } + + // Find a matching comment if it exists. + resp = await octokit.request("GET /repos/{owner}/{repo}/issues/{issue_number}/comments", { + owner, + repo, + issue_number: issue.number, + headers + }); + return resp.data.find(comment => comment.body.includes(bodyMatch)); +} + + +export { getOctokit, findComment }; diff --git a/.evergreen/github_app/utils.sh b/.evergreen/github_app/utils.sh new file mode 100755 index 00000000..3cc72e93 --- /dev/null +++ b/.evergreen/github_app/utils.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eu + +function bootstrap() { + SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) + . $SCRIPT_DIR/../handle-paths.sh + pushd $SCRIPT_DIR > /dev/null + + # Bootstrap the secrets. + . ./setup-secrets.sh + + # Install node and activate it. + bash ../install-node.sh + source ../init-node-and-npm-env.sh + + # Install the app. + npm install + + popd > /dev/null +} diff --git a/.evergreen/install-node.sh b/.evergreen/install-node.sh index 8ed9f605..ff52ff7b 100755 --- a/.evergreen/install-node.sh +++ b/.evergreen/install-node.sh @@ -85,12 +85,11 @@ echo "Node.js ${node_index_version} for ${operating_system}-${architecture} rele set -o xtrace -curl "${CURL_FLAGS[@]}" "${node_download_url}" --output "$node_archive_path" - if [[ "$file_extension" = "zip" ]]; then if [[ -d "${NODE_ARTIFACTS_PATH}/nodejs/bin/${node_directory}" ]]; then echo "Node.js already installed!" else + curl "${CURL_FLAGS[@]}" "${node_download_url}" --output "$node_archive_path" unzip -q "$node_archive_path" -d "${NODE_ARTIFACTS_PATH}" mkdir -p "${NODE_ARTIFACTS_PATH}/nodejs" # Windows "bins" are at the top level @@ -103,6 +102,7 @@ else if [[ -d "${NODE_ARTIFACTS_PATH}/nodejs/${node_directory}" ]]; then echo "Node.js already installed!" else + curl "${CURL_FLAGS[@]}" "${node_download_url}" --output "$node_archive_path" tar -xf "$node_archive_path" -C "${NODE_ARTIFACTS_PATH}" mv "${NODE_ARTIFACTS_PATH}/${node_directory}" "${NODE_ARTIFACTS_PATH}/nodejs" fi diff --git a/.evergreen/secrets_handling/setup-secrets.sh b/.evergreen/secrets_handling/setup-secrets.sh index bc404357..af50b389 100755 --- a/.evergreen/secrets_handling/setup-secrets.sh +++ b/.evergreen/secrets_handling/setup-secrets.sh @@ -14,14 +14,15 @@ ORIG_SCRIPT_DIR=${SCRIPT_DIR:-} SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) . $SCRIPT_DIR/../handle-paths.sh -pushd $SCRIPT_DIR/../auth_aws +pushd $SCRIPT_DIR/../auth_aws > /dev/null . ./activate-authawsvenv.sh -popd +popd > /dev/null -echo "Getting secrets:" "$@" -python $SCRIPT_DIR/setup_secrets.py "$@" +ALL_ARGS="$@" +echo "Getting secrets: ${ALL_ARGS}..." +python $SCRIPT_DIR/setup_secrets.py $ALL_ARGS source $(pwd)/secrets-export.sh -echo "Got secrets" +echo "Getting secrets: $ALL_ARGS... done." # Restore the script dir if we've overridden it. if [ -n "${ORIG_SCRIPT_DIR}" ]; then From 7e4cf770f11e36c5ed6771dcf452719bee9bc5ae Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 12 Aug 2024 19:45:42 -0500 Subject: [PATCH 2/2] update docstring --- .evergreen/github_app/utils.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/github_app/utils.mjs b/.evergreen/github_app/utils.mjs index a16f5b26..42bccf26 100644 --- a/.evergreen/github_app/utils.mjs +++ b/.evergreen/github_app/utils.mjs @@ -24,7 +24,7 @@ async function getOctokit(owner) { async function findComment(octokit, owner, repo, targetSha, bodyMatch, state) { /** - * Find a matching PR comment for a given merged sha and match text. + * Find a matching PR comment for a given target sha and match text. */ const headers = { "x-github-api-version": "2022-11-28",