Skip to content

Commit

Permalink
Test for possible version mismatches of base64 (stdlib) gem
Browse files Browse the repository at this point in the history
base64 is part of the ruby stdlib https://stdgems.org/base64/.
Rubocop adds it now as a gem dependency since it gets removed
from the stdlib with ruby 3.4 rubocop/rubocop#12094.
The introduced version of base64 matches the one of our
currently used ruby version (3.1.4). We have to make sure
that the version that now is included to our bundle does not
mismatch in the future due to possible introduced updates.
  • Loading branch information
krauselukas committed Aug 14, 2023
1 parent 92826a0 commit c18667d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .circleci/conditional_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ parameters:
type: boolean
default: false

run-passenger-tests:
run-passenger-and-ruby-default-gem-tests:
type: boolean
default: false

Expand Down Expand Up @@ -309,7 +309,7 @@ jobs:
bundle exec rake db:seed
bundle exec rake data:migrate
passenger_tests:
passenger_and_default_gem_tests:
docker:
- <<: *frontend_base
steps:
Expand All @@ -320,6 +320,7 @@ jobs:
command: |
make -C src/api test_rake
make -C src/api test_rack
make -C src/api test_base64_gem
spider:
parallelism: 2
Expand Down Expand Up @@ -502,11 +503,11 @@ workflows:
requires:
- checkout_code

passenger_tests:
when: << pipeline.parameters.run-passenger-tests >>
passenger_and_ruby_default_gem_tests:
when: << pipeline.parameters.run-passenger-and-ruby-default-gem-tests >>
jobs:
- checkout_code
- passenger_tests:
- passenger_and_ruby_default_gem_tests:
requires:
- checkout_code

Expand Down Expand Up @@ -556,4 +557,3 @@ workflows:
- feature:
requires:
- linters

2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ workflows:
src/api/app/(views|components)/.* run-haml-linter true
src/api/vendor/cache/haml.* run-haml-linter true
src/api/db/.* run-migrations-tests true
src/api/Gemfile.lock run-passenger-tests true
src/api/Gemfile.lock run-passenger-and-ruby-default-gem-tests true
src/api/app/assets/javascripts/.* run-javascripts-linter true
src/api/public/apidocs-new/.* run-apidocs-linter true
base-revision: master
Expand Down
5 changes: 5 additions & 0 deletions src/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ test_rack:
$(eval BUNDLE_RACK_VERSION:=$(shell basename `bundle show rack`))
@if [ "$(SYSTEM_RACK_VERSION)" != "$(BUNDLE_RACK_VERSION)" ]; then echo "rack version mismatch! System: $(SYSTEM_RACK_VERSION) / Bundle: $(BUNDLE_RACK_VERSION)"; exit 1; fi

test_base64_gem:
$(eval RUBY_DEFAULT_BASE64_VERSION:=$(shell gem list --local base64 | grep -Po 'default:\s\K[0-9]\.[0-9]\.[0-9]+'))
$(eval BUNDLE_BASE64_VERSION:=$(shell bundle show base64 | xargs basename | grep -Eo '[0-9]\.[0-9]\.[0-9]+'))
@if [ "$(RUBY_DEFAULT_BASE64_VERSION)" != "$(BUNDLE_BASE64_VERSION)" ]; then echo "base64 version mismatch! System Ruby Default: $(RUBY_DEFAULT_BASE64_VERSION) / Bundle: $(BUNDLE_BASE64_VERSION)"; exit 1; fi

clean:
rm -rf ../../docs/api/html

Expand Down

0 comments on commit c18667d

Please sign in to comment.