prodder 1.7.6 → 1.7.7

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: bffad577e74259c3700295becff4baeafd8fa42038529e104e46edf6cbd59ca2
4
- data.tar.gz: 0283df1e58d3b49ea8c51bf7b715230bffbf9b51e031ae5450c5c9d83dcb6c36
3
+ metadata.gz: 837adeb9529887b429bbe128bbb9162f29d0ca5001fbd94b28aba2aa105caacb
4
+ data.tar.gz: e3b410b12794de3b1a04d55adad8ac789c83658526c4a749b8494878381c7e0a
5
5
  SHA512:
6
- metadata.gz: 0cd59679ebdf492e96a0f1858217660dca26f68b910d38df60cd9877de773a4998e90280900cc539ad4eb286ae4ce995e33aebfb3f8f8a76ee4925dc95da9203
7
- data.tar.gz: 6e144e41880ed23e55f11ab6688b5bfdcba6fdf46faa451cb096c42c38a1e8778f98e558adbfee27f40981f0b56f1b3a095b325c29af0da4656f09c39d773d0e
6
+ metadata.gz: d5982600241c08dc3c623c8c1e6153cfbd10bd6c20f3fa3074f4cf45335f6fd091c58e31e2e26da624c956b6624458ce21ce117568b933ec72aab8f2f30d295d
7
+ data.tar.gz: 697799d716ab1bd9a7fbc19b3a346681621ffd8cf3b732ee2eed41acb86b7626fb0eb16f239a307c62c797f890a1cfc9c8e2d6db367fb1542ed174ca14512aee
@@ -2,24 +2,20 @@ language: ruby
2
2
  cache: bundler
3
3
 
4
4
  rvm:
5
- - 2.4.2
6
- - 2.3.5
7
- - 2.2.8
5
+ - 2.5.8
6
+ - 2.7.2
8
7
 
9
8
  env:
10
9
  matrix:
11
- - PG_VERSION=9.3
12
- - PG_VERSION=9.4
13
- - PG_VERSION=9.5
10
+ - PG_VERSION=11
14
11
 
15
12
  before_install:
16
13
  - git config --global user.name "Prodder In Travis-CI"
17
14
  - git config --global user.email "prodder@example.com"
18
- # install postgresql v9.5
19
- - if [[ "$PG_VERSION" = "9.5" ]]; then echo "installing pg9.5"; sudo /etc/init.d/postgresql stop; sudo apt-get -y autoremove; sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 7FCC7D46ACCC4CF8; sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main 9.5" >> /etc/apt/sources.list.d/postgresql.list'; sudo apt-get update; sudo apt-get -y install postgresql-9.5; sudo cp /etc/postgresql/9.4/main/pg_hba.conf /etc/postgresql/9.5/main/pg_hba.conf; sudo sed -i 's/5433/5432/' /etc/postgresql/9.5/main/postgresql.conf; sudo /etc/init.d/postgresql restart; else echo "not installing pg9.5"; fi
20
- # setup travis user
21
- - if [[ "$PG_VERSION" = "9.5" ]]; then echo "setting up users for pg9.5"; PGUSER=postgres createuser --superuser travis || echo role travis already exists.; fi
15
+ # install postgres
16
+ - sudo apt-get install postgresql-client-$PG_VERSION postgresql-server-dev-$PG_VERSION
22
17
  # setup pg_dump
18
+ - ls -al /usr/lib/postgresql/
23
19
  - sudo ln -sfn /usr/lib/postgresql/$PG_VERSION/bin/pg_dump /usr/bin/pg_dump
24
20
  # start up the specific version of PG
25
21
  - sudo -E sh -c 'service postgresql stop'
@@ -29,7 +29,7 @@ Feature: Commiting updated dumps to a project's repository
29
29
  And I run `prodder dump -c prodder.yml`
30
30
  And I run `prodder commit -c prodder.yml`
31
31
  And 2 commits by "prodder auto-commit" should be in the "blog" repository
32
- And the latest commit should have changed "db/structure.sql" to contain "CREATE TABLE linkbacks"
32
+ And the latest commit should have changed "db/structure.sql" to contain "CREATE TABLE public.linkbacks"
33
33
  And the latest commit should not have changed "db/seeds.sql"
34
34
  And the latest commit should not have changed "db/quality_checks.sql"
35
35
 
@@ -52,7 +52,7 @@ Feature: Commiting updated dumps to a project's repository
52
52
  And I run `prodder dump -c prodder.yml`
53
53
  And I run `prodder commit -c prodder.yml`
54
54
  Then 2 commits by "prodder auto-commit" should be in the "blog" repository
55
- And the latest commit should have changed "db/structure.sql" to contain "CREATE TABLE captchas"
55
+ And the latest commit should have changed "db/structure.sql" to contain "CREATE TABLE public.captchas"
56
56
  And the latest commit should have changed "db/seeds.sql" to contain "Bob McBobbington"
57
57
  And the latest commit should not have changed "db/quality_checks.sql"
58
58
 
@@ -64,6 +64,6 @@ Feature: Commiting updated dumps to a project's repository
64
64
  And I run `prodder dump -c prodder.yml`
65
65
  And I run `prodder commit -c prodder.yml`
66
66
  And 2 commits by "prodder auto-commit" should be in the "blog" repository
67
- And the latest commit should have changed "db/permissions.sql" to contain "GRANT ALL ON TABLE gotchas TO prodder"
67
+ And the latest commit should have changed "db/permissions.sql" to contain "GRANT ALL ON TABLE public.gotchas TO prodder"
68
68
  And the latest commit should not have changed "db/seeds.sql"
69
69
  And the latest commit should not have changed "db/quality_checks.sql"
@@ -6,11 +6,10 @@ Feature: prodder dump
6
6
  Scenario: Happy path: dump structure.sql, listed seed tables, quality_checks.sql, permissions.sql and settings.sql
7
7
  When I run `prodder dump -c prodder.yml`
8
8
  Then the exit status should be 0
9
- And the workspace file "blog/db/structure.sql" should match /CREATE TABLE posts/
10
- And the workspace file "blog/db/structure.sql" should match /CREATE TABLE authors/
11
- And the workspace file "blog/db/seeds.sql" should match /COPY posts/
12
- And the workspace file "blog/db/seeds.sql" should match /COPY authors/
13
- And the workspace file "blog/db/quality_checks.sql" should match /SET search_path/
9
+ And the workspace file "blog/db/structure.sql" should match /CREATE TABLE public.posts/
10
+ And the workspace file "blog/db/structure.sql" should match /CREATE TABLE public.authors/
11
+ And the workspace file "blog/db/seeds.sql" should match /COPY public.posts/
12
+ And the workspace file "blog/db/seeds.sql" should match /COPY public.authors/
14
13
  And the workspace file "blog/db/quality_checks.sql" should match /CREATE TRIGGER /
15
14
  And the workspace file "blog/db/permissions.sql" should match /GRANT /
16
15
  And the workspace file "blog/db/settings.sql" should match /ALTER DATABASE /
@@ -123,6 +122,7 @@ Feature: prodder dump
123
122
  Given I add a custom parameter "c.p" with value "v" in the "blog" project's database
124
123
  When I run `prodder dump -c prodder.yml`
125
124
  Then the workspace file "blog/db/settings.sql" should match /ALTER DATABASE :DBNAME SET c.p=v;/
125
+ And the workspace file "blog/db/settings.sql" should match /ALTER DATABASE :DBNAME SET search_path=foo,bar,public;/
126
126
 
127
127
  Scenario: Verify empty db setting is quoted
128
128
  Given I add a custom parameter "empty.setting" with value "" in the "blog" project's database
@@ -184,8 +184,8 @@ Feature: prodder dump
184
184
  """
185
185
  When I run `prodder dump -c prodder.yml`
186
186
  Then the exit status should be 0
187
- And the workspace file "blog/db/seeds.sql" should match /COPY posts/
188
- But the workspace file "blog/db/seeds.sql" should not match /COPY authors/
187
+ And the workspace file "blog/db/seeds.sql" should match /COPY public.posts/
188
+ But the workspace file "blog/db/seeds.sql" should not match /COPY public.authors/
189
189
 
190
190
  Scenario: YAML file listing seed tables does not exist
191
191
  Given the prodder config in "prodder.yml" says to read the "blog" seed tables from "db/seeds.yml"
@@ -1,4 +1,5 @@
1
1
  ALTER DATABASE prodder__blog_prod SET custom.parameter = 1;
2
+ ALTER DATABASE prodder__blog_prod SET search_path TO foo, bar, public;
2
3
 
3
4
  CREATE TABLE authors (
4
5
  author_id serial primary key,
@@ -125,7 +125,6 @@ module Prodder
125
125
  ACL_REVOKE = /^REVOKE /
126
126
  DEFAULT_PRIVILEGES = /^ALTER DEFAULT PRIVILEGES /
127
127
  SET_OBJECT_OWNERSHIP = /.* OWNER TO /
128
- SEARCH_PATH = /SET search_path = .*/
129
128
 
130
129
  def dump_db_access_control(db_name, user_list, options)
131
130
  perm_out_sql = ""
@@ -153,8 +152,7 @@ module Prodder
153
152
  if line.match(ACL_GRANT) ||
154
153
  line.match(ACL_REVOKE) ||
155
154
  line.match(DEFAULT_PRIVILEGES) ||
156
- line.match(SET_OBJECT_OWNERSHIP)||
157
- line.match(SEARCH_PATH)
155
+ line.match(SET_OBJECT_OWNERSHIP)
158
156
 
159
157
  unless irrelevant_login_roles.include?(line.match(/ (\S*);$/)[1])
160
158
  perm_out_sql << line
@@ -362,7 +362,8 @@ namespace :db do
362
362
 
363
363
  def as(user, opts = {}, &block)
364
364
  if File.exist?('db/permissions.sql')
365
- config, config_was = ActiveRecord::Base.configurations.deep_dup, ActiveRecord::Base.configurations.deep_dup
365
+ # `ActiveRecord::Base.configurations` in Rails 6 now returns an object instead of a hash
366
+ config, config_was = ActiveRecord::Base.configurations.deep_dup.to_h, ActiveRecord::Base.configurations.deep_dup
366
367
  in_env = Array(opts[:in]) || config.keys
367
368
  if config.all? { |env, config_hash| in_env.include?(env) ? config_hash[user] : true }
368
369
  disconnect
@@ -45,11 +45,8 @@ module Prodder
45
45
  contents = File.readlines(structure_file_name)
46
46
  rgx = /^\-\- .* Type: INDEX; |^\-\- .* Type: TRIGGER; |^\-\- .* Type: FK CONSTRAINT; /
47
47
  structure, *quality = contents.slice_before(rgx).to_a
48
- # the first search path setting for constraints gets left over
49
- # in the structure, so we need to *attempt* to grab that
50
- quality_checks = (structure.grep(/SET search_path/).last || '') + quality.join
51
48
 
52
- File.open(quality_check_file_name, 'w') { |f| f.write(quality_checks) }
49
+ File.open(quality_check_file_name, 'w') { |f| f.write(quality.join) }
53
50
  File.open(structure_file_name, 'w') { |f| f.write(structure.join) }
54
51
  end
55
52
 
@@ -1,3 +1,3 @@
1
1
  module Prodder
2
- VERSION = "1.7.6"
2
+ VERSION = "1.7.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prodder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.6
4
+ version: 1.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Hargraves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-06 00:00:00.000000000 Z
11
+ date: 2020-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deject
@@ -81,8 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubyforge_project:
85
- rubygems_version: 2.7.7
84
+ rubygems_version: 3.0.8
86
85
  signing_key:
87
86
  specification_version: 4
88
87
  summary: Maintain your Rails apps' structure, seed and quality_checks files using