Skip to content
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

ref(core): Use Sentry CLI for artifact deletion #92

Merged
merged 1 commit into from Nov 8, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 7, 2022

Replace previous custom implementation with Sentry CLI logic analogously to the webpack plugin

ref: #85

@Lms24 Lms24 mentioned this pull request Nov 7, 2022
4 tasks
const span = addSpanToTransaction(ctx, "function.plugin.clean_artifacts");

if (options.cleanArtifacts) {
// TODO: pull these checks out of here and simplify them
if (options.authToken === undefined) {
ctx.logger.warn('Missing "authToken" option. Will not clean existing artifacts.');
return Promise.resolve("nothing to do here");
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: really feels like this should be abstracted out - perhaps into an array that gets iterated on (we can then even validate this with types)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, agreed, this is terrible right now. We have the same block in many of the release creation steps. My plan was to move these to one validation step when converting user-facing to internal options. So ideally, in this release pipeline, we don't have to do any validation anymore. I'll leave this as-is for now and add a point to #91

sentryHub: ctx.hub,
customHeader: options.customHeader,
});
await ctx.cli.releases.execute(["releases", "files", options.release, "delete", "--all"], true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surprised this doesn't have a return value

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lms24 Lms24 requested a review from mydea November 8, 2022 10:30
@Lms24 Lms24 merged commit 6a30140 into main Nov 8, 2022
@Lms24 Lms24 deleted the lms-cli-cleanArtifacts branch November 8, 2022 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants