pii_safe_schema 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/workflows/default.yml +5 -8
- data/.github/workflows/stale.yml +20 -0
- data/.gitignore +2 -0
- data/CHANGELOG.md +9 -0
- data/lib/pii_safe_schema/migration_generator.rb +5 -7
- data/lib/pii_safe_schema/version.rb +1 -1
- data/pii_safe_schema.gemspec +9 -9
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 433073ad99b049c37e16a022442070d149fbe0c9c3a7583f1889e2c61d862de5
|
4
|
+
data.tar.gz: 6fa3b54cf2af939e1cf26e807a99023a9b1d77cb81994293bc065e95f666bfe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbaf01bfb0222feabe9eaec16c4d12b7a208311659960a4f321bd03e8871534b1202e4ccd803805de0132ea06970e64103ab1d930556c5e83f217b8f33153256
|
7
|
+
data.tar.gz: c440c21ecc60a6a2d32bdfda90ba54ae00252c69013af129e75b89405d72e649500e7101cbe2130848244cd031a4929f981007d598ae36608149b36f8029bf82
|
data/.github/CODEOWNERS
CHANGED
@@ -6,8 +6,6 @@ name: Default
|
|
6
6
|
# pushes to the branch will provide PR information of any open PRs.
|
7
7
|
on:
|
8
8
|
push:
|
9
|
-
pull_request:
|
10
|
-
types: [opened, reopened]
|
11
9
|
|
12
10
|
concurrency:
|
13
11
|
group: default-${{ github.ref }}
|
@@ -33,14 +31,13 @@ jobs:
|
|
33
31
|
ruby-version: ${{ matrix.ruby-version }}
|
34
32
|
|
35
33
|
- name: Lint
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
run: |
|
35
|
+
bundle exec rubocop
|
36
|
+
bundle exec bundle-audit update
|
37
|
+
bundle exec bundle-audit check
|
39
38
|
|
40
39
|
- name: Test
|
41
|
-
|
42
|
-
with:
|
43
|
-
script: toolbox.ruby.test.run();
|
40
|
+
run: bundle exec rspec
|
44
41
|
|
45
42
|
publish:
|
46
43
|
name: Publish package
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: 'Close stale PRs'
|
2
|
+
on:
|
3
|
+
schedule:
|
4
|
+
- cron: '30 6 * * *' # 6:30 am UTC: 1:30 am EST
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
stale:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/stale@v4
|
11
|
+
with:
|
12
|
+
days-before-stale: 30
|
13
|
+
days-before-close: 30
|
14
|
+
stale-pr-message: >
|
15
|
+
This issue has been automatically marked as stale because it has not had
|
16
|
+
recent activity. It will be closed if no further activity occurs.
|
17
|
+
close-pr-message: >
|
18
|
+
This issue has been automatically closed because it has had no activity
|
19
|
+
for over 90 days. Please re-open if you feel this was done in error.
|
20
|
+
exempt-pr-labels: 'dependabot,depfu,dependencies,security'
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 1.4.2 - 2023-02-23
|
8
|
+
### Changed
|
9
|
+
- Remove references to toolbox-script in workflows
|
10
|
+
- Updated Gemfile.lock
|
11
|
+
|
12
|
+
## 1.4.1 - 2022-04-14
|
13
|
+
### Changed
|
14
|
+
- Fixing lint issues
|
15
|
+
|
7
16
|
## 1.4.0 - 2021-12-31
|
8
17
|
### Changed
|
9
18
|
- Add Ruby 3.0.x support
|
@@ -9,15 +9,14 @@ module PiiSafeSchema
|
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
-
# rubocop:disable Metrics/AbcSize
|
13
12
|
def generate_migration_for(table, columns)
|
14
13
|
generator = ActiveRecord::Generators::MigrationGenerator.new(
|
15
14
|
["change_comments_in_#{table}"],
|
16
15
|
)
|
17
16
|
generated_lines = generate_migration_lines(table, columns)
|
18
17
|
migration_file = generator.create_migration_file
|
19
|
-
file_lines = File.
|
20
|
-
change_line = file_lines.find_index { |i|
|
18
|
+
file_lines = File.read(migration_file).split("\n")
|
19
|
+
change_line = file_lines.find_index { |i| i.include?('def change') }
|
21
20
|
new_contents = file_lines[0..change_line] + generated_lines + file_lines[change_line + 1..]
|
22
21
|
|
23
22
|
File.open(migration_file, 'w') do |f|
|
@@ -26,13 +25,12 @@ module PiiSafeSchema
|
|
26
25
|
end
|
27
26
|
migration_file
|
28
27
|
end
|
29
|
-
# rubocop:enable Metrics/AbcSize
|
30
28
|
|
31
29
|
def generate_migration_lines(table, columns)
|
32
30
|
migration_lines = columns.map do |c|
|
33
|
-
"#{' ' * (safety_assured? ? 6 : 4)}"\
|
34
|
-
"change_column :#{table}, :#{c.column.name}, :#{c.column.type}, "\
|
35
|
-
"comment: \'#{c.suggestion.to_json}\'"\
|
31
|
+
"#{' ' * (safety_assured? ? 6 : 4)}" \
|
32
|
+
"change_column :#{table}, :#{c.column.name}, :#{c.column.type}, " \
|
33
|
+
"comment: \'#{c.suggestion.to_json}\'" \
|
36
34
|
end
|
37
35
|
wrap_in_safety_assured(migration_lines)
|
38
36
|
end
|
data/pii_safe_schema.gemspec
CHANGED
@@ -3,22 +3,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
require 'pii_safe_schema/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name
|
7
|
-
s.version
|
8
|
-
s.authors
|
9
|
-
s.email
|
6
|
+
s.name = 'pii_safe_schema'
|
7
|
+
s.version = PiiSafeSchema::VERSION
|
8
|
+
s.authors = ['Alexi Garrow']
|
9
|
+
s.email = ['agarrow@wealthsimple.com']
|
10
10
|
|
11
|
-
s.summary
|
12
|
-
s.homepage
|
13
|
-
s.license
|
11
|
+
s.summary = 'Schema migration tool for checking and adding comments on PII columns.'
|
12
|
+
s.homepage = 'https://github.com/wealthsimple/pii_safe_schema'
|
13
|
+
s.license = "MIT"
|
14
14
|
s.required_ruby_version = Gem::Requirement.new(">= 2.6")
|
15
15
|
|
16
16
|
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
17
|
f.match(%r{^(test|spec|features)/})
|
18
18
|
end
|
19
19
|
|
20
|
-
s.bindir
|
21
|
-
s.executables
|
20
|
+
s.bindir = 'exe'
|
21
|
+
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
s.require_paths = ['lib']
|
23
23
|
|
24
24
|
s.add_dependency 'colorize'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pii_safe_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexi Garrow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -304,6 +304,7 @@ files:
|
|
304
304
|
- ".github/CODEOWNERS"
|
305
305
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
306
306
|
- ".github/workflows/default.yml"
|
307
|
+
- ".github/workflows/stale.yml"
|
307
308
|
- ".gitignore"
|
308
309
|
- ".rspec"
|
309
310
|
- ".rubocop.yml"
|