Skip to content

Commit

Permalink
Prepare 8.1.6 release (#5864)
Browse files Browse the repository at this point in the history
comandeo-mongo authored Sep 20, 2024
1 parent 24d2c9f commit a67b088
Showing 9 changed files with 291 additions and 312 deletions.
280 changes: 129 additions & 151 deletions .evergreen/config.yml

Large diffs are not rendered by default.

34 changes: 12 additions & 22 deletions .evergreen/config/axes.yml.erb
Original file line number Diff line number Diff line change
@@ -83,10 +83,6 @@ axes:
- id: "ruby"
display_name: Ruby Version
values:
- id: "ruby-2.6"
display_name: ruby-2.6
variables:
RVM_RUBY: "ruby-2.6"
- id: "ruby-2.7"
display_name: ruby-2.7
variables:
@@ -111,17 +107,25 @@ axes:
- id: "jruby"
display_name: JRuby Version
values:
- id: "jruby-9.3"
display_name: jruby-9.3
- id: "jruby-9.4"
display_name: jruby-9.4
variables:
RVM_RUBY: "jruby-9.3"
RVM_RUBY: "jruby-9.4"

- id: "os"
display_name: OS
values:
- id: ubuntu-22.04
- id: actual-ubuntu-22.04
display_name: "Ubuntu 22.04"
run_on: ubuntu2204-small
- id: ubuntu-20.04
display_name: "Ubuntu 20.04"
run_on: ubuntu2004-small
variables:
DOCKER_DISTRO: ubuntu2004
- id: ubuntu-22.04
display_name: "Ubuntu 22.04"
run_on: ubuntu2004-small
variables:
DOCKER_DISTRO: ubuntu2204
- id: debian11
@@ -190,10 +194,6 @@ axes:
display_name: "Rails master"
variables:
RAILS: "master"
- id: "5.2"
display_name: "Rails 5.2"
variables:
RAILS: "5.2"
- id: "6.0"
display_name: "Rails 6.0"
variables:
@@ -215,16 +215,6 @@ axes:
variables:
RAILS: "7.2"

- id: "i18n"
display_name: I18n version
values:
- id: '1.0'
display_name: "i18n-1.0"
variables:
I18N: "1.0"
- id: current
display_name: "i18n-current"

- id: "test-i18n-fallbacks"
display_name: Test i18n fallbacks
values:
154 changes: 101 additions & 53 deletions .evergreen/config/commands.yml.erb
Original file line number Diff line number Diff line change
@@ -12,66 +12,61 @@ functions:

git submodule update --init --recursive

"fetch egos":
- command: shell.exec
params:
working_dir: "src"
script: |
set -ex

curl -sfLo egos https://raw.githubusercontent.com/p-mongo/egos/master/egos
chmod +x ./egos

"create expansions":
# Make an evergreen exapanstion file with dynamic values
- command: shell.exec
params:
working_dir: "src"
script: |
# Get the current unique version of this checkout
if [ "${is_patch}" = "true" ]; then
CURRENT_VERSION=$(git describe)-patch-${version_id}
else
CURRENT_VERSION=latest
fi
# Get the current unique version of this checkout
if [ "${is_patch}" = "true" ]; then
CURRENT_VERSION=$(git describe)-patch-${version_id}
else
CURRENT_VERSION=latest
fi

export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
export DRIVERS_TOOLS="$(pwd)/.mod/drivers-evergreen-tools"

export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
export UPLOAD_BUCKET="${project}"
export PROJECT_DIRECTORY="$(pwd)"
export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
export UPLOAD_BUCKET="${project}"
export PROJECT_DIRECTORY="$(pwd)"

cat <<EOT > expansion.yml
CURRENT_VERSION: "$CURRENT_VERSION"
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME"
MONGODB_BINARIES: "$MONGODB_BINARIES"
UPLOAD_BUCKET: "$UPLOAD_BUCKET"
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
PREPARE_SHELL: |
set -o errexit
set -o xtrace
export DRIVERS_TOOLS="$DRIVERS_TOOLS"
export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME"
export MONGODB_BINARIES="$MONGODB_BINARIES"
export UPLOAD_BUCKET="$UPLOAD_BUCKET"
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"
cat <<EOT > expansion.yml
CURRENT_VERSION: "$CURRENT_VERSION"
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME"
MONGODB_BINARIES: "$MONGODB_BINARIES"
UPLOAD_BUCKET: "$UPLOAD_BUCKET"
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
PREPARE_SHELL: |
set -o errexit
set -o xtrace
export DRIVERS_TOOLS="$DRIVERS_TOOLS"
export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME"
export MONGODB_BINARIES="$MONGODB_BINARIES"
export UPLOAD_BUCKET="$UPLOAD_BUCKET"
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"

export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
export PATH="$MONGODB_BINARIES:$PATH"
export PROJECT="${project}"
export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
export PATH="$MONGODB_BINARIES:$PATH"
export PROJECT="${project}"

export MONGODB_VERSION=${VERSION}
export TOPOLOGY=${TOPOLOGY}
export SINGLE_MONGOS=${SINGLE_MONGOS}
export AUTH=${AUTH}
export SSL=${SSL}
export APP_TESTS=${APP_TESTS}
export DOCKER_DISTRO=${DOCKER_DISTRO}
EOT
# See what we've done
cat expansion.yml
export MONGODB_VERSION="${VERSION}"
export TOPOLOGY="${TOPOLOGY}"
export SINGLE_MONGOS="${SINGLE_MONGOS}"
export AUTH="${AUTH}"
export SSL="${SSL}"
export APP_TESTS="${APP_TESTS}"
export DOCKER_DISTRO="${DOCKER_DISTRO}"
export RVM_RUBY="${RVM_RUBY}"
export RAILS="${RAILS}"
export DRIVER="${DRIVER}"
export TEST_I18N_FALLBACKS="${TEST_I18N_FALLBACKS}"
export FLE="${FLE}"
EOT
# See what we've done
cat expansion.yml

# Load the expansion file to make an evergreen variable with the current unique version
- command: expansions.update
@@ -250,14 +245,12 @@ functions:
${PREPARE_SHELL}
env \
MONGODB_URI="${MONGODB_URI}" \
TOPOLOGY=${TOPOLOGY} \
TOPOLOGY="${TOPOLOGY}" \
RVM_RUBY="${RVM_RUBY}" \
RAILS="${RAILS}" \
DRIVER="${DRIVER}" \
I18N="${I18N}" \
TEST_I18N_FALLBACKS="${TEST_I18N_FALLBACKS}" \
FLE="${FLE}" \
APP_TESTS="${APP_TESTS}" \
.evergreen/run-tests-docker.sh

"fix absolute paths":
@@ -281,7 +274,6 @@ functions:

pre:
- func: "fetch source"
- func: "fetch egos"
- func: "create expansions"
- func: "fix absolute paths"
- func: "install dependencies"
@@ -293,7 +285,63 @@ post:
#- func: "upload test results"
- func: "upload test results to s3"

task_groups:
- 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}

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
- 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-full-atlas-task

