From 057ce5f482a3a1a670c9c962c95b92b9bb09a9e9 Mon Sep 17 00:00:00 2001 From: Howard Braham Date: Sun, 29 Sep 2024 21:24:15 -0700 Subject: [PATCH 1/5] remove the `Sentry` from this property as it's now implied by the parent property --- app/scripts/lib/manifestFlags.ts | 2 +- app/scripts/lib/setupSentry.js | 4 ++-- test/e2e/tests/metrics/errors.spec.js | 28 ++++++++++++------------- test/e2e/tests/metrics/sessions.spec.ts | 4 ++-- test/e2e/tests/metrics/traces.spec.ts | 8 +++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/scripts/lib/manifestFlags.ts b/app/scripts/lib/manifestFlags.ts index a013373ac9f2..3823319bfb71 100644 --- a/app/scripts/lib/manifestFlags.ts +++ b/app/scripts/lib/manifestFlags.ts @@ -11,7 +11,7 @@ export type ManifestFlags = { }; sentry?: { tracesSampleRate?: number; - doNotForceSentryForThisTest?: boolean; + doNotForceForThisTest?: boolean; }; }; diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index e6f4a0d4524e..553caefba6d5 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -238,7 +238,7 @@ function getSentryEnvironment() { function getSentryTarget() { if ( - getManifestFlags().sentry?.doNotForceSentryForThisTest || + getManifestFlags().sentry?.doNotForceForThisTest || (process.env.IN_TEST && !SENTRY_DSN_DEV) ) { return SENTRY_DSN_FAKE; @@ -272,7 +272,7 @@ async function getMetaMetricsEnabled() { if ( METAMASK_BUILD_TYPE === 'mmi' || - (flags.circleci && !flags.sentry?.doNotForceSentryForThisTest) + (flags.circleci && !flags.sentry?.doNotForceForThisTest) ) { return true; } diff --git a/test/e2e/tests/metrics/errors.spec.js b/test/e2e/tests/metrics/errors.spec.js index fdeb4437d428..5dac134bd4e5 100644 --- a/test/e2e/tests/metrics/errors.spec.js +++ b/test/e2e/tests/metrics/errors.spec.js @@ -247,7 +247,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryMigratorError, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -278,7 +278,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryTestError, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -319,7 +319,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryMigratorError, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -365,7 +365,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryMigratorError, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -426,7 +426,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryInvariantMigrationError, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -475,7 +475,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -521,7 +521,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -585,7 +585,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryTestError, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -621,7 +621,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -656,7 +656,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryTestError, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -702,7 +702,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryTestError, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, ganacheServer, mockedEndpoint }) => { @@ -766,7 +766,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -810,7 +810,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, ganacheServer, mockedEndpoint }) => { @@ -898,7 +898,7 @@ describe('Sentry errors', function () { ganacheOptions, title: this.test.fullTitle(), manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver }) => { diff --git a/test/e2e/tests/metrics/sessions.spec.ts b/test/e2e/tests/metrics/sessions.spec.ts index f1bdee4538fb..09786a8f6591 100644 --- a/test/e2e/tests/metrics/sessions.spec.ts +++ b/test/e2e/tests/metrics/sessions.spec.ts @@ -38,7 +38,7 @@ describe('Sessions', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentrySession, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -60,7 +60,7 @@ describe('Sessions', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentrySession, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { diff --git a/test/e2e/tests/metrics/traces.spec.ts b/test/e2e/tests/metrics/traces.spec.ts index 194f36ff73b0..fc5251bf659f 100644 --- a/test/e2e/tests/metrics/traces.spec.ts +++ b/test/e2e/tests/metrics/traces.spec.ts @@ -51,7 +51,7 @@ describe('Traces', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentryCustomTrace, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -73,7 +73,7 @@ describe('Traces', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentryCustomTrace, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -95,7 +95,7 @@ describe('Traces', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentryAutomatedTrace, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { @@ -117,7 +117,7 @@ describe('Traces', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentryAutomatedTrace, manifestFlags: { - sentry: { doNotForceSentryForThisTest: true }, + sentry: { doNotForceForThisTest: true }, }, }, async ({ driver, mockedEndpoint }) => { From 32ff8e25000bbfe325ac2a138e04d8fbb13b976b Mon Sep 17 00:00:00 2001 From: Howard Braham Date: Tue, 1 Oct 2024 15:08:25 -0700 Subject: [PATCH 2/5] general getFlagsFromGitMessage() function --- app/scripts/lib/setupSentry.js | 2 +- test/e2e/set-manifest-flags.ts | 41 ++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index 553caefba6d5..6e7edd04487d 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -123,7 +123,7 @@ function getTracesSampleRate(sentryTarget) { if (flags.circleci) { // Report very frequently on develop branch, and never on other branches - // (Unless you do a [flags.sentry.tracesSampleRate: x.xx] override) + // (Unless you use a `flags = {"sentry": {"tracesSampleRate": 0.1}}` override) if (flags.circleci.branch === 'develop') { return 0.03; } diff --git a/test/e2e/set-manifest-flags.ts b/test/e2e/set-manifest-flags.ts index e8d02a12e2cd..c09d69cf677e 100644 --- a/test/e2e/set-manifest-flags.ts +++ b/test/e2e/set-manifest-flags.ts @@ -1,5 +1,6 @@ import { execSync } from 'child_process'; import fs from 'fs'; +import { merge } from 'lodash'; import { ManifestFlags } from '../../app/scripts/lib/manifestFlags'; export const folder = `dist/${process.env.SELENIUM_BROWSER}`; @@ -8,20 +9,33 @@ function parseIntOrUndefined(value: string | undefined): number | undefined { return value ? parseInt(value, 10) : undefined; } -// Grab the tracesSampleRate from the git message if it's set -function getTracesSampleRateFromGitMessage(): number | undefined { +/** + * Grab flags from the Git message if they are set + * + * To use this feature, add a line to your commit message like: + * `flags = {"sentry": {"tracesSampleRate": 0.1}}` + * (must be valid JSON) + * + * @returns flags object if found, undefined otherwise + */ +function getFlagsFromGitMessage(): object | undefined { const gitMessage = execSync( `git show --format='%B' --no-patch "HEAD"`, ).toString(); - // Search gitMessage for `[flags.sentry.tracesSampleRate: 0.000 to 1.000]` - const tracesSampleRateMatch = gitMessage.match( - /\[flags\.sentry\.tracesSampleRate: (0*(\.\d+)?|1(\.0*)?)\]/u, - ); + // Search gitMessage for `flags = {...}` + const flagsMatch = gitMessage.match(/flags\s*=\s*(\{.*\})/u); - if (tracesSampleRateMatch) { - // Return 1st capturing group from regex - return parseFloat(tracesSampleRateMatch[1]); + if (flagsMatch) { + try { + // Get 1st capturing group from regex + return JSON.parse(flagsMatch[1]); + } catch (error) { + console.error( + 'Error parsing flags from git message, ignoring flags\n', + error, + ); + } } return undefined; @@ -41,12 +55,11 @@ export function setManifestFlags(flags: ManifestFlags = {}) { ), }; - const tracesSampleRate = getTracesSampleRateFromGitMessage(); + const gitMessageFlags = getFlagsFromGitMessage(); - // 0 is a valid value, so must explicitly check for undefined - if (tracesSampleRate !== undefined) { - // Add tracesSampleRate to flags.sentry (which may or may not already exist) - flags.sentry = { ...flags.sentry, tracesSampleRate }; + if (gitMessageFlags) { + // Use lodash merge to do a deep merge (spread operator is shallow) + flags = merge(flags, gitMessageFlags); } } From dc6ac271d01f56a31a1b1418534910052c4f0b29 Mon Sep 17 00:00:00 2001 From: Howard Braham Date: Tue, 1 Oct 2024 17:28:37 -0700 Subject: [PATCH 3/5] addFlagsFromPrBody --- .circleci/scripts/git-diff-develop.ts | 15 ++++- app/scripts/lib/setupSentry.js | 2 +- test/e2e/set-manifest-flags.ts | 82 ++++++++++++++++++++------- 3 files changed, 75 insertions(+), 24 deletions(-) diff --git a/.circleci/scripts/git-diff-develop.ts b/.circleci/scripts/git-diff-develop.ts index 9f6c8f0ae4df..3a57adaf33a9 100644 --- a/.circleci/scripts/git-diff-develop.ts +++ b/.circleci/scripts/git-diff-develop.ts @@ -104,12 +104,18 @@ async function gitDiff(): Promise { return diffResult; } +function writePrBodyToFile(prBody: string) { + const prBodyPath = path.resolve(CHANGED_FILES_DIR, 'pr-body.txt'); + fs.writeFileSync(prBodyPath, prBody.trim()); + console.log(`PR body saved to ${prBodyPath}`); +} + /** * Stores the output of git diff to a file. * * @returns Returns a promise that resolves when the git diff output is successfully stored. */ -async function storeGitDiffOutput() { +async function storeGitDiffOutputAndPrBody() { try { // Create the directory // This is done first because our CirleCI config requires that this directory is present, @@ -132,6 +138,7 @@ async function storeGitDiffOutput() { return; } else if (baseRef !== MAIN_BRANCH) { console.log(`This is for a PR targeting '${baseRef}', skipping git diff`); + writePrBodyToFile(prInfo.body); return; } @@ -142,8 +149,10 @@ async function storeGitDiffOutput() { // Store the output of git diff const outputPath = path.resolve(CHANGED_FILES_DIR, 'changed-files.txt'); fs.writeFileSync(outputPath, diffOutput.trim()); - console.log(`Git diff results saved to ${outputPath}`); + + writePrBodyToFile(prInfo.body); + process.exit(0); } catch (error: any) { console.error('An error occurred:', error.message); @@ -151,4 +160,4 @@ async function storeGitDiffOutput() { } } -storeGitDiffOutput(); +storeGitDiffOutputAndPrBody(); diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index 6e7edd04487d..2fe943cffd48 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -123,7 +123,7 @@ function getTracesSampleRate(sentryTarget) { if (flags.circleci) { // Report very frequently on develop branch, and never on other branches - // (Unless you use a `flags = {"sentry": {"tracesSampleRate": 0.1}}` override) + // (Unless you use a `flags = {"sentry": {"tracesSampleRate": x.xx}}` override) if (flags.circleci.branch === 'develop') { return 0.03; } diff --git a/test/e2e/set-manifest-flags.ts b/test/e2e/set-manifest-flags.ts index c09d69cf677e..6111ead1110d 100644 --- a/test/e2e/set-manifest-flags.ts +++ b/test/e2e/set-manifest-flags.ts @@ -10,21 +10,18 @@ function parseIntOrUndefined(value: string | undefined): number | undefined { } /** - * Grab flags from the Git message if they are set + * Search a string for `flags = {...}` and return ManifestFlags if it exists * - * To use this feature, add a line to your commit message like: - * `flags = {"sentry": {"tracesSampleRate": 0.1}}` - * (must be valid JSON) - * - * @returns flags object if found, undefined otherwise + * @param str - The string to search + * @param errorType - The type of error to log if parsing fails + * @returns The ManifestFlags object if valid, otherwise undefined */ -function getFlagsFromGitMessage(): object | undefined { - const gitMessage = execSync( - `git show --format='%B' --no-patch "HEAD"`, - ).toString(); - - // Search gitMessage for `flags = {...}` - const flagsMatch = gitMessage.match(/flags\s*=\s*(\{.*\})/u); +function regexSearchForFlags( + str: string, + errorType: string, +): ManifestFlags | undefined { + // Search str for `flags = {...}` + const flagsMatch = str.match(/flags\s*=\s*(\{.*\})/u); if (flagsMatch) { try { @@ -32,7 +29,7 @@ function getFlagsFromGitMessage(): object | undefined { return JSON.parse(flagsMatch[1]); } catch (error) { console.error( - 'Error parsing flags from git message, ignoring flags\n', + `Error parsing flags from ${errorType}, ignoring flags\n`, error, ); } @@ -41,6 +38,55 @@ function getFlagsFromGitMessage(): object | undefined { return undefined; } +/** + * Add flags from the GitHub PR body if they are set + * + * To use this feature, add a line to your PR body like: + * `flags = {"sentry": {"tracesSampleRate": 0.1}}` + * (must be valid JSON) + * + * @param flags - The flags object to add to + */ +function addFlagsFromPrBody(flags: ManifestFlags) { + let body; + + try { + body = fs.readFileSync('changed-files/pr-body.txt', 'utf8'); + } catch (error) { + console.debug('No pr-body.txt, ignoring flags'); + return; + } + + const newFlags = regexSearchForFlags(body, 'PR body'); + + if (newFlags) { + // Use lodash merge to do a deep merge (spread operator is shallow) + merge(flags, newFlags); + } +} + +/** + * Add flags from the Git message if they are set + * + * To use this feature, add a line to your commit message like: + * `flags = {"sentry": {"tracesSampleRate": 0.1}}` + * (must be valid JSON) + * + * @param flags - The flags object to add to + */ +function addFlagsFromGitMessage(flags: ManifestFlags) { + const gitMessage = execSync( + `git show --format='%B' --no-patch "HEAD"`, + ).toString(); + + const newFlags = regexSearchForFlags(gitMessage, 'git message'); + + if (newFlags) { + // Use lodash merge to do a deep merge (spread operator is shallow) + merge(flags, newFlags); + } +} + // Alter the manifest with CircleCI environment variables and custom flags export function setManifestFlags(flags: ManifestFlags = {}) { if (process.env.CIRCLECI) { @@ -55,12 +101,8 @@ export function setManifestFlags(flags: ManifestFlags = {}) { ), }; - const gitMessageFlags = getFlagsFromGitMessage(); - - if (gitMessageFlags) { - // Use lodash merge to do a deep merge (spread operator is shallow) - flags = merge(flags, gitMessageFlags); - } + addFlagsFromPrBody(flags); + addFlagsFromGitMessage(flags); } const manifest = JSON.parse( From 4a6adbabd888320f9ee5c9efa94b61cc4028a567 Mon Sep 17 00:00:00 2001 From: Howard Braham Date: Tue, 8 Oct 2024 12:52:56 -0700 Subject: [PATCH 4/5] doNotForceForThisTest -> forceEnable --- app/scripts/lib/manifestFlags.ts | 2 +- app/scripts/lib/setupSentry.js | 4 ++-- test/e2e/set-manifest-flags.ts | 8 +++++++ test/e2e/tests/metrics/errors.spec.js | 28 ++++++++++++------------- test/e2e/tests/metrics/sessions.spec.ts | 4 ++-- test/e2e/tests/metrics/traces.spec.ts | 8 +++---- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/app/scripts/lib/manifestFlags.ts b/app/scripts/lib/manifestFlags.ts index 3823319bfb71..93925bf63a0c 100644 --- a/app/scripts/lib/manifestFlags.ts +++ b/app/scripts/lib/manifestFlags.ts @@ -11,7 +11,7 @@ export type ManifestFlags = { }; sentry?: { tracesSampleRate?: number; - doNotForceForThisTest?: boolean; + forceEnable?: boolean; }; }; diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index 2fe943cffd48..d440578144cc 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -238,7 +238,7 @@ function getSentryEnvironment() { function getSentryTarget() { if ( - getManifestFlags().sentry?.doNotForceForThisTest || + !getManifestFlags().sentry?.forceEnable || (process.env.IN_TEST && !SENTRY_DSN_DEV) ) { return SENTRY_DSN_FAKE; @@ -272,7 +272,7 @@ async function getMetaMetricsEnabled() { if ( METAMASK_BUILD_TYPE === 'mmi' || - (flags.circleci && !flags.sentry?.doNotForceForThisTest) + (flags.circleci && flags.sentry.forceEnable) ) { return true; } diff --git a/test/e2e/set-manifest-flags.ts b/test/e2e/set-manifest-flags.ts index 6111ead1110d..290e8b863a9e 100644 --- a/test/e2e/set-manifest-flags.ts +++ b/test/e2e/set-manifest-flags.ts @@ -103,6 +103,14 @@ export function setManifestFlags(flags: ManifestFlags = {}) { addFlagsFromPrBody(flags); addFlagsFromGitMessage(flags); + + // Set `flags.sentry.forceEnable` to true by default + if (flags.sentry === undefined) { + flags.sentry = {}; + } + if (flags.sentry.forceEnable === undefined) { + flags.sentry.forceEnable = true; + } } const manifest = JSON.parse( diff --git a/test/e2e/tests/metrics/errors.spec.js b/test/e2e/tests/metrics/errors.spec.js index 5dac134bd4e5..dfe77f758fcb 100644 --- a/test/e2e/tests/metrics/errors.spec.js +++ b/test/e2e/tests/metrics/errors.spec.js @@ -247,7 +247,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryMigratorError, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -278,7 +278,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryTestError, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -319,7 +319,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryMigratorError, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -365,7 +365,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryMigratorError, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -426,7 +426,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryInvariantMigrationError, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -475,7 +475,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -521,7 +521,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -585,7 +585,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryTestError, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -621,7 +621,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -656,7 +656,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryTestError, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -702,7 +702,7 @@ describe('Sentry errors', function () { title: this.test.fullTitle(), testSpecificMock: mockSentryTestError, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, ganacheServer, mockedEndpoint }) => { @@ -766,7 +766,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -810,7 +810,7 @@ describe('Sentry errors', function () { testSpecificMock: mockSentryTestError, ignoredConsoleErrors: ['TestError'], manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, ganacheServer, mockedEndpoint }) => { @@ -898,7 +898,7 @@ describe('Sentry errors', function () { ganacheOptions, title: this.test.fullTitle(), manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver }) => { diff --git a/test/e2e/tests/metrics/sessions.spec.ts b/test/e2e/tests/metrics/sessions.spec.ts index 09786a8f6591..7c79e5510116 100644 --- a/test/e2e/tests/metrics/sessions.spec.ts +++ b/test/e2e/tests/metrics/sessions.spec.ts @@ -38,7 +38,7 @@ describe('Sessions', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentrySession, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -60,7 +60,7 @@ describe('Sessions', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentrySession, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { diff --git a/test/e2e/tests/metrics/traces.spec.ts b/test/e2e/tests/metrics/traces.spec.ts index fc5251bf659f..9166281f90e5 100644 --- a/test/e2e/tests/metrics/traces.spec.ts +++ b/test/e2e/tests/metrics/traces.spec.ts @@ -51,7 +51,7 @@ describe('Traces', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentryCustomTrace, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -73,7 +73,7 @@ describe('Traces', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentryCustomTrace, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -95,7 +95,7 @@ describe('Traces', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentryAutomatedTrace, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { @@ -117,7 +117,7 @@ describe('Traces', function () { title: this.test?.fullTitle(), testSpecificMock: mockSentryAutomatedTrace, manifestFlags: { - sentry: { doNotForceForThisTest: true }, + sentry: { forceEnable: false }, }, }, async ({ driver, mockedEndpoint }) => { From 2d953bfb29dc71921cbbff87106021b76c09b891 Mon Sep 17 00:00:00 2001 From: Howard Braham Date: Tue, 8 Oct 2024 14:02:00 -0700 Subject: [PATCH 5/5] minor JSDoc change --- .circleci/scripts/git-diff-develop.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/scripts/git-diff-develop.ts b/.circleci/scripts/git-diff-develop.ts index 3a57adaf33a9..43435db17418 100644 --- a/.circleci/scripts/git-diff-develop.ts +++ b/.circleci/scripts/git-diff-develop.ts @@ -111,9 +111,9 @@ function writePrBodyToFile(prBody: string) { } /** - * Stores the output of git diff to a file. + * Main run function, stores the output of git diff and the body of the matching PR to a file. * - * @returns Returns a promise that resolves when the git diff output is successfully stored. + * @returns Returns a promise that resolves when the git diff output and PR body is successfully stored. */ async function storeGitDiffOutputAndPrBody() { try {