sentry-cli icon indicating copy to clipboard operation
sentry-cli copied to clipboard

Allow specifying ignore globs to `debug-files upload`

Open JohnnyMorganz opened this issue 7 months ago • 3 comments

Problem Statement

Using sentry-cli debug-files upload <build output directory> is really neat to easily scan and upload any relevant debug information in the build output directory. However, there are some known folders in build output directory I want to skip because they are unnecessary (e.g. CMakeFiles/ or extern/).

Currently, the alternative is to manually specify the path to the files, but we lose out on the ease the auto-lookup provides

Solution Brainstorm

Accept an --ignore flag (like sourcemaps upload already supports)

JohnnyMorganz avatar May 12 '25 20:05 JohnnyMorganz

Hey, thanks for the feature request. We can consider adding this, although I will say that my recommendation is to pass the narrowest path that you know contains all the necessary debug files, rather than passing a higher-level directory and relying on the Sentry CLI to search for debug files.

The reason is that we search very broadly for debug files, through all subdirectories and even through zip files, and if there is any error reading any subdirectory, Sentry CLI will error and fail your build. We have had folks run into difficult-to-debug issues because of this before, so I'd highly recommend passing only the specific directories which contain debug files you'd like to upload.

We can add the --ignore argument if that doesn't work for you

szokeasaurusrex avatar May 13 '25 10:05 szokeasaurusrex

Thank you for the tool :). That makes sense. Tbh, the feature request mainly came out from my laziness :P, my build output dir structure is different per platform and it was nice to see the CLI just automatically pick up everything I needed w/o any platform-specific tweaks to paths. The output folder is fairly small so didn't seem too bad to just let it recursively check everything, it's only picking a couple of unnecessary extern files so I wanted to ignore those.

In any case, I should be able to work around it for now by just being more explicit. Thanks!

JohnnyMorganz avatar May 13 '25 16:05 JohnnyMorganz

Okay, I'll add this issue to our internal backlog, but since you're able to work around this issue, I will set it at low priority for now.

If we see more interest from users in adding this feature, we can increase priority.

szokeasaurusrex avatar May 14 '25 12:05 szokeasaurusrex