-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: Auto detect build artifacts #257
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's a risky change but the implementation makes sense to me. Nevertheless, I think we should cover this with at least one integration or e2e test, wdyt?
|
||
if (Array.isArray(assets) && assets.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is assets
always normalized to an array? otherwise, what about assets: ""
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought process here was to just skip uploading entirely when users provide an empty array (as a means of disabling I guess). An empty string is more or less user error which we don't care to catch here. I think this will be implicitly caught by the glob pattern not finding anything and the message below then saying "check your assets option".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good point. At the time of writing I thought for some reason an empty array and an empty string the same semantic implications here but you're right, an empty string looks more like an error than an empty array.
debugIdChunkFilePath.endsWith(".cjs") | ||
); | ||
const debugIdChunkFilePaths = ( | ||
await glob(assets ?? buildArtifactPaths, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a log that we're using the auto-determined paths if we fall back to buildArtifactPaths
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug or info level?
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
Will auto detect build artifacts based on the information bundlers provide in the build end hooks - making the
assets
option optional.Risky change incoming.