Skip to content

Reduce verbose logging on generic command failure #8904

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

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions readthedocs/doc_builder/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,24 +444,21 @@ def run_command_class(
self.commands.append(build_cmd)

if build_cmd.failed:
msg = 'Command {cmd} failed'.format(cmd=build_cmd.get_command())

# TODO: improve this error report. This is showing _the full_
# stdout to the user exposing it at the top of the Build Detail's
# page in red. It would be good to reduce the noise here and just
# point the user to take a look at its output from the command's
# output itself.
if build_cmd.output:
msg += ':\n{out}'.format(out=build_cmd.output)

if warn_only:
msg = 'Command {cmd} failed'.format(cmd=build_cmd.get_command())
if build_cmd.output:
msg += ':\n{out}'.format(out=build_cmd.output)
log.warning(
msg,
project_slug=self.project.slug if self.project else '',
version_slug=self.version.slug if self.version else '',
)
else:
raise BuildUserError(msg)
# TODO: for now, this still outputs a generic error message
# that is the same across all commands. We could improve this
# with more granular error messages that vary by the command
# being run.
raise BuildUserError()
return build_cmd


Expand Down