Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-3008 Use mongodb-drivers-comment-bot for API reports #1424

Merged
merged 32 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9418c87
wip
blink1073 Oct 11, 2023
8c3d7be
GODRIVER-3008 Use mongodb-drivers-comment-bot for API reports
blink1073 Oct 11, 2023
229bd35
debug
blink1073 Oct 11, 2023
7b1d578
faster
blink1073 Oct 12, 2023
e8d3f75
fix sha handling
blink1073 Oct 12, 2023
6955a06
fix sha handling
blink1073 Oct 12, 2023
4d4569d
try again
blink1073 Oct 12, 2023
8077587
more debug
blink1073 Oct 12, 2023
208bd80
cleanup
blink1073 Oct 12, 2023
ce77ded
better debug
blink1073 Oct 12, 2023
20a6aac
move drivers-tools up
blink1073 Oct 12, 2023
9205df9
clean up drivers tools location
blink1073 Oct 12, 2023
dcc0286
go up one more level for drivers-tools
blink1073 Oct 12, 2023
3be69c1
try on ubuntu 22
blink1073 Oct 12, 2023
c8778af
switch back to rhel
blink1073 Oct 12, 2023
ea5bb9a
hard-code base commit for now
blink1073 Oct 12, 2023
9931613
try going back to detached state
blink1073 Oct 12, 2023
2649553
debug
blink1073 Oct 12, 2023
c43c9a7
debug
blink1073 Oct 12, 2023
b16bf90
check the revision
blink1073 Oct 12, 2023
af56471
final version
blink1073 Oct 12, 2023
9a8803d
Refactor
blink1073 Oct 12, 2023
01320bd
fix name
blink1073 Oct 12, 2023
cf41b37
fixup
blink1073 Oct 13, 2023
c1d1d64
cleanup
blink1073 Oct 13, 2023
8d4b9fd
update to pass in repo name and owner
blink1073 Oct 13, 2023
819a98d
remove unused arg
blink1073 Oct 13, 2023
078e45c
more cleanup
blink1073 Oct 13, 2023
32852df
update gitignore
blink1073 Oct 14, 2023
c5d4eae
use master branch
blink1073 Oct 16, 2023
84f14c3
Merge branch 'v1' of github.com:mongodb/mongo-go-driver into GODRIVER…
blink1073 Oct 16, 2023
3c991a0
Merge branch 'v1' of github.com:mongodb/mongo-go-driver into GODRIVER…
blink1073 Oct 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ functions:
export GOCACHE="$(pwd)/.cache"

# Set other relevant variables for Evergreen processes.
export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
export DRIVERS_TOOLS="$(dirname $(dirname $(dirname `pwd`)))/drivers-tools"
export PROJECT_DIRECTORY="$(pwd)"
export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
Expand Down Expand Up @@ -329,6 +329,18 @@ functions:
${PREPARE_SHELL}
sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh

create-api-report:
- command: shell.exec
type: test
params:
shell: "bash"
working_dir: src/go.mongodb.org/mongo-driver
script: |
${PREPARE_SHELL}
export BASE_SHA=${revision}
export HEAD_SHA=${github_commit}
bash etc/api_report.sh

send-perf-data:
- command: perf.send
params:
Expand Down Expand Up @@ -1194,6 +1206,7 @@ tasks:
- func: run-make
vars:
targets: "check-fmt check-license check-modules lint"
- func: "create-api-report"

- name: perf
tags: ["performance"]
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export GOCACHE="$(pwd)/.cache"
export DRIVERS_TOOLS=${DRIVERS_TOOLS:-""}

if [ -z $DRIVERS_TOOLS ]; then
export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
export DRIVERS_TOOLS=="$(dirname $(dirname $(dirname `pwd`)))/drivers-tools"
fi

if [ "Windows_NT" = "$OS" ]; then
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/comment.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ perf
.DS_Store
install
main.so
.cache
install
libmongocrypt
venv
test.suite

# AWS SAM-generated files
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ build: cross-compile build-tests build-compile-check
build-tests:
go test -short $(BUILD_TAGS) -run ^$$ ./...

.PHONY: api-report
api-report:
etc/api_report.sh

.PHONY: build-compile-check
build-compile-check:
etc/compile_check.sh
Expand Down
27 changes: 19 additions & 8 deletions etc/api_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@
# Generates a report of Go Driver API changes for the current branch.
set -eux

cmd=$(command -v gorelease || true)
# Skip the report of it isn't a PR run.
if [ "$BASE_SHA" == "$HEAD_SHA" ]; then
echo "Skipping API Report"
exit 0
fi

# Ensure a clean checkout.
git checkout -b test-api-report
git add .
git commit -m "local changes"

# Ensure gorelease is installed.
cmd=$(command -v gorelease || true)
if [ -z $cmd ]; then
go install golang.org/x/exp/cmd/gorelease@latest
fi

branch=${GITHUB_BASE_REF:-master}
git fetch origin $branch:$branch
sha=$(git merge-base $branch HEAD)

gorelease -base=$sha > api-report.txt || true

# Generate and parse the report.
gorelease -base=$BASE_SHA > api-report.txt || true
cat api-report.txt
go run ./cmd/parse-api-report/main.go
rm api-report.txt

rm api-report.txt
# Make the PR comment.
target=$DRIVERS_TOOLS/.evergreen/github_app/create_or_modify_comment.sh
bash $target -m "## API Change Report" -c "$(pwd)/api-report.md" -h $HEAD_SHA -o "mongodb" -n "mongo-go-driver"