Skip to content

Commit

Permalink
Send turbo version to run payload (#4786)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulkar committed May 3, 2023
1 parent 57524f0 commit 85cfc59
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions cli/internal/runsummary/spaces.go
Expand Up @@ -10,15 +10,22 @@ type spacesRunResponse struct {
URL string
}

type spacesClientSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
}

type spacesRunPayload struct {
StartTime int64 `json:"startTime,omitempty"` // when the run was started
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
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)
StartTime int64 `json:"startTime,omitempty"` // when the run was started
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
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)
Client spacesClientSummary `json:"client"` // Details about the turbo client

// TODO: we need to add these in
// originationUser string
Expand Down Expand Up @@ -64,6 +71,11 @@ func (rsm *Meta) newSpacesRunCreatePayload() *spacesRunPayload {
RepositoryPath: rsm.repoPath.ToString(),
Type: "TURBO",
Context: context,
Client: spacesClientSummary{
ID: "turbo",
Name: "Turbo",
Version: rsm.RunSummary.TurboVersion,
},
}
}

Expand Down

0 comments on commit 85cfc59

Please sign in to comment.