Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix the release string

Manav Rathi54cbbfb72268
diff --git a/apps/photos/sentry.edge.config.ts b/apps/photos/sentry.edge.config.ts
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/packages/shared/next/next.config.base.js b/packages/shared/next/next.config.base.js
index 69ede58e11..8200c2a3ce 100644
--- a/packages/shared/next/next.config.base.js
+++ b/packages/shared/next/next.config.base.js
@@ -1,4 +1,10 @@
const { withSentryConfig } = require('@sentry/nextjs');
+const cp = require('child_process');
+
+const gitSHA = cp.execSync('git rev-parse --short HEAD', {
+ cwd: __dirname,
+ encoding: 'utf8',
+});
const nextConfig = {
compiler: {
@@ -37,15 +43,19 @@ const nextConfig = {
};
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
-const createSentryWebpackPluginOptions = () => {
- return {
- // dryRun: phase === PHASE_DEVELOPMENT_SERVER,
- // release: gitSHA,
- };
+const sentryWebpackPluginOptions = {
+ // Sentry supports automatically deducing this, and if running the
+ // sentry-cli release propose-version command directly, it can indeed find
+ // the git SHA, but I've been unable to get that to work here without
+ // explicitly specifying the git SHA.
+ release: gitSHA,
};
// withSentryConfig extends the default Next.js usage of webpack to
// 1. Initialize the SDK on client page load (`sentry.client.config.ts`)
-// 2. Upload sourcemaps (using the settings defined in `.sentryclirc`)
-module.exports = (phase) =>
- withSentryConfig(nextConfig, createSentryWebpackPluginOptions(phase));
+// 2. Upload sourcemaps (using the settings defined in `sentry.properties`)
+//
+// Irritatingly, it insists that we also provide it (empty)
+// sentry.server.config.ts and sentry.edge.config.ts files too, even though we
+// are not using those parts.
+module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions);