pii_safe_schema 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5a9abd519262fb092e04490f3b99c5f7e0293a777b1e29ee9a87b3fe0827728
4
- data.tar.gz: 43c6fc045b82b8075bb73f345d0d60a3f6384a4981edc6c9472fbd8c04e2a9d7
3
+ metadata.gz: 433073ad99b049c37e16a022442070d149fbe0c9c3a7583f1889e2c61d862de5
4
+ data.tar.gz: 6fa3b54cf2af939e1cf26e807a99023a9b1d77cb81994293bc065e95f666bfe9
5
5
  SHA512:
6
- metadata.gz: 26ab3012c6310654ef6a3d8b7f0cd99129105ecee059fa1611f3803da96efba70b1c0bdff854086ff7cc446ce7e84676887dc4299b035fe89507169730c0c68d
7
- data.tar.gz: 7153c208b0ca0574e61eaa186be393d20bec4cab360531f0c8644a1bd68da78695bcd513194477f73713c44839355e715e754f9da6e8259bdb46c9178695d0b1
6
+ metadata.gz: fbaf01bfb0222feabe9eaec16c4d12b7a208311659960a4f321bd03e8871534b1202e4ccd803805de0132ea06970e64103ab1d930556c5e83f217b8f33153256
7
+ data.tar.gz: c440c21ecc60a6a2d32bdfda90ba54ae00252c69013af129e75b89405d72e649500e7101cbe2130848244cd031a4929f981007d598ae36608149b36f8029bf82
data/.github/CODEOWNERS CHANGED
@@ -1 +1,2 @@
1
1
  * @wealthsimple/platform-security
2
+ .github/workflows/* @wealthsimple/developer-tools @wealthsimple/platform-security
@@ -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
- uses: wealthsimple/toolbox-script@v1
37
- with:
38
- script: toolbox.ruby.lint.run();
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
- uses: wealthsimple/toolbox-script@v1
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
@@ -4,4 +4,6 @@ coverage/
4
4
  pkg/
5
5
 
6
6
  .rspec_status
7
+
7
8
  Gemfile.lock
9
+ vendor/
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.open(migration_file, 'r').read.split("\n")
20
- change_line = file_lines.find_index { |i| /def change/.match(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
@@ -1,3 +1,3 @@
1
1
  module PiiSafeSchema
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.4.2'.freeze
3
3
  end
@@ -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 = 'pii_safe_schema'
7
- s.version = PiiSafeSchema::VERSION
8
- s.authors = ['Alexi Garrow']
9
- s.email = ['agarrow@wealthsimple.com']
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 = '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"
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 = 'exe'
21
- s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
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.0
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: 2022-01-04 00:00:00.000000000 Z
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"