-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix(sourcebundles): Skip invalid sources #861
Conversation
186ea0a
to
639fcc3
Compare
639fcc3
to
04d9e2a
Compare
Hmm, it would be nice to note the file being skipped at least in the debug logs. I fear I might have some leftover source files that might actually have some singular improper UTF-8 inserted due to copy-paste, as was the case a single time in the past, and then such a .cpp file would be silently skipped without any way of ever knowing... |
Unfortunately, we do not really have a good story around surfacing these errors as warnings, but I do agree that silently skipping these files might not be the best solution here. |
I can actually imagine why putting them as warnings wouldn't be desirable (potential huge spam). But in opt-in debug-level log why not? I'm not sure if there's really any other convenient way to figure out which files are causing these problems, and I'm curious if it just picks up something else, or if there's some problem in one of actual source code files (we had a situation like that before where compiler would yield a warning about invalid UTF-8 sequence copy-pasted somewhere, which is why I'm so curious...). |
@loewenheim @Swatinem would it perhaps be possible to return a list of all the files we had to skip over due to encoding failures? Then, the calling code (in this case, Sentry CLI) could decide how to handle these (warn, error, etc). |
I think that sounds reasonable, but I believe that also requires breaking changes in symbolic. |
Yeah, that was my concern. We could always introduce a new variant of |
I would go with that option then, yeah. |
@p0358 we are going to work on getting this logging to work in separate issues: #863 and getsentry/sentry-cli#2135 |
* feat(sourcebundle): Add callback to handle skipped files Add a callback to SourceBundleWriter that is called every time we skip adding a file to the bundle due to a ReadFailed error. Closes #863 * fix(sourcebundle): Skip all invalid sources #861 missed another spot where the ReadFailed error can cause the write function to fail; this commit fixes that. Fixes #860 * meta: Update changelog * apply suggestions from code review Co-authored-by: Jan Michael Auer <jan.auer@sentry.io> --------- Co-authored-by: Jan Michael Auer <jan.auer@sentry.io>
Fixes #860