Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

internal/runner: Run a status report on Deployments and Releases #4099

Merged
merged 3 commits into from
Oct 26, 2022
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
4 changes: 4 additions & 0 deletions .changelog/4099.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:improvement
core: Auto run a status report after a deployment or release operation rather
than only if `waypoint deploy` or `waypoint release` CLI is run.
```
12 changes: 0 additions & 12 deletions internal/cli/deployment_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ func (c *DeploymentCreateCommand) Run(args []string) int {
hostname = hostnamesResp.Hostnames[0]
}

// Status Report
app.UI.Output("")
_, err = app.StatusReport(ctx, &pb.Job_StatusReportOp{
Target: &pb.Job_StatusReportOp_Deployment{
Deployment: deployment,
},
})
if err != nil {
app.UI.Output(clierrors.Humanize(err), terminal.WithErrorStyle())
return ErrSentinel
}

// Release if we're releasing
var releaseUrl string
if c.flagRelease {
Expand Down
12 changes: 0 additions & 12 deletions internal/cli/release_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,6 @@ func (c *ReleaseCreateCommand) Run(args []string) int {
tbl := fmtVariablesOutput(resp.VariableFinalValues)
c.ui.Table(tbl)

// Status Report
app.UI.Output("")
_, err = app.StatusReport(ctx, &pb.Job_StatusReportOp{
Target: &pb.Job_StatusReportOp_Release{
Release: result.Release,
},
})
if err != nil {
app.UI.Output(clierrors.Humanize(err), terminal.WithErrorStyle())
return ErrSentinel
}

if result.Release.Url == "" {
app.UI.Output("\n"+strings.TrimSpace(releaseNoUrl),
deploy.Id,
Expand Down
6 changes: 6 additions & 0 deletions internal/runner/operation_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ func (r *Runner) executeDeployOp(
return nil, err
}

// Run a status report on the recent deployment
_, err = app.DeploymentStatusReport(ctx, deployment)
if err != nil {
return nil, err
}

return &pb.Job_Result{
Deploy: &pb.Job_DeployResult{
Deployment: deployment,
Expand Down
6 changes: 6 additions & 0 deletions internal/runner/operation_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,11 @@ func (r *Runner) executeReleaseOp(
}
}

// Run a status report operation on the recent release
_, err = app.ReleaseStatusReport(ctx, release)
if err != nil {
return nil, err
}

return result, nil
}