From a13a2512f469b50d51663b86d1f6aa4f744101a8 Mon Sep 17 00:00:00 2001 From: Rafal Wojsznis Date: Tue, 12 Nov 2024 06:52:33 +0100 Subject: [PATCH 1/5] Remove redundant docker compose setup Ruby works perfectly fine on ARMs nowadays, no need to keep all this stuff in dockerfile --- Dockerfile-2.6.6 | 22 ---------------------- Dockerfile-3.1.0 | 22 ---------------------- README.md | 2 +- docker-compose.yml | 20 +------------------- 4 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 Dockerfile-2.6.6 delete mode 100644 Dockerfile-3.1.0 diff --git a/Dockerfile-2.6.6 b/Dockerfile-2.6.6 deleted file mode 100644 index 78f9487..0000000 --- a/Dockerfile-2.6.6 +++ /dev/null @@ -1,22 +0,0 @@ -FROM ruby:2.6.6-buster - -ENV BUNDLE_JOBS=4 \ - BUNDLE_RETRY=5 - -WORKDIR /app - -RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - apt-get update && apt-get install --no-install-recommends -y \ - postgresql-client-12 \ - && rm -rf /var/lib/apt/lists/* - -COPY Gemfile conflict_free_schema.gemspec ./ - -ENV BUNDLE_VERSION=2.0.2 - -RUN gem update --system && gem install bundler:$BUNDLE_VERSION -RUN bundle install - -COPY Appraisals gemfiles/ ./ -RUN bundle exec appraisal install diff --git a/Dockerfile-3.1.0 b/Dockerfile-3.1.0 deleted file mode 100644 index dcb9d19..0000000 --- a/Dockerfile-3.1.0 +++ /dev/null @@ -1,22 +0,0 @@ -FROM ruby:3.1.0-buster - -ENV BUNDLE_JOBS=4 \ - BUNDLE_RETRY=5 - -WORKDIR /app - -RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - apt-get update && apt-get install --no-install-recommends -y \ - postgresql-client-12 \ - && rm -rf /var/lib/apt/lists/* - -COPY Gemfile conflict_free_schema.gemspec ./ - -ENV BUNDLE_VERSION=2.3.4 - -RUN gem update --system && gem install bundler:$BUNDLE_VERSION -RUN bundle install - -COPY Appraisals gemfiles/ ./ -RUN bundle exec appraisal install diff --git a/README.md b/README.md index 241d646..639ac5b 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,4 @@ If you're using `structure.sql` in your Rails project with postgresql - instead ## Development -You can spin up docker-based development environment with provided `docker-compose` file (useful for Apple M1 users) or simply install dependencies locally. +You can spin up postgres test dependency with provided `docker compose`. diff --git a/docker-compose.yml b/docker-compose.yml index 489b1be..820df0b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,24 +1,6 @@ -version: "3" services: - ruby: - build: - context: . - dockerfile: Dockerfile-2.6.6 - image: conflict_free_schema - environment: - BOOTSNAP_CACHE_DIR: /usr/local/bundle/_bootsnap - HISTFILE: /app/log/.bash_history - PSQL_HISTFILE: /app/log/.psql_history - depends_on: - - postgres - volumes: - - .:/app:cached - tmpfs: - - /tmp - stdin_open: true - tty: true postgres: - image: postgres:12.5-alpine + image: postgres:16.4-alpine volumes: - postgres:/var/lib/postgresql/data - ./log:/root/log:cached From d3bdf6662b054fe6d8e7c4eb9631adf6a0269891 Mon Sep 17 00:00:00 2001 From: Rafal Wojsznis Date: Tue, 12 Nov 2024 06:57:01 +0100 Subject: [PATCH 2/5] Drop ruby 2.x from test matrix --- .github/workflows/ci.yml | 44 +++++++++++++++------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76da30e..84cbe6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,34 +12,22 @@ jobs: fail-fast: false matrix: cfg: - - { ruby: 2.6, postgres: 12, gemfile: rails_6.0 } - - { ruby: 2.7, postgres: 12, gemfile: rails_6.0 } - - { ruby: 3.0.3, postgres: 12, gemfile: rails_6.0 } - - { ruby: 2.6, postgres: 13, gemfile: rails_6.0 } - - { ruby: 2.7, postgres: 13, gemfile: rails_6.0 } - - { ruby: 3.0.3, postgres: 13, gemfile: rails_6.0 } - - { ruby: 2.6, postgres: 12, gemfile: rails_6.1 } - - { ruby: 2.7, postgres: 12, gemfile: rails_6.1 } - - { ruby: 3.0.3, postgres: 12, gemfile: rails_6.1 } - - { ruby: 2.6, postgres: 13, gemfile: rails_6.1 } - - { ruby: 2.7, postgres: 13, gemfile: rails_6.1 } - - { ruby: 3.0.3, postgres: 13, gemfile: rails_6.1 } - - { ruby: 2.7, postgres: 12, gemfile: rails_7.0 } - - { ruby: 3.0.3, postgres: 12, gemfile: rails_7.0 } - - { ruby: 3.1, postgres: 12, gemfile: rails_7.0 } - - { ruby: 2.7, postgres: 13, gemfile: rails_7.0 } - - { ruby: 3.0.3, postgres: 13, gemfile: rails_7.0 } - - { ruby: 3.1, postgres: 13, gemfile: rails_7.0 } - - { ruby: 2.7, postgres: 12, gemfile: rails_7.1 } - - { ruby: 3.0.3, postgres: 12, gemfile: rails_7.1 } - - { ruby: 3.1, postgres: 12, gemfile: rails_7.1 } - - { ruby: 2.7, postgres: 13, gemfile: rails_7.1 } - - { ruby: 3.0.3, postgres: 13, gemfile: rails_7.1 } - - { ruby: 3.1, postgres: 13, gemfile: rails_7.1 } - - { ruby: 3.1, postgres: 12, gemfile: rails_7.2 } - - { ruby: 3.2, postgres: 12, gemfile: rails_7.2 } - - { ruby: 3.1, postgres: 13, gemfile: rails_7.2 } - - { ruby: 3.2, postgres: 13, gemfile: rails_7.2 } + - { ruby: 3.0.7, postgres: 12, gemfile: rails_6.0 } + - { ruby: 3.0.7, postgres: 13, gemfile: rails_6.0 } + - { ruby: 3.0.7, postgres: 12, gemfile: rails_6.1 } + - { ruby: 3.0.7, postgres: 13, gemfile: rails_6.1 } + - { ruby: 3.0.7, postgres: 12, gemfile: rails_7.0 } + - { ruby: 3.1.6, postgres: 12, gemfile: rails_7.0 } + - { ruby: 3.0.7, postgres: 13, gemfile: rails_7.0 } + - { ruby: 3.1.6, postgres: 13, gemfile: rails_7.0 } + - { ruby: 3.0.7, postgres: 12, gemfile: rails_7.1 } + - { ruby: 3.1.6, postgres: 12, gemfile: rails_7.1 } + - { ruby: 3.0.7, postgres: 13, gemfile: rails_7.1 } + - { ruby: 3.1.6, postgres: 13, gemfile: rails_7.1 } + - { ruby: 3.1.6, postgres: 12, gemfile: rails_7.2 } + - { ruby: 3.2.6, postgres: 12, gemfile: rails_7.2 } + - { ruby: 3.1.6, postgres: 13, gemfile: rails_7.2 } + - { ruby: 3.2.6, postgres: 13, gemfile: rails_7.2 } env: BUNDLE_GEMFILE: gemfiles/${{ matrix.cfg.gemfile }}.gemfile From 7ea350b3d946d5ffe9252d40a1a3ba3a94064c84 Mon Sep 17 00:00:00 2001 From: Rafal Wojsznis Date: Tue, 12 Nov 2024 07:01:36 +0100 Subject: [PATCH 3/5] Bump postgres version in test matrix --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84cbe6a..68bfb02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,22 +12,33 @@ jobs: fail-fast: false matrix: cfg: - - { ruby: 3.0.7, postgres: 12, gemfile: rails_6.0 } - - { ruby: 3.0.7, postgres: 13, gemfile: rails_6.0 } - - { ruby: 3.0.7, postgres: 12, gemfile: rails_6.1 } - - { ruby: 3.0.7, postgres: 13, gemfile: rails_6.1 } - - { ruby: 3.0.7, postgres: 12, gemfile: rails_7.0 } - - { ruby: 3.1.6, postgres: 12, gemfile: rails_7.0 } - - { ruby: 3.0.7, postgres: 13, gemfile: rails_7.0 } - - { ruby: 3.1.6, postgres: 13, gemfile: rails_7.0 } - - { ruby: 3.0.7, postgres: 12, gemfile: rails_7.1 } - - { ruby: 3.1.6, postgres: 12, gemfile: rails_7.1 } - - { ruby: 3.0.7, postgres: 13, gemfile: rails_7.1 } - - { ruby: 3.1.6, postgres: 13, gemfile: rails_7.1 } - - { ruby: 3.1.6, postgres: 12, gemfile: rails_7.2 } - - { ruby: 3.2.6, postgres: 12, gemfile: rails_7.2 } - - { ruby: 3.1.6, postgres: 13, gemfile: rails_7.2 } - - { ruby: 3.2.6, postgres: 13, gemfile: rails_7.2 } + - { ruby: 3.0.7, postgres: 14, gemfile: rails_6.0 } + - { ruby: 3.0.7, postgres: 15, gemfile: rails_6.0 } + - { ruby: 3.0.7, postgres: 16, gemfile: rails_6.0 } + + - { ruby: 3.0.7, postgres: 14, gemfile: rails_6.1 } + - { ruby: 3.0.7, postgres: 15, gemfile: rails_6.1 } + - { ruby: 3.0.7, postgres: 16, gemfile: rails_6.1 } + + - { ruby: 3.0.7, postgres: 14, gemfile: rails_7.0 } + - { ruby: 3.0.7, postgres: 15, gemfile: rails_7.0 } + - { ruby: 3.0.7, postgres: 16, gemfile: rails_7.0 } + + - { ruby: 3.1.6, postgres: 14, gemfile: rails_7.0 } + - { ruby: 3.1.6, postgres: 15, gemfile: rails_7.0 } + - { ruby: 3.1.6, postgres: 16, gemfile: rails_7.0 } + + - { ruby: 3.0.7, postgres: 14, gemfile: rails_7.1 } + - { ruby: 3.0.7, postgres: 15, gemfile: rails_7.1 } + - { ruby: 3.1.6, postgres: 14, gemfile: rails_7.1 } + - { ruby: 3.1.6, postgres: 15, gemfile: rails_7.1 } + - { ruby: 3.1.6, postgres: 16, gemfile: rails_7.1 } + + - { ruby: 3.1.6, postgres: 14, gemfile: rails_7.2 } + - { ruby: 3.1.6, postgres: 15, gemfile: rails_7.2 } + - { ruby: 3.2.6, postgres: 14, gemfile: rails_7.2 } + - { ruby: 3.2.6, postgres: 15, gemfile: rails_7.2 } + - { ruby: 3.2.6, postgres: 16, gemfile: rails_7.2 } env: BUNDLE_GEMFILE: gemfiles/${{ matrix.cfg.gemfile }}.gemfile From 9b69f2fe59b23a7d5cd025edda4463b80a93f83b Mon Sep 17 00:00:00 2001 From: Rafal Wojsznis Date: Tue, 12 Nov 2024 07:02:16 +0100 Subject: [PATCH 4/5] Bump actions/checkout --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68bfb02..994ed38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): From 45563f4d1d870fb887ffe8023e38ea4f2cf89b4c Mon Sep 17 00:00:00 2001 From: Rafal Wojsznis Date: Tue, 12 Nov 2024 07:06:32 +0100 Subject: [PATCH 5/5] Update changelog, bump version --- CHANGELOG.md | 8 ++++++++ conflict_free_schema.gemspec | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0acb55..0074ad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +### 0.2.0 + +- Add support for Rails 7.0, 7.1, and 7.2 ([@mkrfowler](https://github.com/mkrfowler)) + - please be aware that multi-db support was not yet ported from GitLab's original codebase; so this release simply relaxes the Rails version requirement and adds basic integration tests for Rails 7.x + +- drop old Ruby 2.x from test matrix - test on Ruby 3.0 - 3.2 +- drop old postgres version from test matrix - test on 14 - 16 + ### 0.1.2 - do a recursive search for migrations - use `db/migrate/**/*` pattern ([@Ivanov-Anton](https://github.com/Ivanov-Anton)) diff --git a/conflict_free_schema.gemspec b/conflict_free_schema.gemspec index b843db9..9e75481 100644 --- a/conflict_free_schema.gemspec +++ b/conflict_free_schema.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "conflict_free_schema" - spec.version = "0.1.2" + spec.version = "0.2.0" spec.authors = ["Rafal Wojsznis"] spec.email = ["wojsznis@pm.me"]