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

Improve Gradle command error messages #99

Merged
merged 13 commits into from
Jul 4, 2023
Merged

Improve Gradle command error messages #99

merged 13 commits into from
Jul 4, 2023

Conversation

godrei
Copy link
Contributor

@godrei godrei commented Jun 30, 2023

Checklist

  • I've read and followed the Contribution Guidelines
  • step.yml and README.md is updated with the changes (if needed)

Version

Requires a MINOR version update

Context

This PR improves the error messages logged by the Step. Currently, the step prints the whole output of the gradle dependencies command into the error message, which makes it noisy.
The primary goal was logging relevant messages when gradle dependencies fails.

Resolves: https://bitrise.atlassian.net/browse/BIVS-1951

Changes

  • Create dedicated error structs for gradle dependencies command-related errors, to standardize command failure errors
  • gradle dependencies command's stderr is used as a failure reason
  • Split the main func into AndroidToolsInstaller.ProcessInputs and AndroidToolsInstaller.Run and wire in formatted error messages

Investigation details

Initially, I started by writing a custom parser to gather relevant details from the Gradle command execution output, but it turned out Gradle prints the failure reason to the stderr.

Decisions

gradle dependencies command's stderr might contain a stacktrace, which can be a long message. We might consider truncating it, in the future if it causes too much noise in the error messages.

@godrei godrei changed the title Gradle errors 3 Improve Gradle command error messages Jul 3, 2023
@godrei godrei marked this pull request as ready for review July 3, 2023 07:44
@godrei godrei merged commit 2d89aef into master Jul 4, 2023
@godrei godrei deleted the gradle-errors-3 branch July 4, 2023 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants