Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance #7

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 28 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,33 @@ 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: 14, gemfile: rails_6.0 }
- { ruby: 3.0.7, postgres: 15, gemfile: rails_6.0 }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like postgres 15+ will explodes on dump version mismatch 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pg_dump does not want to be working with a server version from the future -- the other way around is mostly fine.

You could use ubuntu-22.04 for a runs_on target which installs v16 by default (this will relatively soon be the target for ubuntu-latest — see actions/runner-images#10636)

Alternatively, manually installing an updated version of the PostgreSQL client libraries would help:

- name: Update postgres
  run: |
     sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
     sudo apt-get update && sudo apt-get install postgresql-client-16

- { 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
Expand All @@ -55,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):
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
22 changes: 0 additions & 22 deletions Dockerfile-2.6.6

This file was deleted.

22 changes: 0 additions & 22 deletions Dockerfile-3.1.0

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
2 changes: 1 addition & 1 deletion conflict_free_schema.gemspec
Original file line number Diff line number Diff line change
@@ -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"]

Expand Down
20 changes: 1 addition & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading