From 1b732e5d4daad2d913591e67abb18920c12826fb Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Tue, 22 Oct 2024 11:00:59 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20cron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/next.config.js | 54 ++++++++++++---------- apps/web/src/app/api/checker/cron/_cron.ts | 14 +++--- packages/db/package.json | 2 +- pnpm-lock.yaml | 12 ++--- 4 files changed, 43 insertions(+), 39 deletions(-) diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 370b5dfa75..a50f7c5ecb 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -6,12 +6,15 @@ const nextConfig = { swcMinify: true, transpilePackages: ["@openstatus/ui", "@openstatus/api"], experimental: { + outputFileTracingIncludes: { + '/': ['./node_modules/@google-cloud/tasks/build/esm/src/**/*.json'], + }, serverComponentsExternalPackages: [ // "libsql", // "@libsql", "@react-email/components", "@react-email/render", - "@google-cloud/tasks", + // "@google-cloud/tasks", // "@libsql/client", // "@libsql/hrana-client", // "better-sqlite3" @@ -48,36 +51,37 @@ const nextConfig = { }, }; +module.exports = withContentlayer(nextConfig); // Injected content via Sentry wizard below -const { withSentryConfig } = require("@sentry/nextjs"); +// const { withSentryConfig } = require("@sentry/nextjs"); -module.exports = withSentryConfig( - withContentlayer(nextConfig), - { - // For all available options, see: - // https://github.com/getsentry/sentry-webpack-plugin#options +// module.exports = withSentryConfig( +// withContentlayer(nextConfig), +// { +// // For all available options, see: +// // https://github.com/getsentry/sentry-webpack-plugin#options - // Suppresses source map uploading logs during build - silent: true, +// // Suppresses source map uploading logs during build +// silent: true, - org: "openstatus", - project: "openstatus", - }, - { - // For all available options, see: - // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ +// org: "openstatus", +// project: "openstatus", +// }, +// { +// // For all available options, see: +// // // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ - // Upload a larger set of source maps for prettier stack traces (increases build time) - widenClientFileUpload: true, +// // // Upload a larger set of source maps for prettier stack traces (increases build time) +// // widenClientFileUpload: true, - // Transpiles SDK to be compatible with IE11 (increases bundle size) - transpileClientSDK: false, +// // // Transpiles SDK to be compatible with IE11 (increases bundle size) +// // transpileClientSDK: false, - // Hides source maps from generated client bundles - hideSourceMaps: true, +// // // Hides source maps from generated client bundles +// // hideSourceMaps: true, - // Automatically tree-shake Sentry logger statements to reduce bundle size - disableLogger: true, - }, -); +// // // Automatically tree-shake Sentry logger statements to reduce bundle size +// // disableLogger: true, +// }, +// ); diff --git a/apps/web/src/app/api/checker/cron/_cron.ts b/apps/web/src/app/api/checker/cron/_cron.ts index 6ca1daf89c..6f10b87b5d 100644 --- a/apps/web/src/app/api/checker/cron/_cron.ts +++ b/apps/web/src/app/api/checker/cron/_cron.ts @@ -45,7 +45,7 @@ export const cron = async ({ const parent = client.queuePath( env.GCP_PROJECT_ID, env.GCP_LOCATION, - periodicity, + periodicity ); const timestamp = Date.now(); @@ -54,7 +54,7 @@ export const cron = async ({ .select({ id: maintenance.id }) .from(maintenance) .where( - and(lte(maintenance.from, new Date()), gte(maintenance.to, new Date())), + and(lte(maintenance.from, new Date()), gte(maintenance.to, new Date())) ) .as("currentMaintenance"); @@ -63,7 +63,7 @@ export const cron = async ({ .from(maintenancesToMonitors) .innerJoin( currentMaintenance, - eq(maintenancesToMonitors.maintenanceId, currentMaintenance.id), + eq(maintenancesToMonitors.maintenanceId, currentMaintenance.id) ); const result = await db @@ -73,8 +73,8 @@ export const cron = async ({ and( eq(monitor.periodicity, periodicity), eq(monitor.active, true), - notInArray(monitor.id, currentMaintenanceMonitors), - ), + notInArray(monitor.id, currentMaintenanceMonitors) + ) ) .all(); @@ -98,7 +98,7 @@ export const cron = async ({ const monitorStatus = z.array(selectMonitorStatusSchema).safeParse(result); if (!monitorStatus.success) { console.error( - `Error while fetching the monitor status ${monitorStatus.error.errors}`, + `Error while fetching the monitor status ${monitorStatus.error.errors}` ); continue; } @@ -137,7 +137,7 @@ export const cron = async ({ const failed = allRequests.filter((r) => r.status === "rejected").length; console.log( - `End cron for ${periodicity} with ${allResult.length} jobs with ${success} success and ${failed} failed`, + `End cron for ${periodicity} with ${allResult.length} jobs with ${success} success and ${failed} failed` ); }; // timestamp needs to be in ms diff --git a/packages/db/package.json b/packages/db/package.json index 01a614f690..ca93b0d4ec 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -25,7 +25,7 @@ "@types/node": "20.8.0", "better-sqlite3": "11.4.0", "bufferutil": "4.0.8", - "drizzle-kit": "0.26.1", + "drizzle-kit": "0.26.2", "encoding": "0.1.13", "next-auth": "5.0.0-beta.17", "typescript": "5.5.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66ebbad839..25beb4374a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -582,8 +582,8 @@ importers: specifier: 4.0.8 version: 4.0.8 drizzle-kit: - specifier: 0.26.1 - version: 0.26.1 + specifier: 0.26.2 + version: 0.26.2 encoding: specifier: 0.1.13 version: 0.1.13 @@ -6066,8 +6066,8 @@ packages: resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} engines: {node: '>=12'} - drizzle-kit@0.26.1: - resolution: {integrity: sha512-5/e1tzOPicPDooCm/uJIU9mWK3eD5dhW5EY61TQyVVo29xYxFLmZpXlBdOYlbfDHBsNhVzhb0XjWFmAAj7d7WA==} + drizzle-kit@0.26.2: + resolution: {integrity: sha512-cMq8omEKywjIy5KcqUo6LvEFxkl8/zYHsgYjFVXjmPWWtuW4blcz+YW9+oIhoaALgs2ebRjzXwsJgN9i6P49Dw==} hasBin: true drizzle-orm@0.35.3: @@ -15956,7 +15956,7 @@ snapshots: dotenv@16.3.1: {} - drizzle-kit@0.26.1: + drizzle-kit@0.26.2: dependencies: '@drizzle-team/brocli': 0.10.1 '@esbuild-kit/esm-loader': 2.6.5 @@ -20915,7 +20915,7 @@ snapshots: yargs@17.7.2: dependencies: cliui: 8.0.1 - escalade: 3.1.1 + escalade: 3.1.2 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 From a724a214e826e33e3e3760297f392cb2e0aa3a8a Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:02:18 +0000 Subject: [PATCH 2/2] ci: apply automated fixes --- apps/web/next.config.js | 2 +- apps/web/src/app/api/checker/cron/_cron.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/web/next.config.js b/apps/web/next.config.js index a50f7c5ecb..0ce240301a 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -7,7 +7,7 @@ const nextConfig = { transpilePackages: ["@openstatus/ui", "@openstatus/api"], experimental: { outputFileTracingIncludes: { - '/': ['./node_modules/@google-cloud/tasks/build/esm/src/**/*.json'], + "/": ["./node_modules/@google-cloud/tasks/build/esm/src/**/*.json"], }, serverComponentsExternalPackages: [ // "libsql", diff --git a/apps/web/src/app/api/checker/cron/_cron.ts b/apps/web/src/app/api/checker/cron/_cron.ts index 6f10b87b5d..6ca1daf89c 100644 --- a/apps/web/src/app/api/checker/cron/_cron.ts +++ b/apps/web/src/app/api/checker/cron/_cron.ts @@ -45,7 +45,7 @@ export const cron = async ({ const parent = client.queuePath( env.GCP_PROJECT_ID, env.GCP_LOCATION, - periodicity + periodicity, ); const timestamp = Date.now(); @@ -54,7 +54,7 @@ export const cron = async ({ .select({ id: maintenance.id }) .from(maintenance) .where( - and(lte(maintenance.from, new Date()), gte(maintenance.to, new Date())) + and(lte(maintenance.from, new Date()), gte(maintenance.to, new Date())), ) .as("currentMaintenance"); @@ -63,7 +63,7 @@ export const cron = async ({ .from(maintenancesToMonitors) .innerJoin( currentMaintenance, - eq(maintenancesToMonitors.maintenanceId, currentMaintenance.id) + eq(maintenancesToMonitors.maintenanceId, currentMaintenance.id), ); const result = await db @@ -73,8 +73,8 @@ export const cron = async ({ and( eq(monitor.periodicity, periodicity), eq(monitor.active, true), - notInArray(monitor.id, currentMaintenanceMonitors) - ) + notInArray(monitor.id, currentMaintenanceMonitors), + ), ) .all(); @@ -98,7 +98,7 @@ export const cron = async ({ const monitorStatus = z.array(selectMonitorStatusSchema).safeParse(result); if (!monitorStatus.success) { console.error( - `Error while fetching the monitor status ${monitorStatus.error.errors}` + `Error while fetching the monitor status ${monitorStatus.error.errors}`, ); continue; } @@ -137,7 +137,7 @@ export const cron = async ({ const failed = allRequests.filter((r) => r.status === "rejected").length; console.log( - `End cron for ${periodicity} with ${allResult.length} jobs with ${success} success and ${failed} failed` + `End cron for ${periodicity} with ${allResult.length} jobs with ${success} success and ${failed} failed`, ); }; // timestamp needs to be in ms