sentry_top_errors 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 312ff43ff1b7e67a60e97d53ce62420fdcb1a7e0d661df6fed257ad1f2fddea5
4
- data.tar.gz: 3b2a17b9ca30d78d2a27f26d9c05802c1af5fe410a92c49eb2a7abb49f40bcbe
3
+ metadata.gz: 036da0a8225db87b61c37b236428dc72bc20a426fdc3cb83920a74ad96788bbd
4
+ data.tar.gz: b98afd0bb566f7958344171264e2363d66886f86dec1a8f24bf3c10d4c00d2a3
5
5
  SHA512:
6
- metadata.gz: 4729a76870723d4941e0687d74a0947c1301fb80449037ed51b89f671f211a209fac35a9893d579471789e0c67d59cfd7f416f662a56e186d2a09a9eb36b9ce7
7
- data.tar.gz: 81976c7433fe881e4f805366423527a6966bd8b6cdc550250efef0bfc803bc51703fe130bc50ba18bffac05d15e3862eba8acd5af3bad208be4444587593edc6
6
+ metadata.gz: 351fe1c8cba7d350cd864cc5cd036b39fb91851c425dfdf407268c3031e267edb20a3e5d73adb9d94c88da9b9417d5351b7dbb6933cde09c50617dab7cb63030
7
+ data.tar.gz: ba898a868a3a3882708a13a44a1e2c35e59adfe4e4d8b791f8684f77b578df1888c260123a49f7df6243556867576bbf36f97b503a336fe4f952a6e2749a0dce
@@ -24,4 +24,4 @@ end
24
24
 
25
25
  reporter = SentryTopErrors::Reporter.new(client: client, report_type: :html)
26
26
  reporter.fetch_data
27
- puts r.generate_report
27
+ puts reporter.generate_report
@@ -1,5 +1,3 @@
1
- require 'progress_bar'
2
-
3
1
  class SentryTopErrors::Reporter
4
2
  def initialize(client:, prod_regex: /^p-/, threshold_24h: 30, threshold_new: 10, new_days_num: 1, report_type: :html)
5
3
  @client = client
@@ -139,8 +137,12 @@ class SentryTopErrors::Reporter
139
137
  elsif @report_type == :html
140
138
  tpl_dir = File.join(File.expand_path(File.dirname(__FILE__) + "/../.."), "templates")
141
139
  html_content = File.read(tpl_dir + "/index.html")
140
+ project_orgs = @projects.map {|pr| pr['organization']['name'] }.uniq.join(", ")
141
+
142
142
  html_content.sub!(%{['ALL_ISSUE_COUNTS_PLACEHOLDER']}, JSON.pretty_generate(issue_counts))
143
143
  html_content.sub!(%{['NEW_ISSUE_COUNTS_PLACEHOLDER']}, JSON.pretty_generate(new_issues))
144
+ html_content.sub!("REPORT_GENERATE_DATE", Time.now.strftime("%F %T %Z"))
145
+ html_content.sub!("REPORT_SENTRY_ORG", project_orgs)
144
146
 
145
147
  puts "Saved index.html"
146
148
  File.write("./index.html", html_content)
@@ -2,6 +2,7 @@ require 'excon'
2
2
  require 'json'
3
3
  require 'yaml'
4
4
  require 'time'
5
+ require 'progress_bar'
5
6
 
6
7
  module SentryTopErrors
7
8
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sentry_top_errors"
3
- s.version = "0.1.1"
3
+ s.version = "0.1.2"
4
4
  s.summary = "Generate top errors report for sentry"
5
5
  s.description = ""
6
6
  s.author = "Pavel Evstigneev"
data/templates/index.html CHANGED
@@ -93,6 +93,8 @@
93
93
  <a href=''>Sentry Errors</a>
94
94
  </h1>
95
95
 
96
+ <p>Generated at: <b>REPORT_GENERATE_DATE</b>, for sentry organization <b>REPORT_SENTRY_ORG</b></p>
97
+
96
98
  <h2>Repeating Issues</h2>
97
99
 
98
100
  <table class='rows-table full-width' id="issues-table">
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry_top_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Evstigneev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-17 00:00:00.000000000 Z
11
+ date: 2023-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon