Repository navigation
feat(hangfire): Add an option to monitor all recurring jobs #5742
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2efa02f
feat(hangfire): Send recurring job schedule as monitor config
wedamija 87ca4ca
ref(hangfire): Validate the recurring job schedule before capturing
wedamija 83761df
test(hangfire): Skip time zone tests when the zone is missing
wedamija a690ccb
fix(hangfire): Skip schedules Sentry would read differently
wedamija be12c47
feat(hangfire): Send recurring job schedules by default
wedamija 21d2520
fix(hangfire): Create the check-in ID before the in-progress check-in
wedamija 96c1d60
ref(hangfire): Rename SendRecurringJobSchedule to SendMonitorConfig
wedamija aadf2ba
feat(hangfire): Don't send a monitor config when recurring jobs share…
wedamija 7d345b8
fix(hangfire): Don't treat a recurring job as conflicting with its ow…
wedamija dd683bd
feat(hangfire): Add an option to monitor every recurring job
wedamija cbf135b
Merge remote-tracking branch 'origin/main' into danf/hangfire-bulk-cr…
wedamija 88a6e70
fix(hangfire): Build recurring job slugs the way Sentry normalizes them
wedamija 0f34ab6
feat(hangfire): Match Relay's slugify and accept regexes in ExcludedR…
wedamija 87529d1
Merge remote-tracking branch 'origin/main' into danf/hangfire-bulk-cron
wedamija 08591be
ref(crons): Share one Relay-compatible slug helper between Hangfire a…
wedamija File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| using System.Text; | ||
|
|
||
| namespace Sentry.Internal; | ||
|
|
||
| /// <summary> | ||
| /// Builds monitor slugs the way Sentry's slugify_monitor_slug does, so Sentry shows the same slug. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Also compiled into Sentry.Hangfire, which can't see Sentry's internals because it isn't strong-named. | ||
| /// </remarks> | ||
| internal static class MonitorSlug | ||
| { | ||
| private const int MaxLength = 50; | ||
|
|
||
| /// <summary> | ||
| /// Returns the slug of <paramref name="value"/>, or <c>null</c> when nothing usable is left. | ||
| /// </summary> | ||
| public static string? From(string value) | ||
| { | ||
| string normalized; | ||
| try | ||
| { | ||
| normalized = value.Normalize(NormalizationForm.FormKD); | ||
| } | ||
| catch (PlatformNotSupportedException) | ||
| { | ||
| // Invariant globalization mode can't normalize non-ASCII text | ||
| normalized = value; | ||
| } | ||
|
|
||
| var slug = new StringBuilder(normalized.Length); | ||
| var inSeparator = false; | ||
| foreach (var c in normalized) | ||
| { | ||
| if (c is '-' or ' ' or >= '\t' and <= '\r' or >= '\x1c' and <= '\x1f') | ||
| { | ||
| if (!inSeparator) | ||
| { | ||
| slug.Append('-'); | ||
| inSeparator = true; | ||
| } | ||
| } | ||
| else if (c is >= 'a' and <= 'z' or >= '0' and <= '9' or '_') | ||
| { | ||
| slug.Append(c); | ||
| inSeparator = false; | ||
| } | ||
| else if (c is >= 'A' and <= 'Z') | ||
| { | ||
| slug.Append(char.ToLowerInvariant(c)); | ||
| inSeparator = false; | ||
| } | ||
| } | ||
|
|
||
| var result = slug.ToString().Trim('-', '_'); | ||
| if (result.Length > MaxLength) | ||
| { | ||
| result = result.Substring(0, MaxLength).TrimEnd('-'); | ||
| } | ||
| return result.Length > 0 ? result : null; | ||
| } | ||
| } |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.