active_record_proxy_adapters 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f1bd3461586c7443e358fe82092039c05dd7cba760b4e4b7660ce6ecbd928e4
4
- data.tar.gz: a8b40dce128c9449744ef8725bc6baa446ba8f4119e64c068a3d553e74b6fd1e
3
+ metadata.gz: 265cb32e99a265497548122846934c46405747109fa3bee34d1e2e66203b14a3
4
+ data.tar.gz: d9de3faf7274a0a94166637032c0a967e083edf55fc275b2456123d3f9a7ee79
5
5
  SHA512:
6
- metadata.gz: 4a50dc55929c1d7c57f5278788d23240314660eba4ceb17335ac079740265b77042a35900ab64482073fabf79cc0612a7a38de9521f0cf5676a30b6545c5811a
7
- data.tar.gz: 35ec9da8d5d1f4703129e66fa79f2f872bf5e36e053b38ea5abb25383e11980bbb19febee7c579d4e7b9905971b99e58be15d748ca13bafa064470bd873cc138
6
+ metadata.gz: 871504b4290e8304effa5e30962a8db9fdab6663c73b4f9d9e99edf403af630755ddaaafa557619a86430812b7e54e19931274ec71dd4f86a7b4dc32b73fc669
7
+ data.tar.gz: f7605b374452517ae3346d896d043e092539abd0a86445eb1a04defbd7516628a70bcd5157fca10c730b7ee6fe047733d1e8e4d65a016c49651cbb12f7e8dcee
data/.rubocop.yml CHANGED
@@ -14,7 +14,3 @@ Style/StringLiteralsInInterpolation:
14
14
  RSpec/NestedGroups:
15
15
  Enabled: true
16
16
  Max: 5
17
-
18
- # TODO: Enable MFA once we open source the gem
19
- Gemspec/RequireMFA:
20
- Enabled: false
data/README.md CHANGED
@@ -4,15 +4,13 @@ A set of ActiveRecord adapters that leverage Rails native multiple database setu
4
4
 
5
5
  ## Installation
6
6
 
7
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
8
-
9
7
  Install the gem and add to the application's Gemfile by executing:
10
8
 
11
- $ bundle add 'UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG'
9
+ $ bundle add 'active_record_proxy_adapters'
12
10
 
13
11
  If bundler is not being used to manage dependencies, install the gem by executing:
14
12
 
15
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
13
+ $ gem install active_record_proxy_adapters
16
14
 
17
15
  ## Usage
18
16
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordProxyAdapters
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_proxy_adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Cruz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-27 00:00:00.000000000 Z
11
+ date: 2024-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -68,12 +68,6 @@ files:
68
68
  - LICENSE.txt
69
69
  - README.md
70
70
  - Rakefile
71
- - ci/stages/build.yml
72
- - ci/stages/env_vars.yml
73
- - ci/stages/lint.yml
74
- - ci/stages/prebuild.yml
75
- - ci/stages/push.yml
76
- - ci/stages/test.yml
77
71
  - docker-compose.yml
78
72
  - lib/active_record/connection_adapters/postgresql_proxy_adapter.rb
79
73
  - lib/active_record/tasks/postgresql_proxy_database_tasks.rb
@@ -93,10 +87,11 @@ homepage: https://github.com/Nasdaq/active_record_proxy_adapters
93
87
  licenses:
94
88
  - MIT
95
89
  metadata:
96
- allowed_push_host: https://rubygems.org
90
+ allowed_push_host: https://rubygems.org/
97
91
  homepage_uri: https://github.com/Nasdaq/active_record_proxy_adapters
98
92
  source_code_uri: https://github.com/Nasdaq/active_record_proxy_adapters
99
- changelog_uri: https://github.com/Nasdaq/active_record_proxy_adapters/-/blob/main/CHANGELOG.md
93
+ changelog_uri: https://github.com/Nasdaq/active_record_proxy_adapters/blob/main/CHANGELOG.md
94
+ rubygems_mfa_required: 'true'
100
95
  post_install_message:
101
96
  rdoc_options: []
102
97
  require_paths:
data/ci/stages/build.yml DELETED
@@ -1,91 +0,0 @@
1
- .build_app_base:
2
- extends: .build_base
3
- stage: build
4
- variables:
5
- DOCKERFILE: Dockerfile
6
- DOCKER_REGISTRY: registry.git.nasdaq.com/smp/common
7
- rules:
8
- - changes:
9
- - Dockerfile
10
- - Gemfile
11
- - active_record_proxy_adapters.gemspec
12
- - ci/stages/build.yml
13
- retry: 2
14
- script:
15
- - echo "CI_JOB_NAME=${CI_JOB_NAME}"
16
- - SUFFIX="-rails${RAILS_VERSION}-ruby${RUBY_VERSION}"
17
- - SUFFIX=$(echo $SUFFIX | tr -d '~> ' | tr -d '>=' | tr -d '<=' | tr -d '>' | tr -d '<' | tr -d ' ' )
18
- - APP_IMAGE=${ENV_IMAGE_PREFIX}${SUFFIX}
19
- - echo "APP_IMAGE=${APP_IMAGE}"
20
- - echo "RAILS_VERSION=${RAILS_VERSION}"
21
- - echo "RUBY_VERSION=${RUBY_VERSION}"
22
- - buildah_build -t $APP_IMAGE --build-arg DOCKER_REGISTRY="${DOCKER_REGISTRY}" --build-arg RUBY_VERSION="${RUBY_VERSION}" --build-arg RAILS_VERSION="${RAILS_VERSION}" -f $DOCKERFILE .
23
- - buildah push $APP_IMAGE
24
-
25
- env-rails-7.0.x 316 / 3:
26
- extends: .build_app_base
27
- variables:
28
- RAILS_VERSION: '~> 7.0.0'
29
- RUBY_VERSION: '3.1.6'
30
-
31
- env-rails-7.0.x 325 / 3:
32
- extends: .build_app_base
33
- variables:
34
- RAILS_VERSION: '~> 7.0.0'
35
- RUBY_VERSION: '3.2.5'
36
-
37
- env-rails-7.0.x 335 / 3:
38
- extends: .build_app_base
39
- variables:
40
- RAILS_VERSION: '~> 7.0.0'
41
- RUBY_VERSION: '3.3.5'
42
-
43
- env-rails-7.1.x 316 / 3:
44
- extends: .build_app_base
45
- variables:
46
- RAILS_VERSION: '~> 7.1.0'
47
- RUBY_VERSION: '3.1.6'
48
-
49
- env-rails-7.1.x 325 / 3:
50
- extends: .build_app_base
51
- variables:
52
- RAILS_VERSION: '~> 7.1.0'
53
- RUBY_VERSION: '3.2.5'
54
-
55
- env-rails-7.1.x 335 / 3:
56
- extends: .build_app_base
57
- variables:
58
- RUBY_VERSION: '3.3.5'
59
- RAILS_VERSION: '~> 7.1.0'
60
-
61
- env-rails-7.2.x 316 / 3:
62
- extends: .build_app_base
63
- variables:
64
- RAILS_VERSION: '~> 7.2.0'
65
- RUBY_VERSION: '3.1.6'
66
-
67
- env-rails-7.2.x 325 / 3:
68
- extends: .build_app_base
69
- variables:
70
- RAILS_VERSION: '~> 7.2.0'
71
- RUBY_VERSION: '3.2.5'
72
-
73
- env-rails-7.2.x 335 / 3:
74
- extends: .build_app_base
75
- variables:
76
- RAILS_VERSION: '~> 7.2.0'
77
- RUBY_VERSION: '3.3.5'
78
-
79
- # Rails 8.0.x does not support Ruby 3.1.6
80
-
81
- env-rails-8.0.x 325 / 3:
82
- extends: .build_app_base
83
- variables:
84
- RAILS_VERSION: '~> 8.0.0'
85
- RUBY_VERSION: '3.2.5'
86
-
87
- env-rails-8.0.x 335 / 3:
88
- extends: .build_app_base
89
- variables:
90
- RAILS_VERSION: '~> 8.0.0'
91
- RUBY_VERSION: '3.3.5'
@@ -1,18 +0,0 @@
1
- export:
2
- stage: env_vars
3
- image: registry.git.nasdaq.com/gitlab/ci/buildah/stable:v1.30.0
4
- artifacts:
5
- reports:
6
- dotenv: build.env
7
- script:
8
- - !reference [.checksums, functions]
9
- - POSTGRES_PRIMARY_TAG=$(checksum postgres_primary.dockerfile)
10
- - POSTGRES_REPLICA_TAG=$(checksum postgres_replica.dockerfile)
11
- - DOCKERFILE_CHECKSUM=$(checksum Dockerfile)
12
- - GEMFILE_CHECKSUM=$(checksum Gemfile)
13
- - GEMSPEC_CHECKSUM=$(checksum active_record_proxy_adapters.gemspec)
14
- - TAG_PREFIX=$(checksum_join $DOCKERFILE_CHECKSUM $GEMFILE_CHECKSUM $GEMSPEC_CHECKSUM)
15
- - ENV_IMAGE_PREFIX=${CI_REGISTRY_IMAGE}/env:${TAG_PREFIX}
16
- - echo "POSTGRES_PRIMARY_IMAGE=${CI_REGISTRY_IMAGE}/postgres_primary:${POSTGRES_PRIMARY_TAG}" >> build.env
17
- - echo "POSTGRES_REPLICA_IMAGE=${CI_REGISTRY_IMAGE}/postgres_replica:${POSTGRES_REPLICA_TAG}" >> build.env
18
- - echo "ENV_IMAGE_PREFIX=${ENV_IMAGE_PREFIX}" >> build.env
data/ci/stages/lint.yml DELETED
@@ -1,12 +0,0 @@
1
- .lint_base:
2
- stage: lint
3
- image: ${ENV_IMAGE_PREFIX}-rails7.0.0-ruby3.1.6
4
- needs:
5
- - export
6
- - job: env-rails-7.0.x 316 / 3
7
- optional: true
8
-
9
- rubocop:
10
- extends: .lint_base
11
- script:
12
- - rubocop
@@ -1,28 +0,0 @@
1
-
2
-
3
- postgres_primary:
4
- extends: .build_base
5
- stage: prebuild
6
- variables:
7
- DOCKERFILE: postgres_primary.dockerfile
8
- REPLICA_USER: replicator
9
- REPLICA_PASSWORD: replicator
10
- script:
11
- - echo "POSTGRES_PRIMARY_IMAGE=${POSTGRES_PRIMARY_IMAGE}"
12
- - echo "DOCKERFILE=${DOCKERFILE}"
13
- - buildah_build -t $POSTGRES_PRIMARY_IMAGE --build-arg REPLICA_USER=${REPLICA_USER} --build-arg REPLICA_PASSWORD=${REPLICA_PASSWORD} -f $DOCKERFILE .
14
- - buildah push $POSTGRES_PRIMARY_IMAGE
15
- rules:
16
- - changes:
17
- - postgres_primary.dockerfile
18
- postgres_replica:
19
- extends: .build_base
20
- stage: prebuild
21
- variables:
22
- DOCKERFILE: postgres_replica.dockerfile
23
- script:
24
- - buildah_build -t $POSTGRES_REPLICA_IMAGE -f $DOCKERFILE .
25
- - buildah push $POSTGRES_REPLICA_IMAGE
26
- rules:
27
- - changes:
28
- - postgres_replica.dockerfile
data/ci/stages/push.yml DELETED
@@ -1,23 +0,0 @@
1
- push_to_rubygems:
2
- stage: push
3
- image: ruby:alpine
4
- rules:
5
- - if: $CI_PIPELINE_SOURCE == "merge_request_event"
6
- when: manual
7
- allow_failure: true
8
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
9
- when: never
10
- - if: $CI_COMMIT_TAG
11
- when: always
12
- script: |
13
- apk add git curl
14
- GEM_VERSION="${CI_COMMIT_TAG:-$(grep VERSION lib/active_record_proxy_adapters/version.rb | tr -d 'VERSION=' | tr -d ' ' | tr -d '"')}"
15
- mkdir ~/.gem
16
- echo "---" > ~/.gem/credentials
17
- echo "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/rubygems: '${CI_JOB_TOKEN}'" >> ~/.gem/credentials
18
- chmod 0600 ~/.gem/credentials
19
- echo "------------------"
20
- echo "building gem"
21
- gem build active_record_proxy_adapters.gemspec
22
- echo "Uploading to rubygems"
23
- curl --verbose --fail --user "$NEXUS_USER_ID:$NEXUS_PASSWORD" --upload-file "${CI_PROJECT_DIR}/active_record_proxy_adapters-${GEM_VERSION}.gem" "https://pro.nexus.aws.nasdaq.com/repository/smp-second-market-gems/active_record_proxy_adapters/"
data/ci/stages/test.yml DELETED
@@ -1,133 +0,0 @@
1
- .test_base:
2
- stage: test
3
- needs:
4
- - export
5
- - job: postgres_primary
6
- optional: true
7
- - job: postgres_replica
8
- optional: true
9
- services:
10
- - name: $POSTGRES_PRIMARY_IMAGE
11
- alias: postgres-primary
12
- variables:
13
- POSTGRES_DB: postgres_primary_test
14
- POSTGRES_USER: postgres_primary_test
15
- POSTGRES_PASSWORD: postgres_primary_test
16
- POSTGRES_HOST_AUTH_METHOD: "scram-sha-256\nhost replication all 0.0.0.0/0 md5"
17
- POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256"
18
- - name: $POSTGRES_REPLICA_IMAGE
19
- alias: postgres-replica
20
- variables:
21
- PGUSER: replicator
22
- PGPASSWORD: replicator
23
- PGPORT: 5433
24
- PRIMARY_DATABASE_HOST: postgres-primary
25
- variables:
26
- PGHOST: postgres-primary
27
- PG_PRIMARY_USER: postgres_primary_test
28
- PG_PRIMARY_PASSWORD: postgres_primary_test
29
- PG_PRIMARY_HOST: postgres-primary
30
- PG_PRIMARY_PORT: 5432
31
- PG_REPLICA_USER: postgres_primary_test
32
- PG_REPLICA_PASSWORD: postgres_primary_test
33
- PG_REPLICA_HOST: postgres-replica
34
- PG_REPLICA_PORT: 5433
35
-
36
-
37
- .rspec:
38
- extends: .test_base
39
- retry: 2
40
- script:
41
- - echo "Ruby version => $(ruby -v)"
42
- - echo "ActiveRecord Version => $(gem list | grep activerecord)"
43
- - rspec --format progress
44
-
45
- rspec-rails-7.0.x 316 / 3:
46
- extends: .rspec
47
- needs:
48
- - !reference [.test_base, needs]
49
- - job: env-rails-7.0.x 316 / 3
50
- optional: true
51
- image: ${ENV_IMAGE_PREFIX}-rails7.0.0-ruby3.1.6
52
-
53
- rspec-rails-7.0.x 325 / 3:
54
- extends: .rspec
55
- needs:
56
- - !reference [.test_base, needs]
57
- - job: env-rails-7.0.x 325 / 3
58
- optional: true
59
- image: ${ENV_IMAGE_PREFIX}-rails7.0.0-ruby3.2.5
60
-
61
- rspec-rails-7.0.x 335 / 3:
62
- extends: .rspec
63
- needs:
64
- - !reference [.test_base, needs]
65
- - job: env-rails-7.0.x 335 / 3
66
- optional: true
67
- image: ${ENV_IMAGE_PREFIX}-rails7.0.0-ruby3.3.5
68
-
69
- rspec-rails-7.1.x 316 / 3:
70
- extends: .rspec
71
- needs:
72
- - !reference [.test_base, needs]
73
- - job: env-rails-7.1.x 316 / 3
74
- optional: true
75
- image: ${ENV_IMAGE_PREFIX}-rails7.1.0-ruby3.1.6
76
-
77
- rspec-rails-7.1.x 325 / 3:
78
- extends: .rspec
79
- needs:
80
- - !reference [.test_base, needs]
81
- - job: env-rails-7.1.x 325 / 3
82
- optional: true
83
- image: ${ENV_IMAGE_PREFIX}-rails7.1.0-ruby3.2.5
84
-
85
- rspec-rails-7.1.x 335 / 3:
86
- extends: .rspec
87
- needs:
88
- - !reference [.test_base, needs]
89
- - job: env-rails-7.1.x 335 / 3
90
- optional: true
91
- image: ${ENV_IMAGE_PREFIX}-rails7.1.0-ruby3.3.5
92
-
93
- rspec-rails-7.2.x 316 / 3:
94
- extends: .rspec
95
- needs:
96
- - !reference [.test_base, needs]
97
- - job: env-rails-7.2.x 316 / 3
98
- optional: true
99
- image: ${ENV_IMAGE_PREFIX}-rails7.2.0-ruby3.1.6
100
-
101
- rspec-rails-7.2.x 325 / 3:
102
- extends: .rspec
103
- needs:
104
- - !reference [.test_base, needs]
105
- - job: env-rails-7.2.x 325 / 3
106
- optional: true
107
- image: ${ENV_IMAGE_PREFIX}-rails7.2.0-ruby3.2.5
108
-
109
- rspec-rails-7.2.x 335 / 3:
110
- extends: .rspec
111
- needs:
112
- - !reference [.test_base, needs]
113
- - job: env-rails-7.2.x 335 / 3
114
- optional: true
115
- image: ${ENV_IMAGE_PREFIX}-rails7.2.0-ruby3.3.5
116
-
117
- # Rails 8.0.x does not support Ruby 3.1.6
118
-
119
- rspec-rails-8.0.x 325 / 3:
120
- extends: .rspec
121
- needs:
122
- - !reference [.test_base, needs]
123
- - job: env-rails-8.0.x 325 / 3
124
- optional: true
125
- image: ${ENV_IMAGE_PREFIX}-rails8.0.0-ruby3.2.5
126
-
127
- rspec-rails-8.0.x 335 / 3:
128
- extends: .rspec
129
- needs:
130
- - !reference [.test_base, needs]
131
- - job: env-rails-8.0.x 335 / 3
132
- optional: true
133
- image: ${ENV_IMAGE_PREFIX}-rails8.0.0-ruby3.3.5