Skip to content

Commit

Permalink
March development updates
Browse files Browse the repository at this point in the history
It's been a while since I last touched this, so this commit:
- updates the devcontainer definitions
- reworks the CI pipeline so that it doesn't rely on appraisal, which
  it turns out is broken in Circle until a new version is released
- updates various things in the lockfiles to avoid falling much
  further behind
- changes the default ruby for dev/test to 3.2
- removes a bunch of gems from the test environment installation

This commit brought to you by Staying Up Far Too Late.

Notably, no user-facing functionality has changed here, so no release.
bannable committed Mar 18, 2023

Verified

This commit was signed with the committer’s verified signature.
gortiz Gonzalo Ortiz Jaureguizar
1 parent af0f899 commit 004feeb
Showing 47 changed files with 1,802 additions and 2,499 deletions.
45 changes: 22 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -5,13 +5,14 @@ version: 2.1
shared_env: &shared_env
TEST_QUEUE_WORKERS: 2
CC_TEST_REPORTER_ID: 9643f9411ff1c1d359175e948cf67205d2c35883e9dc2a6d45ffde54829abfb2
SORBET_RUNTIME_ENABLE_CHECKING_IN_TESTS: true

executors:
ruby-other:
parameters:
version:
type: string
default: "3.1"
default: "3.2"
docker:
- image: cimg/ruby:<< parameters.version >>
environment:
@@ -21,7 +22,7 @@ executors:
parameters:
version:
type: string
default: "3.1"
default: "3.2"
docker:
- image: cimg/ruby:<< parameters.version >>
environment:
@@ -45,8 +46,9 @@ commands:
command : |
#!/usr/bin/env bash
bundle config set deployment 'true'
bundle config set path "./vendor/bundle"
BUNDLE_WITHOUT=development BUNDLE_PATH="$PWD/vendor/bundle" bundle install --gemfile="$PWD/$GEMFILE"
environment:
GEMFILE: gemfiles/<< parameters.appraisal >>.gemfile

install-bundler:
description: "Install the appropriate bundler version for an appraisal lockfile"
@@ -59,9 +61,7 @@ commands:
command : |
#!/usr/bin/env bash
TARGET_GEMFILE="./gemfiles/$PARAM_APPRAISAL.gemfile.lock"
APP_BUNDLER_VERSION=$(tail -1 $TARGET_GEMFILE | tr -d " ")
APP_BUNDLER_VERSION=$(tail -1 $BUNDLE_GEMFILE | tr -d " ")
if [ -z "$APP_BUNDLER_VERSION" ]; then
echo "Could not find bundler version from lockfile."
exit 1
@@ -76,50 +76,47 @@ commands:
echo "bundler $APP_BUNDLER_VERSION is already installed."
fi
environment:
PARAM_APPRAISAL: << parameters.appraisal >>
BUNDLE_GEMFILE: ./gemfiles/<< parameters.appraisal >>.gemfile.lock

jobs:
install-dependencies:
description: "Install gems with bundler and appraisal"
parameters:
version:
type: string
default: "3.1"
default: "3.2"
executor:
name: ruby-other
version: << parameters.version >>
steps:
- checkout
- restore_cache:
keys:
- gem-cache-v4-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile" }}-{{ checksum "gemfiles/standalone.gemfile.lock" }}-{{ checksum "gemfiles/rbnacl.gemfile.lock" }}-{{ checksum "gemfiles/openssl_3.0.gemfile.lock" }}
- gem-cache-v4-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile" }}
- gem-cache-v4-<< parameters.version >>-{{ arch }}
- gem-cache-v9-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile" }}-{{ checksum "gemfiles/standalone.gemfile.lock" }}-{{ checksum "gemfiles/rbnacl.gemfile.lock" }}-{{ checksum "gemfiles/openssl_3.0.gemfile.lock" }}
- install-bundler:
appraisal: rbnacl
- run:
name: "Bundle/Appraisal Install"
command : |
#!/usr/bin/env bash
bundle config set deployment 'true'
bundle config set path "./vendor/bundle"
BUNDLE_DEPLOYMENT=1 BUNDLE_WITHOUT=development BUNDLE_PATH="$PWD/vendor/bundle" bundle install
bundle install
bundle exec appraisal install
for f in `ls gemfiles/*.gemfile`; do BUNDLE_DEPLOYMENT=1 BUNDLE_NO_PRUNE=1 BUNDLE_WITHOUT=development BUNDLE_PATH="$PWD/vendor/bundle" BUNDLE_GEMFILE=$f bundle install; done
- save_cache:
key: gem-cache-v4-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile" }}-{{ checksum "gemfiles/standalone.gemfile.lock" }}-{{ checksum "gemfiles/rbnacl.gemfile.lock" }}-{{ checksum "gemfiles/openssl_3.0.gemfile.lock" }}
key: gem-cache-v9-<< parameters.version >>-{{ arch }}-{{ checksum "Gemfile" }}-{{ checksum "gemfiles/standalone.gemfile.lock" }}-{{ checksum "gemfiles/rbnacl.gemfile.lock" }}-{{ checksum "gemfiles/openssl_3.0.gemfile.lock" }}
paths:
- ./vendor/bundle
- persist_to_workspace:
root: vendor
paths:
- bundle/