tasks:
- name: "test"
commands:
- func: "run tests"
- name: "test-full-atlas-task"
commands:
- command: shell.exec
type: test
params:
working_dir: "src"
shell: "bash"
script: |
${PREPARE_SHELL}
MONGODB_URI="${MONGODB_URI}" \
.evergreen/run-tests-atlas-full.sh
82 changes: 11 additions & 71 deletions .evergreen/config/variants.yml.erb
Original file line number Diff line number Diff line change
@@ -43,17 +43,6 @@ buildvariants:
tasks:
- name: "test"

- matrix_name: "jruby"
matrix_spec:
jruby: ["jruby-9.3"]
driver: ["current"]
topology: ['replica-set', 'sharded-cluster']
mongodb-version: '5.0'
os: rhel80
display_name: "${jruby}, ${driver}, ${mongodb-version}, ${topology}"
tasks:
- name: "test"

- matrix_name: "ruby-2.7"
matrix_spec:
ruby: ["ruby-2.7"]
@@ -65,17 +54,6 @@ buildvariants:
tasks:
- name: "test"

- matrix_name: "ruby-2.6"
matrix_spec:
ruby: ["ruby-2.6"]
driver: ["current"]
topology: ['replica-set']
mongodb-version: ['4.0']
os: rhel80
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
tasks:
- name: "test"

