Sha256: a607dc6ee3592c941aa48d96ec840eceb2a27f9e6a6b512737cf20235a552439

Contents?: true

Size: 1 KB

Versions: 39

Compression:

Stored size: 1 KB

Contents

module ShopifyCLI
  module GitHub
    module IssueURLGenerator
      def self.error_url(error)
        title = "[Bug]: #{error.class}: #{error.message}"
        labels = "type:bug"

        # take at most 5 lines from backtrace
        stacktrace_text =
          if error.backtrace # Sometimes errors seem to appear without backtrace, see https://github.com/Shopify/shopify-cli/issues/1972#issuecomment-1028013630
            stacktrace = error.backtrace.length < 5 ? error.backtrace : error.backtrace[0..4]
            stacktrace.join("\n").to_s
          else
            ""
          end
        query = URI.encode_www_form({
          title: title,
          labels: labels,
          template: "bug_report.yaml",
          stack_trace: stacktrace_text,
          os: RUBY_PLATFORM,
          cli_version: ShopifyCLI::VERSION,
          ruby_version: "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}",
          shell: ENV["SHELL"],
        })
        "#{ShopifyCLI::Constants::Links::NEW_ISSUE}?#{query}"
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.35.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.34.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.33.1 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.33.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.32.1 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.32.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.31.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.30.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.29.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.28.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.27.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.26.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.25.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.24.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.23.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.22.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.21.0 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.20.1 lib/shopify_cli/github/issue_url_generator.rb
shopify-cli-2.20.0 lib/shopify_cli/github/issue_url_generator.rb