-
Notifications
You must be signed in to change notification settings - Fork 244
feat: rewrite with clean api #451
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
+2,265
−2,027
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c46c513
ninit
seuros ef939fd
fix tests
seuros adabb8a
rename schema
seuros 5ba986e
resume work
seuros 795a85f
fix test
seuros a545799
Remove git dependency from gemspec and fix MySQL CI configuration
seuros a43ac43
Remove Ruby 3.3 from CI test matrix
seuros 0792b8a
Fix test setup and use model's with_advisory_lock method
seuros 45240e7
Migrate to new with_advisory_lock API and add RuboCop
seuros 450ca4b
Use with_advisory_lock gem version >= 7
seuros File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copy this file to .env and update with your database connection strings | ||
|
||
# PostgreSQL primary database | ||
DATABASE_URL_PG=postgresql://closure_tree:[email protected]:5434/closure_tree_test | ||
|
||
# MySQL secondary database | ||
DATABASE_URL_MYSQL=mysql2://closure_tree:[email protected]:3367/closure_tree_test | ||
|
||
# SQLite database (optional, in-memory by default) | ||
# DATABASE_URL_SQLITE3=sqlite3:closure_tree_test.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
|
@@ -9,49 +8,49 @@ on: | |
branches: | ||
- master | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
mysql: | ||
image: mysql/mysql-server | ||
ports: | ||
- "3306:3306" | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: closure_tree_test | ||
MYSQL_ROOT_HOST: '%' | ||
postgres: | ||
image: 'postgres' | ||
ports: ['5432:5432'] | ||
image: postgres:17-alpine | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: closure_tree_test | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
|
||
mysql: | ||
image: mysql:8 | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_DATABASE: closure_tree_test | ||
MYSQL_ROOT_PASSWORD: root | ||
options: >- | ||
--health-cmd="mysqladmin ping" | ||
--health-interval=10s | ||
--health-timeout=5s | ||
--health-retries=3 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: | ||
- '3.3' | ||
- '3.4' | ||
rails: | ||
- activerecord_8.0 | ||
- activerecord_7.2 | ||
- activerecord_7.1 | ||
- activerecord_edge | ||
adapter: | ||
- 'sqlite3:///:memory:' | ||
- mysql2://root:root@0/closure_tree_test | ||
- postgres://closure_tree:closure_tree@0/closure_tree_test | ||
- '8.0' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
|
@@ -60,14 +59,25 @@ jobs: | |
bundler-cache: true | ||
rubygems: latest | ||
env: | ||
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile | ||
RAILS_VERSION: ${{ matrix.rails }} | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile | ||
|
||
- name: Setup databases | ||
env: | ||
RAILS_ENV: test | ||
DATABASE_URL_PG: postgres://postgres:[email protected]:5432/closure_tree_test | ||
DATABASE_URL_MYSQL: mysql2://root:[email protected]:3306/closure_tree_test | ||
DATABASE_URL_SQLITE3: 'sqlite3::memory:' | ||
run: | | ||
cd test/dummy | ||
bundle exec rails db:setup_all | ||
|
||
- name: Test | ||
- name: Run tests | ||
env: | ||
RAILS_ENV: test | ||
RAILS_VERSION: ${{ matrix.rails }} | ||
DB_ADAPTER: ${{ matrix.adapter }} | ||
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile | ||
DATABASE_URL_PG: postgres://postgres:[email protected]:5432/closure_tree_test | ||
DATABASE_URL_MYSQL: mysql2://root:[email protected]:3306/closure_tree_test | ||
DATABASE_URL_SQLITE3: 'sqlite3::memory:' | ||
WITH_ADVISORY_LOCK_PREFIX: ${{ github.run_id }} | ||
run: bin/rake | ||
run: | | ||
bundle exec rake test |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ pkg/ | |
rdoc/ | ||
doc/ | ||
*.sqlite3.db | ||
*.sqlite3 | ||
*.log | ||
tmp/ | ||
.DS_Store | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
|
||
{".":"8.0.0"} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider grouping test-only dependencies like
railties
and the database adapters undergroup :development, :test
to avoid loading them in production environments.Copilot uses AI. Check for mistakes.