gitlab-qa 7.23.0 → 7.24.1
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/.gitlab/merge_request_templates/Release.md +1 -1
- data/.gitlab-ci.yml +2 -2
- data/lib/gitlab/qa/report/relate_failure_issue.rb +19 -12
- data/lib/gitlab/qa/runtime/env.rb +7 -1
- data/lib/gitlab/qa/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: 16d436d7dcc1ff54323d22b1ced1c4685c78b2ac4290e4deea6f4720b26c7bda
         | 
| 4 | 
            +
              data.tar.gz: 8250c321d7130510768ea563bda98978f9ca53c6eac55344ad7475aa4c771324
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: bc86efe53b8067cdf2bcf0788dc9c740bbdf32a8cb0be16d5c3dfee4e5b774f2c4f0ec4787169805d5ca04a075fd0ea3b35bca5b20ae5657906efc8be50eff80
         | 
| 7 | 
            +
              data.tar.gz: 306ee5e2b20f62f50249a5741471a41904e071656b81168e11236398d3b9d3a933419055b84f7667dc23e642163a83ee66aee29c6f3cc0745251cbdcc5b3e696
         | 
| @@ -32,4 +32,4 @@ with the latest commit from https://gitlab.com/gitlab-org/gitlab-qa/commits/mast | |
| 32 32 | 
             
            - Checklist after merging:
         | 
