fix: Updated Android debug symbol upload #1995
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Working on improving CI last week had me scratch my head with what's going on with out build logs when targeting Android. Same while dogfooding sentry-defenses today.
Missing logs in CI
In CI, when Android builds fail, the gradle build logs would point me towards a logfile (that obviously was not getting uploaded). Breaking builds with no logs is a complete waste of time.
Cause
We're exclusively pipe the logs into a logfile to have them available for diagnostics outside of the editor console.
Fix
Using the
TeeOutputStream
we can still write to the logfile - to have it available during trouble shooting outside of running the editor - and still leave the gradle build logs intact.We can also remove the
PostBuildCheck
that validated the CLI logs and now we don't need to unnecessarily dump the logs in the editor console. Because we're leaving the build logs intact, Unity correctly picks up the failed task and prints it for us. I.e. a build with an invalid auth-token:Replaced
Ignore CLI Errors
hackinessWe're providing a
Ignore CLI Errors
checkbox on the upload options that only applies to Android right now.Cause
When this was added,
Sentry CLI
did not provide a--allow-failure
yet and we've had numerous user reporting their builds getting stuck in CI with no way forward. We've wrapped the uploadexec
in a try-catch and validated the output by parsing the logfile.Fix
We're getting rid of the
try-catch
and pass the--allow-failure
flag to the exec instead. This makes the task a lot less complex and easier to reason. Additionally, we've logging a big fat warning when users are using this flag as it's potentially a mayor footgun.The new gradle task for uploading debug symbols and proguard mappings looks like this: