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

Do not display non essential tf commands #108

Merged
merged 4 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion server/controllers/logstreaming_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (j *JobsController) GetProjectJobsWS(w http.ResponseWriter, r *http.Request

pull := projectInfo.String()
err = j.ProjectCommandOutputHandler.Receive(pull, receiver, func(msg string) error {
if err := c.WriteMessage(websocket.BinaryMessage, []byte(msg+"\r\n\t")); err != nil {
if err := c.WriteMessage(websocket.BinaryMessage, []byte("\r"+msg+"\n")); err != nil {
j.Logger.Warn("Failed to write ws message: %s", err)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/templates/web_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ var ProjectJobsTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
document.location.pathname +
"/ws");
socket.onmessage = function(event) {
var msg = String.fromCharCode.apply(null, new Uint8Array(event.data))
var msg = String.fromCharCode.apply(null, new Uint8Array(event.data))
if (msg.trim() === "-----Starting New Process-----") {
term.clear()
return
Expand Down
2 changes: 1 addition & 1 deletion server/events/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

const (
planfileSlashReplace = "::"
LogStreamingClearMsg = "\t\n-----Starting New Process-----\n"
LogStreamingClearMsg = "\n-----Starting New Process-----"
)

type PullReqStatus struct {
Expand Down
4 changes: 3 additions & 1 deletion server/events/terraform/terraform_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,9 @@ func (c *DefaultClient) RunCommandAsync(ctx models.ProjectCommandContext, path s
go func() {
// Don't stream terraform show output to outCh
cmds := strings.Split(tfCmd, " ")
c.projectCmdOutputHandler.Send(ctx, fmt.Sprintf("\n----- running terraform %s -----\n", args[0]))
if isValidCommand(cmds[1]) {
c.projectCmdOutputHandler.Send(ctx, fmt.Sprintf("\n----- running terraform %s -----", args[0]))
}
s := bufio.NewScanner(stdout)
for s.Scan() {
message := s.Text()
Expand Down