diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 26a89208e7..5bfc310600 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -418,6 +418,17 @@ functions: export SCRIPT="$DRIVERS_TOOLS/.evergreen/github_app/assign-reviewer.sh" bash $SCRIPT -p $CONFIG -h ${github_commit} -o "mongodb" -n "mongo-go-driver" + "backport pr": + - command: subprocess.exec + type: test + params: + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/github_app/backport-pr.sh + - mongodb + - mongo-go-driver + - ${github_commit} + send-perf-data: - command: perf.send params: @@ -906,6 +917,11 @@ tasks: - func: "add PR labels" - func: "create-api-report" + - name: backport-pr + allowed_requesters: ["commit"] + commands: + - func: "backport pr" + - name: perf tags: ["performance"] exec_timeout_secs: 7200 @@ -2484,6 +2500,15 @@ buildvariants: tasks: - name: ".compile-check" + - name: backport-pr + display_name: "Backport PR" + run_on: + - rhel8.7-small + expansions: + GO_DIST: "/opt/golang/go1.20" + tasks: + - name: "backport-pr" + - name: atlas-test tags: ["pullrequest"] display_name: "Atlas test" diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 4e5c523549..900fc32fdb 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -51,6 +51,21 @@ pre-commit run --all-files ### Cherry-picking between branches +#### Using the GitHub App + +Within a PR, you can make the comment: + +``` +drivers-pr-bot please backport to {target_branch} +``` + +The preferred workflow is to make the comment and then merge the PR. + +If you merge the PR and the "backport-pr" task runs before you make the comment, you can +make the comment and then re-run the "backport-pr" task for that commit. + +#### Manually + You must first install the `gh` cli (`brew install gh`), then set your GitHub username: ```bash