Skip to content

Commit 73139a4

Browse files
committed
still a wip
1 parent 6909518 commit 73139a4

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

.evergreen/resync-specs.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
set -eu
44
PYMONGO=$(dirname "$(cd "$(dirname "$0")"; pwd)")
55
SPECS=${MDB_SPECS:-~/Work/specifications}
6-
echo "$SPECS"
76

87
help (){
98
echo "Usage: resync_specs.sh [-bcsp] spec"
@@ -46,9 +45,12 @@ then
4645
fi
4746

4847
# Ensure the JSON files are up to date.
49-
cd $SPECS/source
50-
make
51-
cd -
48+
if ! [ -n "${CI:-}" ]
49+
then
50+
cd $SPECS/source
51+
make
52+
cd -
53+
fi
5254
# cpjson unified-test-format/tests/invalid unified-test-format/invalid
5355
# * param1: Path to spec tests dir in specifications repo
5456
# * param2: Path to where the corresponding tests live in Python.

.evergreen/scripts/create-pr.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
#!/usr/bin/env bash
22

3-
# clone drivers-evergreen-tools to get this get-access-token script...
43
tools="../drivers-evergreen-tools"
54
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $tools
65
body="$(cat "$1")"
76

87
pushd $tools/.evergreen/github_app
98

10-
# Get a github access token for the git checkout.
11-
echo "Getting github token..."
12-
139
owner="mongodb"
1410
repo="mongo-python-driver"
1511

16-
./setup-secrets.sh
17-
echo "finish setting up secrets"
12+
echo "bootstrapping?"
13+
# Bootstrap the app.
14+
source utils.sh
15+
bootstrap drivers/release-bot
16+
17+
# Run the app.
18+
19+
# Get a github access token for the git checkout.
20+
echo "Getting github token..."
1821
token=$(bash ./get-access-token.sh $repo $owner)
1922
if [ -z "${token}" ]; then
2023
echo "Failed to get github access token!"
@@ -31,7 +34,7 @@ git config user.email "167856002+mongodb-dbx-release-bot[bot]@users.noreply.gith
3134
git config user.name "mongodb-dbx-release-bot[bot]"
3235
git remote set-url origin https://x-access-token:${token}@github.com/$owner/$repo.git
3336
git checkout -b $branch "origin/master"
34-
git add
37+
git add ./test
3538
echo "Creating the git checkout... done."
3639

3740
git push origin $branch

.evergreen/scripts/resync-all-specs.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22
# Run spec syncing script and create PR
33

4-
SPEC_DEST="test"
4+
SPEC_DEST="$(realpath -s "./test")"
55
SRC_URL="https://github.com/mongodb/specifications.git"
66
# needs to be set for resunc-specs.sh
7-
SPEC_SRC="../specifications"
8-
SCRIPT=".evergreen/resync-specs.sh"
7+
SPEC_SRC="$(realpath -s "../specifications")"
8+
SCRIPT="$(realpath -s ".evergreen/resync-specs.sh")"
99
BRANCH_NAME="spec-resync-"$(date '+%m-%d-%Y')
1010

1111
# List of directories to skip
@@ -27,6 +27,7 @@ fi
2727

2828
# Set environment variable to the cloned repo for resync-specs.sh
2929
export MDB_SPECS="$SPEC_SRC"
30+
echo "$SPEC_SRC"
3031

3132
# Check that resync script exists and is executable
3233
if [[ ! -x $SCRIPT ]]; then
@@ -51,13 +52,15 @@ for item in "$SPEC_DEST"/*; do
5152
if [[ $item != *.py ]]; then
5253
echo " doing $item_name"
5354
# output=$(./$SCRIPT "$item_name" 2>&1)
54-
output=$($SCRIPT "$item_name")
55+
$SCRIPT "$item_name"
5556
# Check if the script ran successfully
5657
if [[ $? -ne 0 ]]; then
58+
echo "an error occurred"
5759
errored_specs+=("$item_name")
5860
else
5961
# if script had output, then changes were made
6062
if [[ -n "$output" ]]; then
63+
echo "success"
6164
changed_specs+=("$item_name")
6265
fi
6366
fi
@@ -86,9 +89,11 @@ else
8689
fi
8790

8891
# Output the PR body (optional step for verification)
89-
echo "$pr_body"
92+
echo -e "$pr_body"
9093
echo "$pr_body" >> spec_sync.txt
9194

95+
git diff
96+
9297
# call scrypt to create PR for us
9398
.evergreen/scripts/create-pr.sh spec_sync.txt
9499

0 commit comments

Comments
 (0)