gitlab_quality-test_tooling 1.10.0 → 1.11.0
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/Gemfile.lock +1 -1
- data/lib/gitlab_quality/test_tooling/gitlab_client/issues_client.rb +0 -10
- data/lib/gitlab_quality/test_tooling/report/report_as_issue.rb +2 -1
- data/lib/gitlab_quality/test_tooling/test_result/j_unit_test_result.rb +2 -0
- data/lib/gitlab_quality/test_tooling/test_result/json_test_result.rb +6 -4
- data/lib/gitlab_quality/test_tooling/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: 9d5389523997b69a28fe068d576dc92e77c1bcc461fda4ed50292bb2ce6d8c9c
         | 
| 4 | 
            +
              data.tar.gz: 541341b34aa04d235d8c1b068f28533ff804b57411ce56237cb16f64e3381ad3
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 17a53fa74d99ebd6bde6397ed9a5976cdce5a7fef4eb2ac20256bf93ffd8f346b15ff467b6ff6207f07a930597ec5b7814c131293d8d9a29548b5f39b10ca90e
         | 
| 7 | 
            +
              data.tar.gz: 1a918bc5b005653e9ce263c728f0068256df77c638961d59a62b0461cdeb9d774556a58fe41e2409a81e0fac98f838c53d057c5ba7483ab04facc17c0e54e999
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
| @@ -48,16 +48,6 @@ module GitlabQuality | |
| 48 48 | 
             
                      end
         | 
| 49 49 | 
             
                    end
         | 
| 50 50 |  | 
| 51 | 
            -
                    def find_issues_by_hash(test_hash, &select)
         | 
| 52 | 
            -
                      select ||= :itself
         | 
| 53 | 
            -
             | 
| 54 | 
            -
                      handle_gitlab_client_exceptions do
         | 
| 55 | 
            -
                        client.search_in_project(project, 'issues', test_hash)
         | 
| 56 | 
            -
                              .auto_paginate
         | 
| 57 | 
            -
                              .select(&select)
         | 
| 58 | 
            -
                      end
         | 
| 59 | 
            -
                    end
         | 
| 60 | 
            -
             | 
| 61 51 | 
             
                    def find_issue_discussions(iid:)
         | 
| 62 52 | 
             
                      handle_gitlab_client_exceptions do
         | 
| 63 53 | 
             
                        client.issue_discussions(project, iid, order_by: 'created_at', sort: 'asc').auto_paginate
         | 
| @@ -139,7 +139,8 @@ module GitlabQuality | |
| 139 139 | 
             
                    end
         | 
| 140 140 |  | 
| 141 141 | 
             
                    def find_issues_by_hash(test_hash)
         | 
| 142 | 
            -
                       | 
| 142 | 
            +
                      search_options = { search: test_hash }
         | 
| 143 | 
            +
                      gitlab.find_issues(options: search_options)
         | 
| 143 144 | 
             
                    end
         | 
| 144 145 |  | 
| 145 146 | 
             
                    def find_issues_for_test(test, labels:, not_labels: Set.new, state: nil)
         | 
| @@ -29,7 +29,9 @@ module GitlabQuality | |
| 29 29 | 
             
                        end
         | 
| 30 30 |  | 
| 31 31 | 
             
                        exception['message'].gsub!(/(private_token=)[\w-]+/, '********')
         | 
| 32 | 
            +
                        exception['message'].gsub!(/("Authorization": \[\n\s*"token )([\w-]+)/, '\1********')
         | 
| 32 33 | 
             
                        exception.content = exception.content.gsub(/(private_token=)[\w-]+/, '********')
         | 
| 34 | 
            +
                        exception.content = exception.content.gsub(/("Authorization": \[\n\s*"token )([\w-]+)/, '\1********')
         | 
| 33 35 | 
             
                        {
         | 
| 34 36 | 
             
                          'message' => "#{exception['type']}: #{exception['message']}",
         | 
| 35 37 | 
             
                          'stacktrace' => trace.slice(0..spec_file_first_index).join("\n"),
         | 
| @@ -5,6 +5,7 @@ module GitlabQuality | |
| 5 5 | 
             
                module TestResult
         | 
| 6 6 | 
             
                  class JsonTestResult < BaseTestResult
         | 
| 7 7 | 
             
                    PRIVATE_TOKEN_REGEX = /(private_token=)[\w-]+/
         | 
| 8 | 
            +
                    AUTHENTICATION_TOKEN_REGEX = /("Authorization": \[\n\s*"token )([\w-]+)/
         | 
| 8 9 |  | 
| 9 10 | 
             
                    OTHER_TESTS_MAX_DURATION = 45.40 # seconds
         | 
| 10 11 |  | 
| @@ -144,8 +145,8 @@ module GitlabQuality | |
| 144 145 | 
             
                            line.include?(File.basename(report['file_path']))
         | 
| 145 146 | 
             
                          end
         | 
| 146 147 |  | 
| 147 | 
            -
                          message =  | 
| 148 | 
            -
                          message_lines = Array(exception['message_lines']).map { |line|  | 
| 148 | 
            +
                          message = redact_private_and_auth_tokens(exception['message'])
         | 
| 149 | 
            +
                          message_lines = Array(exception['message_lines']).map { |line| redact_private_and_auth_tokens(line) }
         | 
| 149 150 |  | 
| 150 151 | 
             
                          {
         | 
| 151 152 | 
             
                            'message' => "#{exception['class']}: #{message}",
         | 
| @@ -193,8 +194,9 @@ module GitlabQuality | |
| 193 194 | 
             
                      message_lines.is_a?(Array) ? message_lines.join("\n") : message_lines
         | 
| 194 195 | 
             
                    end
         | 
| 195 196 |  | 
| 196 | 
            -
                    def  | 
| 197 | 
            -
                      text.gsub(PRIVATE_TOKEN_REGEX, '********')
         | 
| 197 | 
            +
                    def redact_private_and_auth_tokens(text)
         | 
| 198 | 
            +
                      private_redacted = text.gsub(PRIVATE_TOKEN_REGEX, '********')
         | 
| 199 | 
            +
                      private_redacted.gsub(AUTHENTICATION_TOKEN_REGEX, '\1********')
         | 
| 198 200 | 
             
                    end
         | 
| 199 201 | 
             
                  end
         | 
| 200 202 | 
             
                end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: gitlab_quality-test_tooling
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.11.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - GitLab Quality
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2024-01- | 
| 11 | 
            +
            date: 2024-01-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: climate_control
         |