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

feat: Refine the Atlantis Info Message Logging #5034

Merged
merged 14 commits into from
Nov 19, 2024
Prev Previous commit
Next Next commit
Merge branch 'main' into logging-refinement
Signed-off-by: Simon Heather <[email protected]>
X-Guardian authored Nov 5, 2024
commit 12e6b238cfc384c6b9a82d969d4572b62b332d76
6 changes: 4 additions & 2 deletions server/core/runtime/models/shell_command_runner.go
Original file line number Diff line number Diff line change
@@ -173,11 +173,13 @@ func (s *ShellCommandRunner) RunCommandAsync(ctx command.ProjectContext) (chan<-

// We're done now. Send an error if there was one.
if err != nil {
err = errors.Wrapf(err, "running '%s' in '%s'", s.command, s.workingDir)
err = errors.Wrapf(err, "running '%s %s' in '%s'",
s.shell.String(), s.command, s.workingDir)
log.Err(err.Error())
outCh <- Line{Err: err}
} else {
log.Info("Successfully ran '%s' in '%s'", s.command, s.workingDir)
log.Info("successfully ran '%s %s' in '%s'",
s.shell.String(), s.command, s.workingDir)
}
}()

2 changes: 1 addition & 1 deletion server/core/terraform/terraform_client_internal_test.go
Original file line number Diff line number Diff line change
@@ -344,7 +344,7 @@ func TestDefaultClient_RunCommandAsync_ExitOne(t *testing.T) {
_, outCh := client.RunCommandAsync(ctx, tmp, []string{"dying", "&&", "exit", "1"}, map[string]string{}, nil, "workspace")

out, err := waitCh(outCh)
ErrEquals(t, fmt.Sprintf(`running 'echo dying && exit 1' in '%s': exit status 1`, tmp), err)
ErrEquals(t, fmt.Sprintf(`running 'sh -c echo dying && exit 1' in '%s': exit status 1`, tmp), err)
// Test that we still get our output.
Equals(t, "dying", out)

You are viewing a condensed version of this merge commit. You can view the full changes here.