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

Implement v1 #32

Merged
merged 82 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
ec774fe
Implement integration_test
mirakui Aug 30, 2024
6bffb19
Move dev dependencies into Gemfile
mirakui Sep 1, 2024
aad513e
Bump AR to 7.1
mirakui Sep 1, 2024
4cfa0be
Refine gemspec
mirakui Sep 1, 2024
2fedcb1
Introduce rubocop
mirakui Sep 1, 2024
65424e6
Add rubocop rake task
mirakui Sep 1, 2024
50def5f
Change gemfiles to AR 7.1+
mirakui Sep 1, 2024
6ea73a0
AR7.1: call raw_execute() instead of execute()
mirakui Sep 8, 2024
6534098
don't pass kwargs to proxies
mirakui Sep 8, 2024
46cd60b
Patch classes
mirakui Sep 8, 2024
e991c32
Implement PostgresqlPatch
mirakui Sep 8, 2024
fbbe06c
Add sqlserver implementation
mirakui Sep 9, 2024
3a0d55c
Add missing log
mirakui Sep 9, 2024
3c22c34
ARPROXY_DB_PASSWORD
mirakui Sep 9, 2024
5b46049
Implement sqlserver_patch
mirakui Sep 9, 2024
3497eda
AR7.2: register sqlserver
mirakui Sep 9, 2024
86362c4
clear config on disable!
mirakui Sep 9, 2024
971e9d7
Test MSSQL
mirakui Sep 9, 2024
8c8de55
install freetds-common
mirakui Sep 9, 2024
f8fac78
Add build deps for sqlserver
mirakui Sep 9, 2024
71cb9b3
fix comment
mirakui Sep 9, 2024
01018f6
Add sqlite3
mirakui Sep 9, 2024
0ac49c7
Implement trilogy patch and downgrade mysql to 8.0
mirakui Sep 9, 2024
5dc155e
Refactor patches
mirakui Sep 9, 2024
b73597b
Refactor #enable_patch
mirakui Sep 9, 2024
ab0dec7
Support AR 6.1 and 7.0
mirakui Sep 10, 2024
12f5b2a
Use #execute for AR6
mirakui Sep 10, 2024
079c298
Refactor ConnectionAdapterPatch
mirakui Sep 10, 2024
bf65480
Fix broken sqlite3
mirakui Sep 10, 2024
8375c64
Add AR version into spec contexts
mirakui Sep 10, 2024
5c36ea4
shared_examples
mirakui Sep 10, 2024
da0c1bb
Refactor patches and implement postgres specific patches
mirakui Sep 10, 2024
439404a
Specify sqlite3 version for AR7.0
mirakui Sep 10, 2024
5cd183a
Add some gems to suppress warnings
mirakui Sep 10, 2024
6635cea
Remove continu-on-error
mirakui Sep 10, 2024
5b58f3c
Split shared examples into files
mirakui Sep 10, 2024
183329e
remove version (obsolete)
mirakui Sep 10, 2024
56af730
Add integration test for plugin
mirakui Sep 10, 2024
5bdd784
Refactor spec directories
mirakui Sep 14, 2024
071e59f
Fix for unit tests
mirakui Sep 14, 2024
33e3cc7
Bump version to v1.0.0
mirakui Sep 14, 2024
6197140
Add missing Trilogy
mirakui Sep 14, 2024
b8ef2c3
Fix bugs in clear configuration
mirakui Sep 14, 2024
50f1046
Fix github actions
mirakui Sep 14, 2024
02b8d40
Update gemfiles
mirakui Sep 14, 2024
a438405
Update appraisals
mirakui Sep 14, 2024
34fa32c
Bump actions/checkout version
mirakui Sep 14, 2024
81b7c2f
Ignore vendor/ directory in rubocop
mirakui Sep 14, 2024
b63cd2f
bundle install
mirakui Sep 14, 2024
a286c29
Add support for Ruby 2.7+
mirakui Sep 16, 2024
b290279
Update README
mirakui Sep 16, 2024
ba10fe1
`#execute` returns nil when proxy_chain returns nil
mirakui Sep 16, 2024
9dc753c
Add supported environments
mirakui Sep 16, 2024
210f8b9
rubocop: Layout/EmptyLinesAroundAccessModifier: around
mirakui Oct 13, 2024
5242ac1
Un-commented a test case
mirakui Oct 13, 2024
bb17093
mv docker-compose.yml compose.yaml
mirakui Oct 20, 2024
ac57386
Remove v1 branch from GH workflows
mirakui Oct 20, 2024
cc8898a
Bump postgres version to 17
mirakui Oct 20, 2024
06cdebe
Fix typo
mirakui Oct 20, 2024
5582caa
Specify db versions in README
mirakui Oct 20, 2024
fbf518b
Use `!` methods to raise errors
mirakui Oct 20, 2024
e017242
Set timeout for integration_tests
mirakui Oct 20, 2024
74de4a4
Remove redundant calling `Arproxy.clear_configuration`
mirakui Oct 20, 2024
aff8056
Bump mysql version from 8.0 to 9.0
mirakui Oct 20, 2024
0532c9c
Add Dockerfile for CI
mirakui Oct 20, 2024
4c19c12
Remove require-secure-transport for mysql2
mirakui Oct 20, 2024
08941a3
Add sleep for debugging
mirakui Oct 20, 2024
add26f4
Implement wait_for_db
mirakui Oct 20, 2024
7598486
Update heading levels
mirakui Nov 10, 2024
c08dc72
Wrote upgrading guide from v0.1 to v1
mirakui Nov 10, 2024
c06fab0
SQLite
mirakui Nov 10, 2024
013695f
Remove blank line
mirakui Nov 19, 2024
888b254
Add ActiveRecord 8.0
mirakui Nov 19, 2024
a52730a
Drop support ruby 2.7
mirakui Nov 19, 2024
9258855
Refactor spec directories: move unit tests into spec/unit
mirakui Nov 19, 2024
4f5fc7c
Fix CI
mirakui Nov 19, 2024
8553fbb
Add RUBY_VERSION
mirakui Nov 23, 2024
c72975d
Update badges
mirakui Nov 23, 2024
59e66af
--no-install-recommends
mirakui Nov 23, 2024
6001eaf
Support AR 8.1
mirakui Nov 23, 2024
b385978
Add ar-8.0 into CI
mirakui Nov 23, 2024
b9758de
cancel-in-progress: true
mirakui Nov 23, 2024
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
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ARPROXY_DB_USER="arproxy"
ARPROXY_DB_PASSWORD="4rpr0*y#2024"
ARPROXY_DB_DATABASE="arproxy_test"
47 changes: 47 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Integration tests

on:
push:
branches:
- main
- v1
pull_request:
branches:
- main
- v1
mirakui marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

@nekketsuuu nekketsuuu Oct 13, 2024

Choose a reason for hiding this comment

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

IMHO: For pull_request events, I'd like to enable concurrency.cancel-in-progress option to reduce the whole running time of the workflow. https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs

So, how about separating the test steps to a composite action, and splitting the workflow into separate ones for the main branch and for pull requests? https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-composite-action

Alternatively, you can use a trick with group names, which is described at https://stackoverflow.com/q/74117321/5989200.


env:
RUBY_VERSION: 3.3

jobs:
integration_test:
mirakui marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
MYSQL_HOST: 127.0.0.1
POSTGRES_HOST: 127.0.0.1
MSSQL_HOST: 127.0.0.1
strategy:
matrix:
gemfile:
- ar_6.1
- ar_7.0
- ar_7.1
- ar_7.2
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y build-essential freetds-dev
mirakui marked this conversation as resolved.
Show resolved Hide resolved
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: Start DB
run: docker compose up -d
- name: Install gems
run: bundle install
mirakui marked this conversation as resolved.
Show resolved Hide resolved
- name: Run integration test
run: bundle exec rspec spec/integration/*_spec.rb
28 changes: 28 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: RuboCop

on:
push:
branches:
- main
- v1
pull_request:
branches:
- main
- v1

jobs:
rubocop:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: How about promoting this to an environment variable?

Copy link
Collaborator Author

@mirakui mirakui Nov 19, 2024

Choose a reason for hiding this comment

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

You mean to define a repository environment variable like RUBOCOP_RUBY_VERSION?
I think it's easier for others to understand if you write the version directly here, so I prefer this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then why did you set RUBY_VERSION: 3.3 in integration_tests.yml? I don't have a preference for a specific method, but I would like to maintain consistency across workflow files, IMO. As unit_test.yml uses a matrix for Ruby versions, I recommended to use RUBY_VERSION environment variable here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Then why did you set RUBY_VERSION: 3.3 in integration_tests.yml?

I think you're seeing an old version of integration_tests.yml. The current one doesn't have RUBY_VERSION: https://github.com/cookpad/arproxy/blob/4f5fc7c3efef5ddbaf7b0dd14a951315d8295e90/.github/workflows/integration_tests.yml

Anyway, since I don't have a strong opinion about this, I added RUBY_VERSION to rubocop.yml: 8553fbb

bundler-cache: true

- name: Run RuboCop
run: bundle exec rubocop
38 changes: 0 additions & 38 deletions .github/workflows/ruby.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Unit tests

on:
push:
branches:
- main
- v1
pull_request:
branches:
- main
- v1

jobs:
test:

mirakui marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version:
- 2.7
mirakui marked this conversation as resolved.
Show resolved Hide resolved
- 3.0
- 3.1
- 3.2
- 3.3

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run unit tests on ruby-${{ matrix.ruby-version }}
run: bundle exec rspec spec/*_spec.rb
mirakui marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.swp
*.gem
Gemfile.lock
gemfiles/*.lock
*.gemfile.lock
.bundle/
tmp/
Loading