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

Narrow the default path searched for debug files #290

Open
szokeasaurusrex opened this issue Jan 7, 2025 · 6 comments
Open

Narrow the default path searched for debug files #290

szokeasaurusrex opened this issue Jan 7, 2025 · 6 comments

Comments

@szokeasaurusrex
Copy link
Member

The sentry_debug_files_upload function passes . as the path to the sentry-cli debug-files upload command, unless the user supplies the path parameter. This causes sentry-cli to search the entire project for debug files, which is potentially a waste of time if we search a bunch of directories which we know don't have debug files in them, and can also cause errors if we encounter an error while reading any of the files that we are searching (which is desirable if those turn out to be debug files, but undesirable if we know that these files are definitely not debug files). For instance, if a project contains some intentionally corrupted zip files used for testing, these would cause Sentry CLI to fail.

Instead of passing . as the default path, we should pass the narrowest path that we can. I'm not super familiar with the types of projects that Fastlane is used for, but if there is always some directory which contains the debug files, we should pass this directory.

If there is not a consistent location where the debug files are stored in Fastlane projects, then we should urge users to use the path argument to supply a narrow path to their debug files, and we should deprecate the default option, making it required to provide a path from the next major release.

@szokeasaurusrex
Copy link
Member Author

This issue is closely related to #277, implementing the narrower path may even resolve the problem that user was having

@Mordil
Copy link

Mordil commented Jan 7, 2025

It might be good to also provide a filter of which files to exclude from scan results, as that would be easier for us than specifying a path altogether

@szokeasaurusrex
Copy link
Member Author

@Mordil your suggestion has already been raised in #277

@philprime
Copy link

philprime commented Jan 8, 2025

When bundling an app for distribution, the first step is creating an Xcode Archive (.xcarchive). The action ipa then uses that archive to generate an iOS app bundle (.ipa) with the debug symbols .dSYM as a side product.

fastlane actions can change shared values in the lane context.
The path to the .ipa and the .dSYM are set to the context variables with the keys SharedValues::IPA_OUTPUT_PATH and the SharedValues::DSYM_OUTPUT_PATH and also the ENV.

Any fastlane action running afterwards will be able to access these shared values using Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]. If it isn't set, it will just be set to null, and we need to fallback to default search logic.

The same goes for the command build_app:

https://github.com/fastlane/fastlane/blob/400f21481aa1b0331b5407e5c4f125ce4b217874/fastlane/lib/fastlane/actions/build_app.rb#L93-L96

On a side-note, this is how they find the debug symbols archive in the action ipa:

https://github.com/fastlane/fastlane/blob/400f21481aa1b0331b5407e5c4f125ce4b217874/fastlane/lib/fastlane/actions/ipa.rb#L131-L134

The deprecated fastlane action upload_symbols_to_sentry already used the context value as the default value for the action option:

https://github.com/fastlane/fastlane/blob/400f21481aa1b0331b5407e5c4f125ce4b217874/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb#L108-L113

Other actions are also using this variable:

Using this context variable could be a good first step to narrow down the lookup path to debug symbols

@philprime
Copy link

Changing the lookup behavior could break for customers relying on current implementation.
This will require a new major and we should offer an option to fallback to current lookup logic.

To fix the issue in a minor we can add the logic and allow enabling it with an option/feature flag, which will be the default in the next major.

@philprime philprime moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Jan 8, 2025
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants