MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / checkLogsForWarnings

Function checkLogsForWarnings

packages/cli-v3/src/commands/deploy.ts:571–618  ·  view source on GitHub ↗
(logs: string)

Source from the content-addressed store, hash-verified

569
570// Try to extract useful warnings from logs. Sometimes we may even want to fail the build. This won't work if the step is cached.
571function checkLogsForWarnings(logs: string): WarningsCheckReturn {
572 const warnings: LogParserOptions = [
573 {
574 regex: /prisma:warn We could not find your Prisma schema/,
575 message: `Prisma generate failed to find the default schema. Did you include it in config.additionalFiles? ${terminalLink(
576 "Config docs",
577 docs.config.prisma
578 )}\nCustom schema paths require a postinstall script like this: \`prisma generate --schema=./custom/path/to/schema.prisma\``,
579 shouldFail: true,
580 },
581 ];
582
583 const errorMessages: string[] = [];
584 const warningMessages: string[] = [];
585
586 let shouldFail = false;
587
588 for (const warning of warnings) {
589 const matches = logs.match(warning.regex);
590
591 if (!matches) {
592 continue;
593 }
594
595 const message = getMessageFromTemplate(warning.message, matches.groups);
596
597 if (warning.shouldFail) {
598 shouldFail = true;
599 errorMessages.push(message);
600 } else {
601 warningMessages.push(message);
602 }
603 }
604
605 if (shouldFail) {
606 return {
607 ok: false,
608 summary: "Build succeeded with critical warnings. Will not proceed",
609 warnings: warningMessages,
610 errors: errorMessages,
611 };
612 }
613
614 return {
615 ok: true,
616 warnings: warningMessages,
617 };
618}
619
620// Try to extract useful error messages from the logs
621function checkLogsForErrors(logs: string) {

Callers 1

_deployCommandFunction · 0.85

Calls 1

getMessageFromTemplateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…