ci: Sentry reporting only on develop branch, with Git message overrides#27412
ci: Sentry reporting only on develop branch, with Git message overrides#27412HowardBraham merged 1 commit intodevelopfrom
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
abd82c5 to
75ab8e0
Compare
Builds ready [abd82c5]
Page Load Metrics (1976 ± 116 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Builds ready [75ab8e0]
Page Load Metrics (1820 ± 85 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| doNotForceSentryForThisTest?: boolean; | ||
| sentry?: { | ||
| tracesSampleRate?: number; | ||
| doNotForceSentryForThisTest?: boolean; |
There was a problem hiding this comment.
Minor, could we remove the Sentry from this property as it's now implied by the parent property?
| // Report very frequently on develop branch, and never on other branches | ||
| // (Unless you do a [flags.sentry.tracesSampleRate: x.xx] override) | ||
| if (flags.circleci.branch === 'develop') { | ||
| return 0.03; |
There was a problem hiding this comment.
Minor, is it worth some constants for all these values for easier maintenance? Such as TRACES_SAMPLE_RATE_CIRCLE_CI_DEVELOP, TRACES_SAMPLE_RATE_CIRCLE_CI_OTHER, TRACES_SAMPLE_RATE_DEBUG etc?
| } | ||
|
|
||
| // Grab the tracesSampleRate from the git message if it's set | ||
| function getTracesSampleRateFromGitMessage(): number | undefined { |
There was a problem hiding this comment.
If the goal is to support this for specific PRs, is it possible to read this from the PR title or description via CircleCI?
There was a problem hiding this comment.
@matthewwalsh0 This would require network calls to the GitHub API, which if we don't want to do it hundreds of times, is best done in get-changed-files-with-git-diff
Let's see if anyone even wants to use this system before we spend a lot of additional time on it.
|
|
||
| // Search gitMessage for `[flags.sentry.tracesSampleRate: 0.000 to 1.000]` | ||
| const tracesSampleRateMatch = gitMessage.match( | ||
| /\[flags\.sentry\.tracesSampleRate: (0*(\.\d+)?|1(\.0*)?)\]/u, |
There was a problem hiding this comment.
Minor, is it worth abstracting this into a getConfigFromGitMessage(flag: string): string so this can be used in future?


Description
Vaibhav asked for new Sentry reporting rates from CircleCI:
developbranchI also put in an override, such that if your Git message includes
[flags.sentry.tracesSampleRate: x.xx](a decimal number from 0.00 to 1.00), it will settracesSampleRateto that fraction.Moved what used to be at
_flags.doNotForceSentryForThisTestto_flags.sentry.doNotForceSentryForThisTestRelated issues
Improves on: #26588
Manual testing steps
[flags.sentry.tracesSampleRate: 1.00], and it should report to SentryScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist