rails_error_dashboard 0.1.13 → 0.1.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cb43c836bc9a37283967490ad1c9e38eec95903fcb6eb1f8fda39e305eda044
4
- data.tar.gz: 9b5ae145da9967e59a0ad17154af14fc9fdb85037649d5587c473d008c0c89fc
3
+ metadata.gz: e1f6863e7b28220e7b384b6a2f27d88e2f996187fdff0947683eda7cbf28055d
4
+ data.tar.gz: 00f620f673e8b900c242e3dce814c1068619c2ad5345e8cf37cf22b2753d65ee
5
5
  SHA512:
6
- metadata.gz: c39e424531a1bc9869845fca21af2f71098da5ee18f09b04d310b2719d0c108021b917a70b73a39d8b42c5048cf939c3c8c716c14b7b199dd65f3845f3029ac6
7
- data.tar.gz: 04b650c61784d45b51c16a803601518c0dae6765ad5bede0a94748eedad92addc841582933ccd70f9c8479280c2a9e335788389c6ce770437dbc7c5901d9bdba
6
+ metadata.gz: bc9f07b4ff7765d9446f2e323da276abd1e5e1c35c4ed2c68af813a6ccf853d70fc0c4109ae41609913f554f6633cd89a887065c8f7adcd4a843116440e697c9
7
+ data.tar.gz: 2defe3dbcf36a20b83e1faf1da908fe4a731072ea981dc6bee568ecf8bfde45ec0eaa46aa1ae77726e7bb5ae34b96bdd429b515280e54beeea581804120d4855
@@ -111,5 +111,24 @@ module RailsErrorDashboard
111
111
  content_tag(:span, icon, class: "text-muted small")
112
112
  end
113
113
  end
114
+
115
+ # Generates a link to a git commit if repository URL is configured
116
+ # @param git_sha [String] The git commit SHA
117
+ # @param short [Boolean] Whether to show short SHA (7 chars) or full SHA
118
+ # @return [String] HTML safe link to commit or plain text if no repo configured
119
+ def git_commit_link(git_sha, short: true)
120
+ return "" if git_sha.blank?
121
+
122
+ config = RailsErrorDashboard.configuration
123
+ display_sha = short ? git_sha[0..6] : git_sha
124
+
125
+ if config.git_repository_url.present?
126
+ # Support GitHub, GitLab, Bitbucket URL formats
127
+ commit_url = "#{config.git_repository_url.chomp("/")}/commit/#{git_sha}"
128
+ link_to display_sha, commit_url, class: "text-decoration-none font-monospace", target: "_blank", rel: "noopener"
129
+ else
130
+ content_tag(:code, display_sha, class: "font-monospace")
131
+ end
132
+ end
114
133
  end
115
134
  end
@@ -499,7 +499,7 @@
499
499
  <strong>Git SHA</strong>
500
500
  <br><small class="text-muted">Deployed commit</small>
501
501
  </div>
502
- <code class="fs-6"><%= @config.git_sha[0..7] %></code>
502
+ <span class="fs-6"><%= git_commit_link(@config.git_sha) %></span>
503
503
  </div>
504
504
  </div>
505
505
  <% end %>
@@ -745,7 +745,7 @@
745
745
  <% if @error.git_sha.present? %>
746
746
  <div class="mb-1">
747
747
  <small class="text-muted">Git SHA:</small>
748
- <code class="ms-1"><%= @error.git_sha[0..7] %></code>
748
+ <span class="ms-1"><%= git_commit_link(@error.git_sha) %></span>
749
749
  </div>
750
750
  <% end %>
751
751
 
@@ -296,4 +296,11 @@ RailsErrorDashboard.configure do |config|
296
296
  config.app_version = ENV["APP_VERSION"]
297
297
  config.git_sha = ENV["GIT_SHA"]
298
298
  # config.total_users_for_impact = 10000 # For user impact % calculation
299
+
300
+ # Git repository URL for clickable commit links
301
+ # Examples:
302
+ # GitHub: "https://github.com/username/repo"
303
+ # GitLab: "https://gitlab.com/username/repo"
304
+ # Bitbucket: "https://bitbucket.org/username/repo"
305
+ # config.git_repository_url = ENV["GIT_REPOSITORY_URL"]
299
306
  end
@@ -69,6 +69,9 @@ module RailsErrorDashboard
69
69
  attr_accessor :git_sha
70
70
  attr_accessor :total_users_for_impact # For user impact % calculation
71
71
 
72
+ # Git repository URL for linking commits (e.g., "https://github.com/user/repo")
73
+ attr_accessor :git_repository_url
74
+
72
75
  # Advanced error analysis features
73
76
  attr_accessor :enable_similar_errors # Fuzzy error matching
74
77
  attr_accessor :enable_co_occurring_errors # Detect errors happening together
@@ -142,6 +145,7 @@ module RailsErrorDashboard
142
145
  @app_version = ENV["APP_VERSION"]
143
146
  @git_sha = ENV["GIT_SHA"]
144
147
  @total_users_for_impact = nil # Auto-detect if not set
148
+ @git_repository_url = ENV["GIT_REPOSITORY_URL"]
145
149
 
146
150
  # Advanced error analysis features (all OFF by default - opt-in)
147
151
  @enable_similar_errors = false # Fuzzy error matching
@@ -1,3 +1,3 @@
1
1
  module RailsErrorDashboard
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_error_dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anjan Jagirdar
@@ -378,7 +378,7 @@ metadata:
378
378
  source_code_uri: https://github.com/AnjanJ/rails_error_dashboard
379
379
  changelog_uri: https://github.com/AnjanJ/rails_error_dashboard/blob/main/CHANGELOG.md
380
380
  post_install_message: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n
381
- \ Rails Error Dashboard v0.1.13\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n\U0001F195
381
+ \ Rails Error Dashboard v0.1.14\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n\U0001F195
382
382
  First time? Quick start:\n rails generate rails_error_dashboard:install\n rails
383
383
  db:migrate\n # Add to config/routes.rb:\n mount RailsErrorDashboard::Engine
384
384
  => '/error_dashboard'\n\n\U0001F504 Upgrading from v0.1.x?\n rails db:migrate\n