From 4456c353a4fa418d9155aa2a0f3c602bbe928e53 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Mon, 5 Feb 2024 18:46:58 +0000 Subject: [PATCH 1/4] chore(deps): bump ruby versions to 3.2.3 --- Dockerfile-bundle-base | 6 +++--- Dockerfile-package-base | 6 +++--- pact_broker/.ruby-version | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile-bundle-base b/Dockerfile-bundle-base index a3b3042..2cbaaa8 100644 --- a/Dockerfile-bundle-base +++ b/Dockerfile-bundle-base @@ -1,4 +1,4 @@ -FROM ruby:2.7.8-alpine3.16 +FROM ruby:3.2.3-alpine3.19 # Installation path ENV HOME=/pact_broker @@ -8,8 +8,8 @@ WORKDIR $HOME RUN set -ex && \ adduser -h $HOME -s /bin/false -D -S -G root ruby && \ chmod g+w $HOME && \ - apk add --update --no-cache make gcc libc-dev mariadb-dev postgresql-dev sqlite-dev + apk add --update --no-cache make gcc libc-dev mariadb-dev postgresql-dev sqlite-dev git -RUN gem install bundler -v 2.4.7 +RUN gem install bundler -v 2.4.22 COPY pact_broker/Gemfile pact_broker/Gemfile.lock $HOME/ RUN bundle install --no-cache diff --git a/Dockerfile-package-base b/Dockerfile-package-base index 502aa63..d79d6fa 100644 --- a/Dockerfile-package-base +++ b/Dockerfile-package-base @@ -1,11 +1,11 @@ -FROM ruby:2.7.8-alpine3.16 +FROM ruby:3.2.3-alpine3.19 # Installation path ENV HOME=/app WORKDIR $HOME -RUN apk add --update --no-cache git -RUN gem install bundler -v 2.4.7 +RUN apk add --update --no-cache make gcc libc-dev mariadb-dev postgresql-dev sqlite-dev git +RUN gem install bundler -v 2.4.22 COPY Rakefile $HOME/ COPY Gemfile Gemfile.lock $HOME/ diff --git a/pact_broker/.ruby-version b/pact_broker/.ruby-version index 0444f32..06eda28 100644 --- a/pact_broker/.ruby-version +++ b/pact_broker/.ruby-version @@ -1 +1 @@ -3.2.1 \ No newline at end of file +3.2.3 \ No newline at end of file From ef64492a5a33e276843788e8b24b0b30f9c45d93 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Mon, 5 Feb 2024 18:47:46 +0000 Subject: [PATCH 2/4] chore(deps): bundler 2.4.22 / suckerpunch 3.x --- Gemfile.lock | 225 +++++++++++++++++++-------------------- pact_broker/Gemfile | 5 +- pact_broker/Gemfile.lock | 17 +-- 3 files changed, 118 insertions(+), 129 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 062c663..5645d6f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,185 +12,185 @@ GIT specs: conventional-changelog (1.3.0) -GIT - remote: https://github.com/pact-foundation/sucker_punch.git - revision: 573ff03c5f689568efbb733ed2997728f0098d5a - ref: fix/rename-is-singleton-class-method-2 - specs: - sucker_punch (2.1.2) - concurrent-ruby (~> 1.0) - GEM remote: https://rubygems.org/ specs: - anyway_config (2.3.1) - ruby-next-core (>= 0.14.0) + anyway_config (2.6.2) + ruby-next-core (~> 1.0) as-notifications (1.0.2) awesome_print (1.9.2) - concurrent-ruby (1.2.0) + base64 (0.2.0) + bigdecimal (3.1.6) + concurrent-ruby (1.2.3) crass (1.0.6) declarative (0.0.20) - declarative-builder (0.1.0) - declarative-option (< 0.2.0) - declarative-option (0.1.0) - diff-lcs (1.5.0) - disposable (0.4.7) + diff-lcs (1.5.1) + disposable (0.6.3) declarative (>= 0.0.9, < 1.0.0) - declarative-builder (< 0.2.0) - declarative-option (< 0.2.0) - representable (>= 2.4.0, <= 3.1.0) - uber (< 0.2.0) - dry-configurable (0.12.1) + representable (>= 3.1.1, < 4) + dry-configurable (1.1.0) + dry-core (~> 1.0, < 2) + zeitwerk (~> 2.6) + dry-core (1.0.1) concurrent-ruby (~> 1.0) - dry-core (~> 0.5, >= 0.5.0) - dry-container (0.8.0) + zeitwerk (~> 2.6) + dry-inflector (1.0.0) + dry-initializer (3.1.1) + dry-logic (1.5.0) concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1, >= 0.1.3) - dry-core (0.9.1) + dry-core (~> 1.0, < 2) + zeitwerk (~> 2.6) + dry-schema (1.13.3) concurrent-ruby (~> 1.0) + dry-configurable (~> 1.0, >= 1.0.1) + dry-core (~> 1.0, < 2) + dry-initializer (~> 3.0) + dry-logic (>= 1.4, < 2) + dry-types (>= 1.7, < 2) zeitwerk (~> 2.6) - dry-equalizer (0.3.0) - dry-logic (0.4.2) - dry-container (~> 0.2, >= 0.2.6) - dry-core (~> 0.2) - dry-equalizer (~> 0.2) - dry-types (0.10.3) + dry-types (1.7.2) + bigdecimal (~> 3.0) concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1) - dry-container (~> 0.3) - dry-core (~> 0.2, >= 0.2.1) - dry-equalizer (~> 0.2) - dry-logic (~> 0.4, >= 0.4.0) - inflecto (~> 0.0.0, >= 0.0.2) - dry-validation (0.10.7) + dry-core (~> 1.0) + dry-inflector (~> 1.0) + dry-logic (~> 1.4) + zeitwerk (~> 2.6) + dry-validation (1.10.0) concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1, >= 0.1.3) - dry-core (~> 0.2, >= 0.2.1) - dry-equalizer (~> 0.2) - dry-logic (~> 0.4, >= 0.4.0) - dry-types (~> 0.9, >= 0.9.0) + dry-core (~> 1.0, < 2) + dry-initializer (~> 3.0) + dry-schema (>= 1.12, < 2) + zeitwerk (~> 2.6) expgen (0.1.1) parslet haml (5.2.2) temple (>= 0.8.0) tilt - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - inflecto (0.0.2) - json (2.6.3) - mini_portile2 (2.8.1) + json (2.7.1) + mini_portile2 (2.8.5) + moments (0.3.0) multi_json (1.15.0) - mustermann (2.0.2) + mustermann (3.0.0) ruby2_keywords (~> 0.0.1) mysql2 (0.5.5) - nio4r (2.5.8) - nokogiri (1.14.1) - mini_portile2 (~> 2.8.0) + nio4r (2.7.0) + nokogiri (1.16.2) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - pact-support (1.19.0) + pact-support (1.20.0) awesome_print (~> 1.9) - diff-lcs (~> 1.4) + diff-lcs (~> 1.5) expgen (~> 0.1) rainbow (~> 3.1.1) - pact_broker (2.105.0) + pact_broker (2.109.0) anyway_config (~> 2.1) - dry-configurable (= 0.12.1) - dry-container (= 0.8.0) - dry-logic (= 0.4.2) - dry-types (~> 0.10.3) - dry-validation (~> 0.10.5) + dry-validation (~> 1.8) haml (~> 5.0) json (~> 2.3) + moments (~> 0.2) pact-support (~> 1.16, >= 1.16.4) padrino-core (~> 0.14, >= 0.14.3) + psych (~> 4.0) rack (~> 2.2, >= 2.2.3) - rack-protection (>= 2.0.8.1, < 3.0) + rack-protection (~> 3.0) redcarpet (~> 3.5, >= 3.5.1) - reform (~> 2.3.3) + reform (~> 2.6) request_store (~> 1.5) roar (~> 1.1) - sanitize (= 6.0) + sanitize (~> 6.0) semantic_logger (~> 4.11) semver2 (~> 3.4.2) sequel (~> 5.28) - sinatra (>= 2.0.8.1, < 3.0) - sucker_punch (~> 2.0) + sinatra (~> 3.0) + sucker_punch (~> 3.0) table_print (~> 1.5) - webmachine (= 1.6.0) + webmachine (>= 2.0.0.beta, < 3.0) + webrick (~> 1.8) wisper (~> 2.0) - padrino-core (0.15.2) - padrino-support (= 0.15.2) + padrino-core (0.15.3) + padrino-support (= 0.15.3) sinatra (>= 2.2.4) thor (~> 1.0) - padrino-support (0.15.2) + padrino-support (0.15.3) parslet (2.0.0) - pg (1.4.5) - puma (5.6.5) + pg (1.5.4) + psych (4.0.6) + stringio + puma (5.6.8) nio4r (~> 2.0) - racc (1.6.2) - rack (2.2.6.2) - rack-protection (2.2.4) - rack - rack-test (2.0.2) + racc (1.7.3) + rack (2.2.8) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-test (2.1.0) rack (>= 1.3) rainbow (3.1.1) - rake (13.0.6) + rake (13.1.0) redcarpet (3.6.0) - reform (2.3.3) - disposable (>= 0.4.2, < 0.5.0) - representable (>= 2.4.0, < 3.1.0) + reform (2.6.2) + disposable (>= 0.5.0, < 1.0.0) + representable (>= 3.1.1, < 4) uber (< 0.2.0) - representable (3.0.4) + representable (3.2.0) declarative (< 0.1.0) - declarative-option (< 0.2.0) + trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) request_store (1.5.1) rack (>= 1.4) - roar (1.1.1) - representable (~> 3.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + roar (1.2.0) + representable (~> 3.1) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) + rspec-support (~> 3.13.0) rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.12.3) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.0) - ruby-next-core (0.15.3) + rspec-support (~> 3.13.0) + rspec-support (3.13.0) + ruby-next-core (1.0.1) ruby2_keywords (0.0.5) - sanitize (6.0.0) + sanitize (6.1.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - semantic_logger (4.12.0) + semantic_logger (4.15.0) concurrent-ruby (~> 1.0) semver2 (3.4.2) - sequel (5.65.0) - sinatra (2.2.4) - mustermann (~> 2.0) - rack (~> 2.2) - rack-protection (= 2.2.4) + sequel (5.77.0) + bigdecimal + sinatra (3.2.0) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.2.0) tilt (~> 2.0) - sqlite3 (1.6.0) + sqlite3 (1.7.2) mini_portile2 (~> 2.8.0) + stringio (3.1.0) + sucker_punch (3.2.0) + concurrent-ruby (~> 1.0) table_print (1.5.7) - temple (0.10.0) - thor (1.2.1) - tilt (2.0.11) + temple (0.10.3) + thor (1.3.0) + tilt (2.3.0) + trailblazer-option (0.1.2) uber (0.1.0) - webmachine (1.6.0) - as-notifications (~> 1.0) + webmachine (2.0.0) + as-notifications (>= 1.0.2, < 2.0) i18n (>= 0.4.0) multi_json + webrick (1.8.1) wisper (2.0.1) - zeitwerk (2.6.6) + zeitwerk (2.6.12) PLATFORMS ruby @@ -201,14 +201,13 @@ DEPENDENCIES conventional-changelog! mysql2 (~> 0.3) pact_broker - pg (~> 1.4) - puma (~> 5.6) + pg (~> 1.5) + puma (~> 5.6, >= 5.6.8) rack-test (~> 2.0, >= 2.0.2) rake (~> 13.0) rspec (~> 3.7) rspec-its (~> 1.2) sqlite3 (~> 1.6) - sucker_punch! BUNDLED WITH - 2.4.12 + 2.5.5 diff --git a/pact_broker/Gemfile b/pact_broker/Gemfile index 570e6b3..28cf3fa 100644 --- a/pact_broker/Gemfile +++ b/pact_broker/Gemfile @@ -5,7 +5,4 @@ gem "pg", "~>1.5" gem "puma", "~> 5.6", ">= 5.6.8" gem "mysql2", "~>0.3" gem "sqlite3", "~>1.6" -gem "rake", "~> 13.0" - -# While https://github.com/brandonhilkert/sucker_punch/pull/253 is outstanding -gem "sucker_punch", git: "https://github.com/pact-foundation/sucker_punch.git", ref: "fix/rename-is-singleton-class-method-2" +gem "rake", "~> 13.0" \ No newline at end of file diff --git a/pact_broker/Gemfile.lock b/pact_broker/Gemfile.lock index 4d22dff..516136a 100644 --- a/pact_broker/Gemfile.lock +++ b/pact_broker/Gemfile.lock @@ -1,11 +1,3 @@ -GIT - remote: https://github.com/pact-foundation/sucker_punch.git - revision: 573ff03c5f689568efbb733ed2997728f0098d5a - ref: fix/rename-is-singleton-class-method-2 - specs: - sucker_punch (2.1.2) - concurrent-ruby (~> 1.0) - GEM remote: https://rubygems.org/ specs: @@ -78,7 +70,7 @@ GEM diff-lcs (~> 1.5) expgen (~> 0.1) rainbow (~> 3.1.1) - pact_broker (2.108.0) + pact_broker (2.109.0) anyway_config (~> 2.1) dry-validation (~> 1.8) haml (~> 5.0) @@ -98,7 +90,7 @@ GEM semver2 (~> 3.4.2) sequel (~> 5.28) sinatra (~> 3.0) - sucker_punch (~> 2.0) + sucker_punch (~> 3.0) table_print (~> 1.5) webmachine (>= 2.0.0.beta, < 3.0) webrick (~> 1.8) @@ -152,6 +144,8 @@ GEM sqlite3 (1.7.2) mini_portile2 (~> 2.8.0) stringio (3.1.0) + sucker_punch (3.2.0) + concurrent-ruby (~> 1.0) table_print (1.5.7) temple (0.10.3) thor (1.3.0) @@ -176,7 +170,6 @@ DEPENDENCIES puma (~> 5.6, >= 5.6.8) rake (~> 13.0) sqlite3 (~> 1.6) - sucker_punch! BUNDLED WITH - 2.4.12 + 2.4.22 From f45efb71ecb563c46500de8f98c9b11fda6e2ed5 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Mon, 5 Feb 2024 18:48:48 +0000 Subject: [PATCH 3/4] chore: set docker-functions platform to linux/amd64 --- script/docker-functions | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/docker-functions b/script/docker-functions index e4d8a5c..894f12c 100644 --- a/script/docker-functions +++ b/script/docker-functions @@ -1,25 +1,25 @@ #!/usr/bin/env bash function docker_build_bundle_base() { - docker build . -f Dockerfile-bundle-base -t pact_broker_bundle_base + docker build . --platform=linux/amd64 -f Dockerfile-bundle-base -t pact_broker_bundle_base } function bundle_update_on_docker() { rm -rf tmp/Gemfile.lock if [ -n "$1" ]; then echo "Installing version ${1} of the pact_broker gem" - docker run --rm -v ${PWD}/tmp:/tmp/shared pact_broker_bundle_base:latest sh -c "gem install pact_broker -v $1 && bundle update && cp Gemfile.lock /tmp/shared" + docker run --platform=linux/amd64 --rm -v ${PWD}/tmp:/tmp/shared pact_broker_bundle_base:latest sh -c "gem install pact_broker -v $1 && bundle update && cp Gemfile.lock /tmp/shared" else echo "Updating gems" - docker run --rm -v ${PWD}/tmp:/tmp/shared pact_broker_bundle_base:latest sh -c "bundle update && cp Gemfile.lock /tmp/shared" + docker run --platform=linux/amd64 --rm -v ${PWD}/tmp:/tmp/shared pact_broker_bundle_base:latest sh -c "bundle update && cp Gemfile.lock /tmp/shared" fi mv tmp/Gemfile.lock pact_broker/ } function docker_build_package_base() { - docker build . -f Dockerfile-package-base -t pact_broker_package_base + docker build . --platform=linux/amd64 -f Dockerfile-package-base -t pact_broker_package_base } function run_on_package_base() { - docker run --rm -it pact_broker_package_base sh -c "$@" + docker run --platform=linux/amd64 --rm -it pact_broker_package_base sh -c "$@" } From b92e027ec62a3e10f15c8830a835bf51db4eefdf Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Mon, 5 Feb 2024 18:55:08 +0000 Subject: [PATCH 4/4] chore: ensure bundler set to 2.4.22 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5645d6f..b265dce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -210,4 +210,4 @@ DEPENDENCIES sqlite3 (~> 1.6) BUNDLED WITH - 2.5.5 + 2.4.22