| 33 33 | 
             
              - [ ] [Update the release notes for the newly created tag](docs/release_process.md#how-to).
         | 
| 34 34 |  | 
| 35 | 
            -
            /label ~Quality ~" | 
| 35 | 
            +
            /label ~Quality ~"type::maintenance"
         | 
    
        data/.gitlab-ci.yml
    CHANGED
    
    | @@ -328,7 +328,7 @@ ce:repository_storage-quarantine: | |
| 328 328 |  | 
| 329 329 | 
             
            ee:repository_storage:
         | 
| 330 330 | 
             
              extends:
         | 
| 331 | 
            -
                - .rules: | 
| 331 | 
            +
                - .rules:ee-never-when-triggered-by-feature-flag-definition-change
         | 
| 332 332 | 
             
                - .test
         | 
| 333 333 | 
             
                - .high-capacity
         | 
| 334 334 | 
             
                - .ee-variables
         | 
| @@ -360,7 +360,7 @@ ee:image: | |
| 360 360 | 
             
              script:
         | 
| 361 361 | 
             
                - bundle exec exe/gitlab-qa Test::Omnibus::Image ${RELEASE:=EE}
         | 
| 362 362 | 
             
              extends:
         | 
| 363 | 
            -
                - .rules: | 
| 363 | 
            +
                - .rules:ee-never-when-triggered-by-feature-flag-definition-change
         | 
| 364 364 | 
             
                - .test
         | 
| 365 365 | 
             
                - .ee-variables
         | 
| 366 366 |  | 
| @@ -12,7 +12,7 @@ module Gitlab | |
| 12 12 | 
             
                    DEFAULT_MAX_DIFF_RATIO_FOR_DETECTION = 0.15
         | 
| 13 13 | 
             
                    FAILURE_STACKTRACE_REGEX = %r{((.*Failure\/Error:(?<stacktrace>.+))|(?<stacktrace>.+))}m.freeze
         | 
| 14 14 | 
             
                    ISSUE_STACKTRACE_REGEX = /### Stack trace\s*(```)#{FAILURE_STACKTRACE_REGEX}(```)/m.freeze
         | 
| 15 | 
            -
                    NEW_ISSUE_LABELS = Set.new(%w[QA Quality test failure:: | 
| 15 | 
            +
                    NEW_ISSUE_LABELS = Set.new(%w[QA Quality test failure::new priority::2]).freeze
         | 
| 16 16 |  | 
| 17 17 | 
             
                    MultipleIssuesFound = Class.new(StandardError)
         | 
| 18 18 |  | 
| @@ -20,6 +20,7 @@ module Gitlab | |
| 20 20 | 
             
                      super
         | 
| 21 21 | 
             
                      @max_diff_ratio = max_diff_ratio.to_f
         | 
| 22 22 | 
             
                      @issue_type = 'issue'
         | 
| 23 | 
            +
                      @commented_issue_list = Set.new
         | 
| 23 24 | 
             
                    end
         | 
| 24 25 |  | 
| 25 26 | 
             
                    private
         | 
| @@ -35,41 +36,45 @@ module Gitlab | |
| 35 36 | 
             
                        test_results.each do |test|
         | 
| 36 37 | 
             
                          next if test.failures.empty?
         | 
| 37 38 |  | 
| 38 | 
            -
                           | 
| 39 | 
            +
                          relate_failure_to_issue(test)
         | 
| 39 40 | 
             
                        end
         | 
| 40 41 |  | 
| 41 42 | 
             
                        test_results.write
         | 
| 42 43 | 
             
                      end
         | 
| 43 44 | 
             
                    end
         | 
| 44 45 |  | 
| 45 | 
            -
                    def  | 
| 46 | 
            +
                    def relate_failure_to_issue(test)
         | 
| 46 47 | 
             
                      puts "  => Searching issues for test '#{test.name}'..."
         | 
| 47 48 |  | 
| 48 49 | 
             
                      begin
         | 
| 49 | 
            -
                        issue =  | 
| 50 | 
            +
                        issue = find_and_link_issue(test) || create_issue(test)
         | 
| 50 51 | 
             
                        return unless issue
         | 
| 51 52 |  | 
| 52 53 | 
             
                        update_labels(issue, test)
         | 
| 53 | 
            -
                        post_failed_job_note(issue, test)
         | 
| 54 | 
            -
                        puts "  => Marked #{issue.web_url} as related to #{test.testcase}."
         | 
| 55 54 | 
             
                      rescue MultipleIssuesFound => e
         | 
| 56 55 | 
             
                        warn(e.message)
         | 
| 57 56 | 
             
                      end
         | 
| 58 57 | 
             
                    end
         | 
| 59 58 |  | 
| 60 | 
            -
                    def  | 
| 59 | 
            +
                    def find_and_link_issue(test)
         | 
| 61 60 | 
             
                      issue, diff_ratio = find_failure_issue(test)
         | 
| 62 61 |  | 
| 63 62 | 
             
                      if issue
         | 
| 64 63 | 
             
                        puts "  => Found issue #{issue.web_url} for test '#{test.name}' with a diff ratio of #{(diff_ratio * 100).round(2)}%."
         | 
| 65 | 
            -
             | 
| 66 | 
            -
                        issue | 
| 67 | 
            -
                        puts "for test '#{test.name}'."
         | 
| 64 | 
            +
                        @commented_issue_list.include?(issue.web_url) ? (puts " => Failure already commented on issue.") : post_failed_job_note(issue, test)
         | 
| 65 | 
            +
                        @commented_issue_list.add(issue.web_url)
         | 
| 68 66 | 
             
                      end
         | 
| 69 67 |  | 
| 70 68 | 
             
                      issue
         | 
| 71 69 | 
             
                    end
         | 
| 72 70 |  | 
| 71 | 
            +
                    def create_issue(test)
         | 
| 72 | 
            +
                      issue = super
         | 
| 73 | 
            +
                      puts "for test '#{test.name}'."
         | 
| 74 | 
            +
             | 
| 75 | 
            +
                      issue
         | 
| 76 | 
            +
                    end
         | 
| 77 | 
            +
             | 
| 73 78 | 
             
                    def failure_issues(test)
         | 
| 74 79 | 
             
                      gitlab.find_issues(options: { state: 'opened', labels: 'QA' }).select do |issue|
         | 
| 75 80 | 
             
                        issue_title = issue.title.strip
         | 
| @@ -146,7 +151,8 @@ module Gitlab | |
| 146 151 | 
             
                      super + [
         | 
| 147 152 | 
             
                        "\n\n### Stack trace",
         | 
| 148 153 | 
             
                        "```\n#{test.failures.first['message_lines'].join("\n")}\n```",
         | 
| 149 | 
            -
                        "First happened in #{test.ci_job_url}."
         | 
| 154 | 
            +
                        "First happened in #{test.ci_job_url}.",
         | 
| 155 | 
            +
                        "Related test case: #{test.testcase}."
         | 
| 150 156 | 
             
                      ].join("\n\n")
         | 
| 151 157 | 
             
                    end
         | 
| 152 158 |  | 
| @@ -159,7 +165,8 @@ module Gitlab | |
| 159 165 | 
             
                    end
         | 
| 160 166 |  | 
| 161 167 | 
             
                    def post_failed_job_note(issue, test)
         | 
| 162 | 
            -
                      gitlab.create_issue_note(iid: issue.iid, note: " | 
| 168 | 
            +
                      gitlab.create_issue_note(iid: issue.iid, note: "Failure occurred in #{pipeline} pipeline: #{test.ci_job_url}")
         | 
| 169 | 
            +
                      puts "  => Linked #{test.ci_job_url} to #{issue.web_url}."
         | 
| 163 170 | 
             
                    end
         | 
| 164 171 |  | 
| 165 172 | 
             
                    def new_issue_title(test)
         | 
| @@ -143,12 +143,18 @@ module Gitlab | |
| 143 143 | 
             
                    end
         | 
| 144 144 |  | 
| 145 145 | 
             
                    def variables
         | 
| 146 | 
            -
                      ENV_VARIABLES.each_with_object({}) do |(name, attribute), vars|
         | 
| 146 | 
            +
                      defined_variables = ENV_VARIABLES.each_with_object({}) do |(name, attribute), vars|
         | 
| 147 147 | 
             
                        # Variables that are overridden in the environment take precedence
         | 
| 148 148 | 
             
                        # over the defaults specified by the QA runtime.
         | 
| 149 149 | 
             
                        value = env_var_name_if_defined(name) || send(attribute) # rubocop:disable GitlabSecurity/PublicSend
         | 
| 150 150 | 
             
                        vars[name] = value if value
         | 
| 151 151 | 
             
                      end
         | 
| 152 | 
            +
                      qa_variables = ENV.select { |k, _v| k.start_with?('QA_') }
         | 
| 153 | 
            +
             | 
| 154 | 
            +
                      {
         | 
| 155 | 
            +
                        **qa_variables,
         | 
| 156 | 
            +
                        **defined_variables
         | 
| 157 | 
            +
                      }
         | 
| 152 158 | 
             
                    end
         | 
| 153 159 |  | 
| 154 160 | 
             
                    def debug?
         | 
    
        data/lib/gitlab/qa/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: gitlab-qa
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 7. | 
| 4 | 
            +
              version: 7.24.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - GitLab Quality
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022-02 | 
| 11 | 
            +
            date: 2022-03-02 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: climate_control
         |