- matrix_name: "driver-upcoming"
matrix_spec:
driver: [master, stable]
@@ -90,7 +68,7 @@ buildvariants:
- matrix_name: "driver-oldstable"
matrix_spec:
driver: [oldstable, min]
ruby: ["ruby-2.6"]
ruby: ["ruby-2.7"]
mongodb-version: "4.0"
topology: ['replica-set', 'sharded-cluster']
os: rhel80
@@ -101,7 +79,7 @@ buildvariants:
- matrix_name: "driver-min"
matrix_spec:
driver: [min]
ruby: ["ruby-2.6"]
ruby: ["ruby-2.7"]
mongodb-version: "3.6"
topology: "standalone"
os: rhel80
@@ -157,82 +135,44 @@ buildvariants:
tasks:
- name: "test"

- matrix_name: "rails-5"
matrix_spec:
ruby: ["ruby-2.7"]
driver: ["current"]
mongodb-version: "4.0"
topology: "standalone"
rails: ['5.2']
os: rhel80
display_name: "${rails}, ${driver}, ${mongodb-version}"
tasks:
- name: "test"

- matrix_name: "i18n-1.0"
matrix_spec:
ruby: "ruby-2.6"
driver: ["current"]
mongodb-version: "4.4"
topology: "standalone"
i18n: '1.0'
os: rhel80
display_name: "i18n-1.0 ${rails}, ${driver}, ${mongodb-version}"
tasks:
- name: "test"

- matrix_name: "i18n-fallbacks"
matrix_spec:
ruby: "ruby-2.6"
ruby: "ruby-2.7"
driver: ["current"]
mongodb-version: "4.2"
topology: "standalone"
i18n: '*'
test-i18n-fallbacks: yes
os: rhel80
display_name: "i18n fallbacks ${rails}, ${driver}, ${mongodb-version}, ${i18n}"
display_name: "i18n fallbacks ${rails}, ${driver}, ${mongodb-version}"
tasks:
- name: "test"

- matrix_name: app-tests-ruby-3
- matrix_name: app-tests-rails-7
matrix_spec:
ruby: ["ruby-3.0", "ruby-3.1", "ruby-3.2"]
ruby: ["ruby-3.1", "ruby-3.2"]
driver: ["current"]
mongodb-version: '6.0'
topology: standalone
app-tests: yes
rails: ['6.0', '6.1', '7.0', '7.1', '7.2']
os: ubuntu-22.04
rails: ['6.1', '7.0', '7.1', '7.2']
os: ubuntu-20.04
display_name: "app tests ${driver}, ${ruby}, ${rails}"
tasks:
- name: "test"

- matrix_name: app-tests-ruby-2.7
- matrix_name: app-tests-rails-6-0
matrix_spec:
ruby: ruby-2.7
ruby: ["ruby-2.7"]
driver: ["current"]
mongodb-version: '5.0'
topology: standalone
app-tests: yes
rails: ['5.2']
rails: ['6.0']
os: rhel80
display_name: "app tests ${driver}, ${ruby}, ${rails}"
tasks:
- name: "test"

- matrix_name: app-tests-jruby
matrix_spec:
jruby: ["jruby-9.3"]
driver: ["current"]
mongodb-version: '5.0'
topology: standalone
app-tests: yes
rails: ['6.0']
os: ubuntu-22.04
display_name: "app tests ${driver}, ${jruby}"
tasks:
- name: "test"

- matrix_name: "auto-encryption"
matrix_spec:
ruby: ruby-3.1
13 changes: 5 additions & 8 deletions .evergreen/make-github-actions
Original file line number Diff line number Diff line change
@@ -55,11 +55,10 @@ class EvergreenConfig < YamlConfig
# these will be later mapped to gemfile
driver: spec[:driver],
rails: spec[:rails],
i18n: spec[:i18n],
}

missing = node.map {|k, v| k if v.blank? }.compact
missing -= %i[driver rails i18n]
missing -= %i[driver rails]

if missing.present?
puts "Skipping invalid Evergreen buildvariant '#{name}'. Keys missing: #{missing}"
@@ -101,7 +100,7 @@ class GithubConfig < YamlConfig
end

class Transmogrifier
SPLATTABLE_FIELDS = %i[mongodb topology ruby rails driver i18n]
SPLATTABLE_FIELDS = %i[mongodb topology ruby rails driver]
COMPACTABLE_FIELDS = %i[mongodb topology ruby gemfile]

attr_reader :eg_config,
@@ -205,18 +204,16 @@ class Transmogrifier
end

def extract_gemfile!(node)
node[:gemfile] = get_gemfile(*node.values_at(:driver, :rails, :i18n))
node[:gemfile] = get_gemfile(*node.values_at(:driver, :rails))
end

