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

Merge in v2.20.1 #14

Merged
merged 12 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
61 changes: 57 additions & 4 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ functions:
working_dir: "src"
script: |
${PREPARE_SHELL}
AUTH=${AUTH} SSL=${SSL} TOPOLOGY=${TOPOLOGY} RVM_RUBY="${RVM_RUBY}" ATLAS_REPLICA_SET_URI=${atlas_replica_set_uri} ATLAS_SHARDED_URI=${atlas_sharded_uri} ATLAS_FREE_TIER_URI=${atlas_free_tier_uri} ATLAS_TLS11_URI=${atlas_tls11_uri} ATLAS_TLS12_URI=${atlas_tls12_uri} ATLAS_SERVERLESS_URI=${atlas_serverless_uri} ATLAS_SERVERLESS_LB_URI=${atlas_serverless_lb_uri} .evergreen/run-tests-atlas.sh
MONGODB_URI="${MONGODB_URI}" .evergreen/run-tests-atlas.sh

"run serverless tests":
- command: shell.exec
Expand Down Expand Up @@ -527,6 +527,54 @@ task_groups:
- "test-serverless"

- name: testatlas_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
- func: fetch source
- func: create expansions
- command: shell.exec
params:
shell: "bash"
working_dir: "src"
script: |
${PREPARE_SHELL}

echo "Setting up Atlas cluster"

DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
DRIVERS_ATLAS_LAMBDA_USER="${DRIVERS_ATLAS_LAMBDA_USER}" \
DRIVERS_ATLAS_LAMBDA_PASSWORD="${DRIVERS_ATLAS_LAMBDA_PASSWORD}" \
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
MONGODB_VERSION="7.0" \
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh

echo "MONGODB_URI=${MONGODB_URI}"
- command: expansions.update
params:
file: src/atlas-expansion.yml
teardown_group:
- command: shell.exec
params:
shell: "bash"
working_dir: "src"
script: |
${PREPARE_SHELL}

DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/teardown-atlas-cluster.sh
tasks:
- test-atlas

- name: testatlas_full_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
Expand Down Expand Up @@ -599,6 +647,8 @@ task_groups:
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh

echo "MONGODB_URI=${MONGODB_URI}"
- command: expansions.update
params:
file: src/atlas-expansion.yml
Expand Down Expand Up @@ -827,6 +877,7 @@ tasks:
script: |
${PREPARE_SHELL}
export MONGODB_URI=${MONGODB_URI}
export FUNCTION_NAME="ruby-driver-lambda"
.evergreen/run-tests-deployed-lambda.sh
env:
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/spec/faas/ruby-sam-app
Expand Down Expand Up @@ -1575,7 +1626,9 @@ buildvariants:

- matrix_name: aws-auth-regular
matrix_spec:
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
# https://jira.mongodb.org/browse/RUBY-3311
# auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ecs, aws-web-identity ]
ruby: "ruby-3.2"
topology: standalone
# needs the latest_5x_mdb because run-tests.sh uses `mongo` to configure
Expand Down Expand Up @@ -1805,15 +1858,15 @@ buildvariants:
os: rhel8
display_name: "Atlas (Full)"
tasks:
- name: testatlas_task_group
- name: testatlas_full_task_group

- matrix_name: "atlas"
matrix_spec:
ruby: ["ruby-3.2", "ruby-3.1", "ruby-3.0", "ruby-2.7", "jruby-9.4", "jruby-9.3"]
os: rhel8
display_name: "Atlas tests ${ruby}"
tasks:
- name: test-atlas
- name: testatlas_task_group

# Commented out, pending RUBY-3414
# - matrix_name: "serverless"
Expand Down
53 changes: 52 additions & 1 deletion .evergreen/config/common.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ functions:
working_dir: "src"
script: |
${PREPARE_SHELL}
AUTH=${AUTH} SSL=${SSL} TOPOLOGY=${TOPOLOGY} RVM_RUBY="${RVM_RUBY}" ATLAS_REPLICA_SET_URI=${atlas_replica_set_uri} ATLAS_SHARDED_URI=${atlas_sharded_uri} ATLAS_FREE_TIER_URI=${atlas_free_tier_uri} ATLAS_TLS11_URI=${atlas_tls11_uri} ATLAS_TLS12_URI=${atlas_tls12_uri} ATLAS_SERVERLESS_URI=${atlas_serverless_uri} ATLAS_SERVERLESS_LB_URI=${atlas_serverless_lb_uri} .evergreen/run-tests-atlas.sh
MONGODB_URI="${MONGODB_URI}" .evergreen/run-tests-atlas.sh

"run serverless tests":
- command: shell.exec
Expand Down Expand Up @@ -524,6 +524,54 @@ task_groups:
- "test-serverless"

- name: testatlas_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
- func: fetch source
- func: create expansions
- command: shell.exec
params:
shell: "bash"
working_dir: "src"
script: |
${PREPARE_SHELL}

echo "Setting up Atlas cluster"

DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
DRIVERS_ATLAS_LAMBDA_USER="${DRIVERS_ATLAS_LAMBDA_USER}" \
DRIVERS_ATLAS_LAMBDA_PASSWORD="${DRIVERS_ATLAS_LAMBDA_PASSWORD}" \
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
MONGODB_VERSION="7.0" \
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh

echo "MONGODB_URI=${MONGODB_URI}"
- command: expansions.update
params:
file: src/atlas-expansion.yml
teardown_group:
- command: shell.exec
params:
shell: "bash"
working_dir: "src"
script: |
${PREPARE_SHELL}

DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/teardown-atlas-cluster.sh
tasks:
- test-atlas

- name: testatlas_full_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
Expand Down Expand Up @@ -596,6 +644,8 @@ task_groups:
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh

echo "MONGODB_URI=${MONGODB_URI}"
- command: expansions.update
params:
file: src/atlas-expansion.yml
Expand Down Expand Up @@ -824,6 +874,7 @@ tasks:
script: |
${PREPARE_SHELL}
export MONGODB_URI=${MONGODB_URI}
export FUNCTION_NAME="ruby-driver-lambda"
.evergreen/run-tests-deployed-lambda.sh
env:
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/spec/faas/ruby-sam-app
Expand Down
8 changes: 5 additions & 3 deletions .evergreen/config/standard.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ buildvariants:

- matrix_name: aws-auth-regular
matrix_spec:
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
# https://jira.mongodb.org/browse/RUBY-3311
# auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ecs, aws-web-identity ]
ruby: <%= latest_ruby %>
topology: standalone
# needs the latest_5x_mdb because run-tests.sh uses `mongo` to configure
Expand Down Expand Up @@ -498,15 +500,15 @@ buildvariants:
os: rhel8
display_name: "Atlas (Full)"
tasks:
- name: testatlas_task_group
- name: testatlas_full_task_group

- matrix_name: "atlas"
matrix_spec:
ruby: <%= supported_rubies %>
os: rhel8
display_name: "Atlas tests ${ruby}"
tasks:
- name: test-atlas
- name: testatlas_task_group

# Commented out, pending RUBY-3414
# - matrix_name: "serverless"
Expand Down
1 change: 1 addition & 0 deletions .evergreen/run-deployed-lambda-aws-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ DRIVERS_ATLAS_LAMBDA_PASSWORD
DRIVERS_ATLAS_GROUP_ID
LAMBDA_STACK_NAME
AWS_REGION
FUNCTION_NAME
)

# Ensure that all variables required to run the test are set, otherwise throw
Expand Down
36 changes: 15 additions & 21 deletions .evergreen/run-tests-atlas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,21 @@ bundle_install
echo "Running specs"

test_status=0
for uri in ATLAS_REPLICA_SET_URI ATLAS_SHARDED_URI ATLAS_FREE_TIER_URI \
ATLAS_TLS11_URI ATLAS_TLS12_URI ATLAS_SERVERLESS_URI ATLAS_SERVERLESS_LB_URI
do
# ${!foo} syntax is bash specific:
# https://stackoverflow.com/questions/14049057/bash-expand-variable-in-a-variable
export ATLAS_URI="${!uri}"

if test -z "$ATLAS_URI"; then
echo "The \$$uri environment variable was not set" 1>&2
test_status=1
fi

bundle exec rspec spec/atlas -fd
this_test_status=$?
echo "TEST STATUS"
echo ${this_test_status}

if test $this_test_status != 0; then
test_status=$this_test_status
fi
done
export ATLAS_URI=$MONGODB_URI

if test -z "$ATLAS_URI"; then
echo "The \$$uri environment variable was not set" 1>&2
test_status=1
fi

bundle exec rspec spec/atlas -fd
this_test_status=$?
echo "TEST STATUS"
echo ${this_test_status}

if test $this_test_status != 0; then
test_status=$this_test_status
fi

kill_jruby

Expand Down
1 change: 1 addition & 0 deletions .evergreen/run-tests-deployed-lambda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set_env_python
set_env_ruby

export MONGODB_URI=${MONGODB_URI}
export CLUSTER_PREFIX="ruby-driver-"
export TEST_LAMBDA_DIRECTORY=`dirname "$0"`/../spec/faas/ruby-sam-app

. `dirname "$0"`/run-deployed-lambda-aws-tests.sh
67 changes: 0 additions & 67 deletions .evergreen/tools.rb

This file was deleted.

4 changes: 4 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# For configuring how release notes are auto-generated.
# Requires the use of labels to categorize pull requests.
#
# See: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
44 changes: 44 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Dry-Run Cleanup"
run-name: "Dry Run Cleanup for ${{ github.ref }}"

on:
workflow_dispatch:
inputs:
confirm:
description: Indicate whether you want this workflow to run (must be "true")
required: true
type: string
tag:
description: The name of the tag (and release) to clean up
required: true
type: string

jobs:
release:
name: "Dry-Run Cleanup"
environment: release
runs-on: 'ubuntu-latest'
if: ${{ inputs.confirm == 'true' }}

permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: write

# required by the mongodb-labs/drivers-github-tools/setup@v2 step
# also required by `rubygems/release-gem`
id-token: write

steps:
- name: "Run the cleanup action"
uses: mongodb-labs/drivers-github-tools/ruby/cleanup@v2
with:
app_id: ${{ vars.APP_ID }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
tag: ${{ inputs.tag }}
Loading
Loading