-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: run pushed monitors locally in dry-run mode #991
Conversation
@@ -106,7 +126,6 @@ export async function push(monitors: Monitor[], options: PushOptions) { | |||
} | |||
|
|||
if (removedIDs.size > 0) { | |||
log(`deleting monitor ids: ${Array.from(removedIDs.keys()).join(', ')}`); |
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.
covered by the logGroups
@@ -148,6 +151,15 @@ export async function buildMonitorSchema(monitors: Monitor[], isV2: boolean) { | |||
monitor.setContent(content); | |||
Object.assign(schema, { content, filter }); | |||
} | |||
const size = monitor.size(); |
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.
SIZE_LIMIT_KB
description specifies this is gzipped, whereas monitor.size()
is not, maybe we should align the description
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.
It is though, the content extracted is the gzipped size of the monitor. Can you give me hint on where we should align it?
let outer = bold(`Aborted: Bundled code ${sizeKB}kB exceeds the recommended ${SIZE_LIMIT_KB}kB limit. Please check the dependencies imported.\n`); | ||
const inner = `* ${config.id} - ${source.file}:${source.line}:${source.column}\n`; | ||
outer += indent(inner); | ||
throw red(outer); |
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.
It might be better DX if we iterate through all monitors and collect all errors before pushing so that we report all at once, instead of just the first, wdyt?
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.
I thought about it, But it might cause the errors to be not meaningful if user decides to pull in a dep like playwright-core
etc which would get included across all journeys if it was in a helper library (common case in ecp). Throwing it away first avoids those issues. This is why we also kept it this way from the beginning.
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.
LGTM
DEBUG=synthetics
will provides detailed information like Monitor size, overall project size and monitors that were added/deleted/updated etc.--dry-run
, we have the ability to now run these monitors similar to how it would be run inside the Synthetics Public/Private managed locations.