geordi 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/lib/geordi/db_cleaner.rb +40 -5
- data/lib/geordi/util.rb +1 -1
- data/lib/geordi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd4118d5ea35ff6c548d5ad3f158410fd2ac83edda2b181be2454f8228946825
|
4
|
+
data.tar.gz: b114780373ad8673f40eab2c65412dd334eecc6d97e6786a523fa7a3d9017958
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4523d1f1c32f42ebdd15a9d66b032bf9f220b94835c4aa71f9e3e24a2675b5c6806cec3ea80f225a03d8640002fa229e044fed72cc9e6392d56413bc01ee371b
|
7
|
+
data.tar.gz: 77c57c948d4f95880e9f55211d6ab3e7a079ac2bb0e4c4b1e0757aa291facaa224f56899ff435a3b846273dd8c5390a564235e17625cecc71735226a62d7c5c9
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,16 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## 2.1.0 2019-02-25
|
10
|
+
|
11
|
+
### Compatible changes
|
12
|
+
- Fixes [#59]: Removedb name prefix when reading whitelist
|
13
|
+
- Fixes [#62]: Provide better error messages on whitelist editing errors.
|
14
|
+
- Fixes [#63]: Allow explicit whitelisting of database names that would be considered derivative during db cleanup
|
15
|
+
- Fixes [#64]: Remove VISUAL and EDITOR from editor choices for DB whitelist editing
|
16
|
+
|
17
|
+
## 2.0.0 2019-02-20
|
18
|
+
|
9
19
|
### Breaking changes
|
10
20
|
- Pivotal Tracker discontinued API V3 and V4. We now use API V5, which has a client library that does not support Ruby
|
11
21
|
version < 2.1 anymore (all other geordi commands will still work for older Ruby versions).
|
@@ -13,7 +23,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
13
23
|
|
14
24
|
### Compatible changes
|
15
25
|
- Fixes [#54]: @solo features run first and are not skipped by accident on failures before
|
16
|
-
- Fixes [#
|
26
|
+
- Fixes [#03]: Add spring support for RSpec
|
17
27
|
- Fixes [#53]: Integrate yarn integrity
|
18
28
|
- Fixes [#52]: Remote dumps are transmitted compressed
|
19
29
|
|
data/lib/geordi/db_cleaner.rb
CHANGED
@@ -47,8 +47,31 @@ HEREDOC
|
|
47
47
|
db.sub!(@derivative_dbname, '')
|
48
48
|
tmpfile_content.push(['drop', db])
|
49
49
|
end
|
50
|
-
|
51
|
-
|
50
|
+
warn_manual_whitelist = false
|
51
|
+
whitelisted_dbs.each do |db_name|
|
52
|
+
# Remove 'keep' word from whitelist entries. This is not normally required since geordi
|
53
|
+
# does not save 'keep' or 'drop' to the whitelist file on disk but rather saves a list
|
54
|
+
# of all whitelisted db names and just presents the keep/drop information while editing
|
55
|
+
# the whitelist to supply users a list of databases they can whitelist by changing the
|
56
|
+
# prefix to 'keep'. Everything prefixed 'drop' is not considered whitelisted and thus
|
57
|
+
# not written to the whitelist file on disk.
|
58
|
+
#
|
59
|
+
# However, if users manually edit their whitelist files they might use the keep/drop
|
60
|
+
# syntax they're familiar with.
|
61
|
+
if db_name.start_with? 'keep '
|
62
|
+
db_name.gsub!(/keep /, '')
|
63
|
+
db_name = db_name.split[1..-1].join(' ')
|
64
|
+
warn_manual_whitelist = true
|
65
|
+
end
|
66
|
+
tmpfile_content.push(['keep', db_name]) unless db_name.empty?
|
67
|
+
end
|
68
|
+
if warn_manual_whitelist
|
69
|
+
warn <<-ERROR_MSG.gsub(/^\s*/, '')
|
70
|
+
Your whitelist #{whitelist} seems to have been generated manually.
|
71
|
+
In that case, make sure to use only one database name per line and omit the 'keep' prefix."
|
72
|
+
|
73
|
+
Launching the editor.
|
74
|
+
ERROR_MSG
|
52
75
|
end
|
53
76
|
tmpfile_content.sort_by! { |k| k[1] }
|
54
77
|
tmpfile_content.uniq!
|
@@ -64,8 +87,12 @@ HEREDOC
|
|
64
87
|
lines = Geordi::Util.stripped_lines(wl_edited.read)
|
65
88
|
lines.each do |line|
|
66
89
|
next if line.start_with?('#')
|
67
|
-
|
68
|
-
|
90
|
+
unless line.split.length == 2
|
91
|
+
fail "Invalid edit to whitelist file: \`#{line}\` - Syntax is: ^[keep|drop] dbname$"
|
92
|
+
end
|
93
|
+
unless %w[keep drop k d].include? line.split.first
|
94
|
+
fail "Invalid edit to whitelist file: \`#{line}\` - must start with either drop or keep."
|
95
|
+
end
|
69
96
|
db_status, db_name = line.split
|
70
97
|
if db_status == 'keep'
|
71
98
|
whitelisted_dbs.push db_name
|
@@ -223,7 +250,15 @@ HEREDOC
|
|
223
250
|
else
|
224
251
|
whitelist_content = Array.new
|
225
252
|
end
|
226
|
-
|
253
|
+
# Allow explicit whitelisting of derivative databases like projectname_test2
|
254
|
+
if whitelist_content.include? database_name
|
255
|
+
true
|
256
|
+
# whitelisting `projectname` also whitelists `projectname_test\d+`, `projectname_development`
|
257
|
+
elsif whitelist_content.include? database_name.sub(@derivative_dbname, '')
|
258
|
+
true
|
259
|
+
else
|
260
|
+
false
|
261
|
+
end
|
227
262
|
end
|
228
263
|
|
229
264
|
def filter_whitelisted(dbtype, database_list)
|
data/lib/geordi/util.rb
CHANGED
@@ -82,7 +82,7 @@ module Geordi
|
|
82
82
|
|
83
83
|
# try to guess user's favorite cli text editor
|
84
84
|
def decide_texteditor
|
85
|
-
%w[
|
85
|
+
%w[/usr/bin/editor vi].each do |texteditor|
|
86
86
|
if cmd_exists? texteditor and texteditor.start_with? '$'
|
87
87
|
return ENV[texteditor[1..-1]]
|
88
88
|
elsif cmd_exists? texteditor
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|