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: PR check status to show summary e.g. Plan: 1 to add, 0 to change, 1 to destroy #2699

Closed
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: revert result changes for Plan and Apply functions
  • Loading branch information
albertorm95 committed Dec 19, 2022

Verified

This commit was signed with the committer’s verified signature.
puckpuck Pierre Tessier
commit dc4b540c68e46ddc054745e3cf5a80da32a743a2
8 changes: 4 additions & 4 deletions server/events/project_command_runner.go
Original file line number Diff line number Diff line change
@@ -146,15 +146,15 @@ type ProjectOutputWrapper struct {
}

func (p *ProjectOutputWrapper) Plan(ctx command.ProjectContext) command.ProjectResult {
ctx.CommandResult = p.updateProjectPRStatus(command.Plan, ctx, p.ProjectCommandRunner.Plan)
result := p.updateProjectPRStatus(command.Plan, ctx, p.ProjectCommandRunner.Plan)
p.JobMessageSender.Send(ctx, "", OperationComplete)
return ctx.CommandResult
return result
}

func (p *ProjectOutputWrapper) Apply(ctx command.ProjectContext) command.ProjectResult {
ctx.CommandResult = p.updateProjectPRStatus(command.Apply, ctx, p.ProjectCommandRunner.Apply)
result := p.updateProjectPRStatus(command.Apply, ctx, p.ProjectCommandRunner.Apply)
p.JobMessageSender.Send(ctx, "", OperationComplete)
return ctx.CommandResult
return result
}

func (p *ProjectOutputWrapper) updateProjectPRStatus(commandName command.Name, ctx command.ProjectContext, execute func(ctx command.ProjectContext) command.ProjectResult) command.ProjectResult {