specs:
parameters:
version:
type: string
default: "3.1"
default: "3.2"
appraisal:
type: string
default: standalone
@@ -152,9 +149,11 @@ jobs:
IFS="$o_ifs"
set -x
bundle exec appraisal << parameters.appraisal >> rspec "${spec_files[@]}" --profile 10 --order random --format progress --format RspecJunitFormatter -o /tmp/test-results/rspec
BUNDLE_GEMFILE="$PWD/$GEMFILE" BUNDLE_PATH="$PWD/vendor/bundle" bundle exec bin/rspec "${spec_files[@]}" --profile 10 --order random --format progress --format RspecJunitFormatter -o /tmp/test-results/rspec
set +x
./tmp/cc-test-reporter format-coverage --output tmp/codeclimate.$CIRCLE_JOB-$CIRCLE_NODE_INDEX.json
environment:
GEMFILE: gemfiles/<< parameters.appraisal >>.gemfile
- store_test_results:
path: /tmp/test-results/rspec
- persist_to_workspace:
@@ -224,7 +223,7 @@ jobs:
- run:
name: "Rubocop"
command: |
bundle exec rubocop --parallel
BUNDLE_WITHOUT=development BUNDLE_PATH="$PWD/vendor/bundle" bundle exec bin/rubocop --parallel
typecheck:
executor: ruby-other
@@ -234,7 +233,7 @@ jobs:
- run:
name: "Sorbet Typecheck"
command: |
bundle exec srb tc
BUNDLE_WITHOUT=development BUNDLE_PATH="$PWD/vendor/bundle" bundle exec bin/srb tc
workflows:
build:
@@ -249,7 +248,7 @@ workflows:
- "3.2"
- typecheck:
requires:
- install-dependencies-3.1
- install-dependencies-3.2
- specs:
matrix:
parameters:
@@ -266,7 +265,7 @@ workflows:
- install-dependencies-<< matrix.version >>
- rubocop:
requires:
- install-dependencies-3.1
- install-dependencies-3.2
- codeclimate-upload:
requires:
- specs
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ require:
AllCops:
TargetRubyVersion: 3.0
NewCops: enable
SuggestExtensions: false
Exclude:
- 'tmp/**/*'
- 'vendor/**/*'
33 changes: 24 additions & 9 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
# frozen_string_literal: true

appraise 'standalone' do
remove_gem 'parlour'
remove_gem 'reek'
remove_gem 'spoom'
group :development do
remove_gem 'appraisal'
remove_gem 'debug'
remove_gem 'parlour'
remove_gem 'reek'
remove_gem 'spoom'
remove_gem 'tapioca'
end
end

appraise 'rbnacl' do
remove_gem 'parlour'
remove_gem 'reek'
remove_gem 'spoom'
group :development do
remove_gem 'appraisal'
remove_gem 'debug'
remove_gem 'parlour'
remove_gem 'reek'
remove_gem 'spoom'
remove_gem 'tapioca'
end
gem 'rbnacl', '~> 7.1.1'
end

appraise 'openssl_3.0' do
remove_gem 'parlour'
remove_gem 'reek'
remove_gem 'spoom'
group :development do
remove_gem 'appraisal'
remove_gem 'debug'
remove_gem 'parlour'
remove_gem 'reek'
remove_gem 'spoom'
remove_gem 'tapioca'
end
gem 'openssl', '~> 3.0.0'
end
23 changes: 20 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -4,11 +4,28 @@ source 'https://rubygems.org'

gemspec

gem 'debug', '>= 1.0'
group :development do
# https://github.com/thoughtbot/appraisal/pull/205
# Move back into the gemspec after Thoughtbot releases a fixed version
gem 'appraisal', '~> 2', github: 'thoughtbot/appraisal', ref: 'b200e636903700098bef25f4f51dbc4c46e4c04c'

gem 'bundler', '~> 2'
gem 'debug', '>= 1.0'
gem 'parlour'
gem 'tapioca', '~> 0.10.3'
end

gem 'oj'
gem 'parallel_tests'
gem 'parlour'
gem 'rake', '~> 13'
gem 'reek'
gem 'rspec', '~> 3'
gem 'rspec_junit_formatter'
gem 'rubocop', '~> 1.48.1'
gem 'rubocop-performance', '~> 1.16.0'
gem 'rubocop-rspec', '~> 2.19.0'
gem 'rubocop-sorbet', '~> 0.7.0'
gem 'simplecov', '~> 0'
gem 'simplecov_json_formatter'
gem 'tapioca', '~> 0.10.3'
gem 'sorbet', '~> 0'
gem 'timecop', '~> 0'
Loading

0 comments on commit 004feeb

Please sign in to comment.