From 86e881fce59144af88c5bfda9ffade1623887662 Mon Sep 17 00:00:00 2001 From: meyric Date: Fri, 23 Aug 2024 09:00:06 +0100 Subject: [PATCH 1/6] Fix: default Mail Notify version Whilst we generally pass this argument, it should be `2.0.0`. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 08b5e46..6956f48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,7 +45,7 @@ COPY --from=build /rails /rails WORKDIR /rails/mail-notify-integration # add Mail Notify to the Gemfile -ARG MAIL_NOTIFY_BRANCH=v2 +ARG MAIL_NOTIFY_BRANCH=2.0.0 RUN echo "gem 'mail-notify', git: 'https://github.com/dxw/mail-notify', branch: '${MAIL_NOTIFY_BRANCH}'" >> Gemfile # install the mail-notify gem, we do this here to keep the last container layer small to help caching From 2e6e111ee89b0ba22ce08bf06b8cd420190e7ca4 Mon Sep 17 00:00:00 2001 From: meyric Date: Fri, 23 Aug 2024 09:01:46 +0100 Subject: [PATCH 2/6] Fix: Docker file as to AS --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6956f48..c0cd53d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # We want to support older Rubies ARG RUBY_VERSION=2.7.8 -FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base +FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base # Rails app lives here WORKDIR /rails # Build stage -FROM base as build +FROM base AS build # Install packages needed to build gems and node modules RUN apt-get update -qq && \ From 0fde31b4c8cf0381c8bcd4b7c6dddefb827ae6e1 Mon Sep 17 00:00:00 2001 From: meyric Date: Fri, 23 Aug 2024 09:27:33 +0100 Subject: [PATCH 3/6] Chore: Update default Rails version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c0cd53d..7b1cbc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update -qq && \ RUN gem install nokogiri -v 1.15.6 # Install Rails -ARG RAILS_VERSION=7.1.3.2 +ARG RAILS_VERSION=7.2.1 RUN gem install rails -v ${RAILS_VERSION} # create empty Rails application, we don't need ActiveRecord or JavaScript From 3afb204a1ecb3c4b676d68d4a47f146a059aa00f Mon Sep 17 00:00:00 2001 From: meyric Date: Fri, 23 Aug 2024 09:17:05 +0100 Subject: [PATCH 4/6] Remove Ruby 2 and Rails 5 defaults We are dropping integration test support for these end of life versions. This work will focus solely on the integration tests and not the gem itself. --- Dockerfile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7b1cbc7..22204fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -# We want to support older Rubies -ARG RUBY_VERSION=2.7.8 +ARG RUBY_VERSION=3.1.6 FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base # Rails app lives here @@ -12,9 +11,6 @@ FROM base AS build RUN apt-get update -qq && \ apt-get install --no-install-recommends -y build-essential curl git -# Install Nokigiri version that supports Ruby 2.7.8 -RUN gem install nokogiri -v 1.15.6 - # Install Rails ARG RAILS_VERSION=7.2.1 RUN gem install rails -v ${RAILS_VERSION} @@ -27,9 +23,6 @@ WORKDIR mail-notify-integration # install the gems into the bundle RUN bundle install -# remove gems that will not work in Rails 5.2.8.1 -RUN if [ "${RAILS_VERSION}" = "5.2.8.1" ]; then bundle remove selenium-webdriver chromedriver-helper; fi - # Final stage for app image FROM base From b9c1846597b14e2e6c5c08f2c114f001316ca5f4 Mon Sep 17 00:00:00 2001 From: meyric Date: Fri, 23 Aug 2024 09:19:06 +0100 Subject: [PATCH 5/6] Remove Rails 5 from integration tests We are dropping support for Rails 5 in our integration tests. --- .github/workflows/rails-integration-tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rails-integration-tests.yml b/.github/workflows/rails-integration-tests.yml index 0031acd..4ac5960 100644 --- a/.github/workflows/rails-integration-tests.yml +++ b/.github/workflows/rails-integration-tests.yml @@ -13,17 +13,17 @@ jobs: outputs: RAILS_VERSIONS: ${{ steps.compute-outputs.outputs.RAILS_VERSIONS }} steps: - # Get latest Rails versions for 5.x.x, 6.x.x and 7.x.x + # Get latest Rails versions for 6.x.x and 7.x.x - id: compute-outputs name: Compute outputs run: | - rails_versions=$(curl https://rubygems.org/api/v1/versions/rails.json | jq 'group_by(.number[:1])[] | (.[0].number) | select(.[:1]|tonumber > 4)' | jq -s -c) + rails_versions=$(curl https://rubygems.org/api/v1/versions/rails.json | jq 'group_by(.number[:1])[] | (.[0].number) | select(.[:1]|tonumber > 5)' | jq -s -c) echo "RAILS_VERSIONS=$rails_versions" >> $GITHUB_OUTPUT build-rails: strategy: fail-fast: false matrix: - # Build containers with the latest 5.x.x, 6.x.x and 7.x.x Rails versions + # Build containers with the latest 6.x.x and 7.x.x Rails versions rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }} runs-on: ubuntu-latest name: Build and cache Docker containers @@ -54,7 +54,7 @@ jobs: mailer-previews: strategy: fail-fast: false - # Run against the latest 5.x.x, 6.x.x and 7.x.x Rails versions + # Run against the latest 6.x.x and 7.x.x Rails versions matrix: rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }} runs-on: ubuntu-latest @@ -114,4 +114,4 @@ jobs: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') - }} \ No newline at end of file + }} From 0f1f10dc11ecd2965f75b6eec24225286e16f222 Mon Sep 17 00:00:00 2001 From: meyric Date: Fri, 23 Aug 2024 09:31:47 +0100 Subject: [PATCH 6/6] Don't fetch beta Rails version numbers --- .github/workflows/rails-integration-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rails-integration-tests.yml b/.github/workflows/rails-integration-tests.yml index 4ac5960..ac2260c 100644 --- a/.github/workflows/rails-integration-tests.yml +++ b/.github/workflows/rails-integration-tests.yml @@ -16,8 +16,9 @@ jobs: # Get latest Rails versions for 6.x.x and 7.x.x - id: compute-outputs name: Compute outputs + # fetches current Rails versions numbers > 5 and not 'beta' run: | - rails_versions=$(curl https://rubygems.org/api/v1/versions/rails.json | jq 'group_by(.number[:1])[] | (.[0].number) | select(.[:1]|tonumber > 5)' | jq -s -c) + rails_versions=$(curl https://rubygems.org/api/v1/versions/rails.json | jq '[.[] | select(.number | test("beta") | not)] | group_by(.number[:1])[] | (.[0].number) | select(.[:1]|tonumber > 5)' | jq -s -c) echo "RAILS_VERSIONS=$rails_versions" >> $GITHUB_OUTPUT build-rails: strategy: