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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
refreshing output not stripped in error output with 'strip_refreshing' on custom run command #4442
Labels
bug
Something isn't working
Comments
rossstr-clickup
changed the title
refreshing output not stripped in error output
refreshing output not stripped in error output with 'strip_refreshing' on custom run command
Apr 16, 2024
Perhaps something like this: https://github.com/runatlantis/atlantis/blob/main/server/core/runtime/run_step_runner.go#L72-L93 output, err := runner.Run(ctx)
+ if postProcessOutput == valid.PostProcessRunOutputStripRefreshing {
+ output = StripRefreshingFromPlanOutput(output, tfVersion)
+ }
if err != nil {
err = fmt.Errorf("%s: running %q in %q: \n%s", err, command, path, output)
if !ctx.CustomPolicyCheck {
ctx.Log.Debug("error: %s", err)
return "", err
}
ctx.Log.Debug("Treating custom policy tool error exit code as a policy failure. Error output: %s", err)
}
switch postProcessOutput {
case valid.PostProcessRunOutputHide:
return "", nil
case valid.PostProcessRunOutputStripRefreshing:
- return StripRefreshingFromPlanOutput(output, tfVersion), nil
+ return output, nil
case valid.PostProcessRunOutputShow:
return output, nil
default:
return output, nil
} I imagine that hiding output in cases of error is undesirable. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Community Note
Overview of the Issue
#3518 Introduced a feature to filter output when running custom commands. However, if the plan workflow uses a custom run step to execute the plan, and the plan errors, the refreshing output is carried through in the error. This can lead to lengthy error comments.
This should be solvable by moving the location at which
strip_refreshing
is applied.Reproduction Steps
Run plan with a custom run step, which has
output: strip_refreshing
set, and run a plan which results in an error.Logs
Environment details
Additional Context
The text was updated successfully, but these errors were encountered: