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

Make Go play nicely with omitempty. #5673

Merged
merged 1 commit into from
Aug 4, 2023
Merged
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
8 changes: 4 additions & 4 deletions cli/internal/runsummary/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ type spacesRunPayload struct {
EndTime int64 `json:"endTime,omitempty"` // when the run ended. we should never submit start and end at the same time.
Status string `json:"status,omitempty"` // Status is "running" or "completed"
Type string `json:"type,omitempty"` // hardcoded to "TURBO"
ExitCode int `json:"exitCode,omitempty"` // exit code for the full run
ExitCode *int `json:"exitCode,omitempty"` // exit code for the full run
Command string `json:"command,omitempty"` // the thing that kicked off the turbo run
RepositoryPath string `json:"repositoryPath,omitempty"` // where the command was invoked from
Context string `json:"context,omitempty"` // the host on which this Run was executed (e.g. Github Action, Vercel, etc)
Expand Down Expand Up @@ -289,7 +289,7 @@ type spacesTask struct {
StartTime int64 `json:"startTime,omitempty"`
EndTime int64 `json:"endTime,omitempty"`
Cache spacesCacheStatus `json:"cache,omitempty"`
ExitCode int `json:"exitCode,omitempty"`
ExitCode *int `json:"exitCode,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Dependents []string `json:"dependents,omitempty"`
Logs string `json:"log"`
Expand Down Expand Up @@ -325,7 +325,7 @@ func newSpacesDonePayload(runsummary *RunSummary) *spacesRunPayload {
return &spacesRunPayload{
Status: "completed",
EndTime: endTime,
ExitCode: runsummary.ExecutionSummary.exitCode,
ExitCode: &runsummary.ExecutionSummary.exitCode,
}
}

Expand All @@ -341,7 +341,7 @@ func newSpacesTaskPayload(taskSummary *TaskSummary, logs []byte) *spacesTask {
StartTime: startTime,
EndTime: endTime,
Cache: spacesCacheStatus(taskSummary.CacheSummary), // wrapped so we can remove fields
ExitCode: *taskSummary.Execution.exitCode,
ExitCode: taskSummary.Execution.exitCode,
Dependencies: taskSummary.Dependencies,
Dependents: taskSummary.Dependents,
Logs: string(logs),
Expand Down
Loading