pii_safe_schema 1.4.1 → 1.4.3
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 +4 -4
 - data/.github/workflows/default.yml +7 -10
 - data/.github/workflows/stale.yml +1 -1
 - data/.gitignore +2 -0
 - data/CHANGELOG.md +9 -0
 - data/lib/pii_safe_schema/migration_generator.rb +4 -4
 - data/lib/pii_safe_schema/version.rb +1 -1
 - data/pii_safe_schema.gemspec +9 -9
 - 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: 973800d3f7572f3584a1c1b9a1d2d03cc661ba91aeff6d46ff153a75ef318af4
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5bdc3044877d04b323d443b80a56113439f17e92132337a5acb65c8f084ed9ff
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: a313d56d13d0225523d7d85e71c850d18b6036612ac838fefd436a1db2cb3daadc8ece18c63fe5df92c9a4c224284bdb0f35339503cf4ea5b3555bed037cb5bd
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d6a5907f4e961f6ebfa81c769694aed2fd5bccfb10f6d0334dd3bccd8511627242e4c408ec406626501fb064b000526cdadb45a7b6c1fbc4859408a05a8d22bb
         
     | 
| 
         @@ -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 }}
         
     | 
| 
         @@ -22,7 +20,7 @@ jobs: 
     | 
|
| 
       22 
20 
     | 
    
         
             
                    ruby-version: [2.7.5, 3.0.3]
         
     | 
| 
       23 
21 
     | 
    
         
             
                steps:
         
     | 
| 
       24 
22 
     | 
    
         
             
                  # Need to fetch all refs, so we can check if the version has been bumped
         
     | 
| 
       25 
     | 
    
         
            -
                  - uses: actions/checkout@ 
     | 
| 
      
 23 
     | 
    
         
            +
                  - uses: actions/checkout@v3
         
     | 
| 
       26 
24 
     | 
    
         
             
                    with:
         
     | 
| 
       27 
25 
     | 
    
         
             
                      fetch-depth: 0
         
     | 
| 
       28 
26 
     | 
    
         | 
| 
         @@ -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
         
     | 
| 
         @@ -49,7 +46,7 @@ jobs: 
     | 
|
| 
       49 
46 
     | 
    
         
             
                needs:
         
     | 
| 
       50 
47 
     | 
    
         
             
                  - preflight_check
         
     | 
| 
       51 
48 
     | 
    
         
             
                steps:
         
     | 
| 
       52 
     | 
    
         
            -
                  - uses: actions/checkout@ 
     | 
| 
      
 49 
     | 
    
         
            +
                  - uses: actions/checkout@v3
         
     | 
| 
       53 
50 
     | 
    
         | 
| 
       54 
51 
     | 
    
         
             
                  - uses: ruby/setup-ruby@v1
         
     | 
| 
       55 
52 
     | 
    
         
             
                    with:
         
     | 
    
        data/.github/workflows/stale.yml
    CHANGED
    
    
    
        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.3 - 2023-05-11
         
     | 
| 
      
 8 
     | 
    
         
            +
            ### Changed
         
     | 
| 
      
 9 
     | 
    
         
            +
            - Updated workflows to use most recent Actions
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            ## 1.4.2 - 2023-02-23
         
     | 
| 
      
 12 
     | 
    
         
            +
            ### Changed
         
     | 
| 
      
 13 
     | 
    
         
            +
            - Remove references to toolbox-script in workflows
         
     | 
| 
      
 14 
     | 
    
         
            +
            - Updated Gemfile.lock
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
       7 
16 
     | 
    
         
             
            ## 1.4.1 - 2022-04-14
         
     | 
| 
       8 
17 
     | 
    
         
             
            ### Changed
         
     | 
| 
       9 
18 
     | 
    
         
             
            - Fixing lint issues
         
     | 
| 
         @@ -16,7 +16,7 @@ module PiiSafeSchema 
     | 
|
| 
       16 
16 
     | 
    
         
             
                    generated_lines = generate_migration_lines(table, columns)
         
     | 
| 
       17 
17 
     | 
    
         
             
                    migration_file = generator.create_migration_file
         
     | 
| 
       18 
18 
     | 
    
         
             
                    file_lines = File.read(migration_file).split("\n")
         
     | 
| 
       19 
     | 
    
         
            -
                    change_line = file_lines.find_index { |i|  
     | 
| 
      
 19 
     | 
    
         
            +
                    change_line = file_lines.find_index { |i| i.include?('def change') }
         
     | 
| 
       20 
20 
     | 
    
         
             
                    new_contents = file_lines[0..change_line] + generated_lines + file_lines[change_line + 1..]
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
                    File.open(migration_file, 'w') do |f|
         
     | 
| 
         @@ -28,9 +28,9 @@ module PiiSafeSchema 
     | 
|
| 
       28 
28 
     | 
    
         | 
| 
       29 
29 
     | 
    
         
             
                  def generate_migration_lines(table, columns)
         
     | 
| 
       30 
30 
     | 
    
         
             
                    migration_lines = columns.map do |c|
         
     | 
| 
       31 
     | 
    
         
            -
                      "#{' ' * (safety_assured? ? 6 : 4)}"\
         
     | 
| 
       32 
     | 
    
         
            -
                        "change_column :#{table}, :#{c.column.name}, :#{c.column.type}, "\
         
     | 
| 
       33 
     | 
    
         
            -
                        "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}\'" \
         
     | 
| 
       34 
34 
     | 
    
         
             
                    end
         
     | 
| 
       35 
35 
     | 
    
         
             
                    wrap_in_safety_assured(migration_lines)
         
     | 
| 
       36 
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.3
         
     | 
| 
       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-06-01 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: colorize
         
     |