Skip to content

Commit 91a19a8

Browse files
committed
disable uploading source maps for deploying single function
Because serverless/serverless#11179 is taking longer to address it's safer to disable this functionality to avoid UX degradation. It's very annoying to see `sls deploy function` failure, much better to have function code actually deployed, but with warning.
1 parent 8c60ea5 commit 91a19a8

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

dist/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ export declare class SentryPlugin implements Plugin {
6060
sentry: Partial<SentryOptions>;
6161
serverless: Serverless;
6262
options: Serverless.Options;
63+
logging: Plugin.Logging;
6364
custom: Service.Custom;
6465
hooks: {
6566
[event: string]: (...rest: any[]) => any;
6667
};
6768
provider: Aws;
6869
validated: boolean;
6970
isInstrumented: boolean;
70-
constructor(serverless: Serverless, options: Serverless.Options);
71+
constructor(serverless: Serverless, options: Serverless.Options, logging: Plugin.Logging);
7172
configPlugin(): void;
7273
validate(): Promise<void>;
7374
instrumentFunction(originalDefinition: Serverless.FunctionDefinition, setEnv: boolean): FunctionDefinitionWithSentry;

dist/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ var _e = encodeURIComponent;
6161
* Serverless Plugin forward Lambda exceptions to Sentry (https://sentry.io)
6262
*/
6363
var SentryPlugin = /** @class */ (function () {
64-
function SentryPlugin(serverless, options) {
64+
function SentryPlugin(serverless, options, logging) {
6565
var _this = this;
6666
this.serverless = serverless;
6767
this.options = options;
68+
this.logging = logging;
6869
this.custom = this.serverless.service.custom;
6970
this.provider = this.serverless.getProvider("aws");
7071
// Create schema for our properties. For reference use https://github.com/ajv-validator/ajv
@@ -179,11 +180,13 @@ var SentryPlugin = /** @class */ (function () {
179180
case 0: return [4 /*yield*/, this.createSentryRelease()];
180181
case 1:
181182
_a.sent();
182-
return [4 /*yield*/, this.uploadSentrySourcemaps()];
183-
case 2:
184-
_a.sent();
183+
// uploading sentry source maps doesn't work for "deploy function" command #67
184+
// TODO to add proper fix once it's addressed on serverless-core https://github.com/serverless/serverless/issues/11179
185+
this.logging.log.warning('Uploading source maps is skipped for "deploy function" because it is not working');
186+
// await this.uploadSentrySourcemaps();
185187
return [4 /*yield*/, this.deploySentryRelease()];
186-
case 3:
188+
case 2:
189+
// await this.uploadSentrySourcemaps();
187190
_a.sent();
188191
return [2 /*return*/];
189192
}

src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,17 @@ export class SentryPlugin implements Plugin {
8080
sentry: Partial<SentryOptions>;
8181
serverless: Serverless;
8282
options: Serverless.Options;
83+
logging: Plugin.Logging;
8384
custom: Service.Custom;
8485
hooks: { [event: string]: (...rest: any[]) => any };
8586
provider: Aws;
8687
validated: boolean;
8788
isInstrumented: boolean;
8889

89-
constructor(serverless: Serverless, options: Serverless.Options) {
90+
constructor(serverless: Serverless, options: Serverless.Options, logging: Plugin.Logging) {
9091
this.serverless = serverless;
9192
this.options = options;
93+
this.logging = logging;
9294
this.custom = this.serverless.service.custom;
9395
this.provider = this.serverless.getProvider("aws");
9496

@@ -162,7 +164,10 @@ export class SentryPlugin implements Plugin {
162164

163165
"after:deploy:function:deploy": async () => {
164166
await this.createSentryRelease();
165-
await this.uploadSentrySourcemaps();
167+
// uploading sentry source maps doesn't work for "deploy function" command #67
168+
// TODO to add proper fix once it's addressed on serverless-core https://github.com/serverless/serverless/issues/11179
169+
this.logging.log.warning('Uploading source maps is skipped for "deploy function" because it is not working');
170+
// await this.uploadSentrySourcemaps();
166171
await this.deploySentryRelease();
167172
},
168173

0 commit comments

Comments
 (0)