# Ported from run-tests.sh
def get_gemfile(driver, rails, i18n)
driver, rails, i18n = [driver, rails, i18n].map {|v| v&.to_s }
def get_gemfile(driver, rails)
driver, rails = [driver, rails].map {|v| v&.to_s }
if driver && driver != 'current'
"gemfiles/driver_#{driver.underscore}.gemfile"
elsif rails && rails != '6.1' # TODO: "6.1" should be renamed to "current" in Evergreen
"gemfiles/rails-#{rails}.gemfile"
elsif i18n && i18n == '1.0'
'gemfiles/i18n-1.0.gemfile'
else
'Gemfile'
end
24 changes: 24 additions & 0 deletions .evergreen/run-tests-atlas-full.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -ex

. `dirname "$0"`/../spec/shared/shlib/distro.sh
. `dirname "$0"`/../spec/shared/shlib/set_env.sh
. `dirname "$0"`/functions.sh

set_env_vars
set_env_python
set_env_ruby

export BUNDLE_GEMFILE=gemfiles/driver_master.gemfile
bundle install

ATLAS_URI=$MONGODB_URI \
EXAMPLE_TIMEOUT=600 \
bundle exec rspec -fd spec/mongoid/search_indexable_spec.rb

test_status=$?

kill_jruby

exit ${test_status}
4 changes: 3 additions & 1 deletion .evergreen/run-tests-docker.sh
Original file line number Diff line number Diff line change
@@ -10,11 +10,13 @@ fi

params=
for var in MONGODB_VERSION TOPOLOGY RVM_RUBY \
SINGLE_MONGOS AUTH SSL APP_TESTS
SINGLE_MONGOS AUTH SSL APP_TESTS FLE RAILS DRIVER TEST_I18N_FALLBACKS
do
value="${!var}"
if test -n "$value"; then
params="$params $var=${!var}"
else
echo "$var not set"
fi
done

7 changes: 3 additions & 4 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
@@ -52,6 +52,8 @@ if echo $RVM_RUBY |grep -q jruby && test "$DRIVER" = master-jruby; then
gem install *.gem)
fi

git config --global --add safe.directory "*"

if test "$DRIVER" = "master"; then
bundle install --gemfile=gemfiles/driver_master.gemfile
BUNDLE_GEMFILE=gemfiles/driver_master.gemfile
@@ -85,9 +87,6 @@ elif test "$RAILS" = "master-jruby"; then
elif test -n "$RAILS" && test "$RAILS" != 6.1; then
bundle install --gemfile=gemfiles/rails-"$RAILS".gemfile
BUNDLE_GEMFILE=gemfiles/rails-"$RAILS".gemfile
elif test "$I18N" = "1.0"; then
bundle install --gemfile=gemfiles/i18n-1.0.gemfile
BUNDLE_GEMFILE=gemfiles/i18n-1.0.gemfile
else
bundle install
fi
@@ -105,7 +104,7 @@ elif test -n "$APP_TESTS"; then
if test -z "$DOCKER_PRELOAD"; then
./spec/shared/bin/install-node
fi

bundle exec rspec spec/integration/app_spec.rb
else
bundle exec rake ci
5 changes: 3 additions & 2 deletions spec/integration/app_spec.rb
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ def clone_application(repo_url, subdir: nil)
FileUtils.rm_rf(File.basename(repo_url))
check_call(%w(git clone) + [repo_url])
Dir.chdir(File.join(*[File.basename(repo_url), subdir].compact)) do
adjust_app_gemfile
adjust_app_gemfile(add_sprockets: false)
adjust_rails_defaults
check_call(%w(bundle install), env: clean_env)
puts `git diff`
@@ -262,7 +262,7 @@ def write_mongoid_yml
end
end

def adjust_app_gemfile(rails_version: SpecConfig.instance.rails_version)
def adjust_app_gemfile(rails_version: SpecConfig.instance.rails_version, add_sprockets: true)
remove_bundler_req

gemfile_lines = IO.readlines('Gemfile')
@@ -280,6 +280,7 @@ def adjust_app_gemfile(rails_version: SpecConfig.instance.rails_version)
gemfile_lines << "gem 'rails', '~> #{rails_version}.0'\n"
end
end
gemfile_lines << "gem 'sprockets-rails'\n" if add_sprockets
File.open('Gemfile', 'w') do |f|
f << gemfile_lines.join
end

0 comments on commit a67b088

Please sign in to comment.