Improve default slug generation for sidekiq-scheduler#2184
Merged
st0012 merged 1 commit intogetsentry:masterfrom Nov 29, 2023
Merged
Improve default slug generation for sidekiq-scheduler#2184st0012 merged 1 commit intogetsentry:masterfrom
sidekiq-scheduler#2184st0012 merged 1 commit intogetsentry:masterfrom
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2184 +/- ##
=======================================
Coverage 97.31% 97.31%
=======================================
Files 99 99
Lines 3691 3692 +1
=======================================
+ Hits 3592 3593 +1
Misses 99 99
|
a0d0d0a to
0d0ebe3
Compare
sidekiq-schedulersidekiq-scheduler
st0012
reviewed
Nov 29, 2023
| end | ||
|
|
||
| def sentry_monitor_slug | ||
| def sentry_monitor_slug(base_name = name) |
Contributor
There was a problem hiding this comment.
Nit: let's keep calling it name as base_name could easily be associated basename methods in classes like Pathname and cause confusion. And IMO using karg will also make the API easier to use & maintain:
def sentry_monitor_slug(name: self.name)
end`sidekiq-scheduler` allows to use a class name as a schedule name directly as follows. ``` Namspeced::CancelAbandonedOrders: cron: '0 */5 * * * *' ``` In this case, a slug is shown as `namspecedcancelabandonedorders` on Sentry. I think this isn't good for readability. This PR converts `::` to `-` as well as the cron default behavior of Crons mixin. Related with: getsentry#2138.
0d0ebe3 to
6271670
Compare
Contributor
Author
|
@st0012 @sl0thentr0py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
sidekiq-schedulerallows to use a class name as a schedule name directly as follows.In this case, a slug is shown as
namspecedcancelabandonedorderson Sentry now. I think this isn't good for readability.This PR converts
::to-as well as the cron default behavior of Crons mixin.Related with: #2138.