From d3d49b7909bbf4f9baae03ae4fe44005a5380a0f Mon Sep 17 00:00:00 2001 From: Mehul Kar Date: Tue, 2 May 2023 17:11:20 -0700 Subject: [PATCH 1/2] Submit client with run summary to spaces --- cli/internal/runsummary/client_summary.go | 7 ++++++ cli/internal/runsummary/spaces.go | 28 ++++++++++++++++------- 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 cli/internal/runsummary/client_summary.go diff --git a/cli/internal/runsummary/client_summary.go b/cli/internal/runsummary/client_summary.go new file mode 100644 index 0000000000000..7660d96972ab6 --- /dev/null +++ b/cli/internal/runsummary/client_summary.go @@ -0,0 +1,7 @@ +package runsummary + +type ClientSummary struct { + id string + name string + version string +} diff --git a/cli/internal/runsummary/spaces.go b/cli/internal/runsummary/spaces.go index bf19941806a43..cc31e301b2760 100644 --- a/cli/internal/runsummary/spaces.go +++ b/cli/internal/runsummary/spaces.go @@ -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 @@ -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, + }, } } From 28e2f98b37ef49fb0a736bf15986bdb12044cf8d Mon Sep 17 00:00:00 2001 From: Turbobot Date: Tue, 2 May 2023 18:22:03 -0700 Subject: [PATCH 2/2] delete --- cli/internal/runsummary/client_summary.go | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 cli/internal/runsummary/client_summary.go diff --git a/cli/internal/runsummary/client_summary.go b/cli/internal/runsummary/client_summary.go deleted file mode 100644 index 7660d96972ab6..0000000000000 --- a/cli/internal/runsummary/client_summary.go +++ /dev/null @@ -1,7 +0,0 @@ -package runsummary - -type ClientSummary struct { - id string - name string - version string -}