-
-
Notifications
You must be signed in to change notification settings - Fork 513
Improve default slug generation for sidekiq-scheduler
#2184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve default slug generation for sidekiq-scheduler
#2184
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-scheduler
sidekiq-scheduler
@@ -44,9 +44,9 @@ def sentry_monitor_check_ins(slug: nil, monitor_config: nil) | |||
prepend Patch | |||
end | |||
|
|||
def sentry_monitor_slug | |||
def sentry_monitor_slug(base_name = name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`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
@st0012 @sl0thentr0py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Description
sidekiq-scheduler
allows to use a class name as a schedule name directly as follows.In this case, a slug is shown as
namspecedcancelabandonedorders
on 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.