- Notifications
You must be signed in to change notification settings - Fork1.1k
feat(site): use new task data model and endpoints#20431
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
df19ab63ca314992534646f606e1aecddafd8793de208038f88163b18dfac84c2ea700c7c605e1973a7dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -156,13 +156,15 @@ type Task struct { | ||||||||||
| OrganizationID uuid.UUID `json:"organization_id" format:"uuid" table:"organization id"` | ||||||||||
| OwnerID uuid.UUID `json:"owner_id" format:"uuid" table:"owner id"` | ||||||||||
| OwnerName string `json:"owner_name" table:"owner name"` | ||||||||||
| OwnerAvatarURL string `json:"owner_avatar_url,omitempty" table:"owner avatar url"` | ||||||||||
| Name string `json:"name" table:"name,default_sort"` | ||||||||||
| TemplateID uuid.UUID `json:"template_id" format:"uuid" table:"template id"` | ||||||||||
| TemplateVersionID uuid.UUID `json:"template_version_id" format:"uuid" table:"template version id"` | ||||||||||
| TemplateName string `json:"template_name" table:"template name"` | ||||||||||
| TemplateDisplayName string `json:"template_display_name" table:"template display name"` | ||||||||||
| TemplateIcon string `json:"template_icon" table:"template icon"` | ||||||||||
| WorkspaceID uuid.NullUUID `json:"workspace_id" format:"uuid" table:"workspace id"` | ||||||||||
| WorkspaceName string `json:"workspace_name" table:"workspace name"` | ||||||||||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Might be good to add some asserts for this in | ||||||||||
| WorkspaceStatus WorkspaceStatus `json:"workspace_status,omitempty" enums:"pending,starting,running,stopping,stopped,failed,canceling,canceled,deleting,deleted" table:"workspace status"` | ||||||||||
| WorkspaceBuildNumber int32 `json:"workspace_build_number,omitempty" table:"workspace build number"` | ||||||||||
| WorkspaceAgentID uuid.NullUUID `json:"workspace_agent_id" format:"uuid" table:"workspace agent id"` | ||||||||||
| @@ -200,6 +202,14 @@ type TasksFilter struct { | ||||||||||
| FilterQuery string `json:"filter_query,omitempty"` | ||||||||||
| } | ||||||||||
| // TaskListResponse is the response shape for tasks list. | ||||||||||
| // | ||||||||||
| // Experimental response shape for tasks list (server returns []Task). | ||||||||||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
| ||||||||||
| type TasksListResponse struct { | ||||||||||
| Tasks []Task `json:"tasks"` | ||||||||||
| Count int `json:"count"` | ||||||||||
| } | ||||||||||
| func (f TasksFilter) asRequestOption() RequestOption { | ||||||||||
| return func(r *http.Request) { | ||||||||||
| var params []string | ||||||||||
| @@ -242,12 +252,7 @@ func (c *ExperimentalClient) Tasks(ctx context.Context, filter *TasksFilter) ([] | ||||||||||
| return nil, ReadBodyAsError(res) | ||||||||||
| } | ||||||||||
| var tres TasksListResponse | ||||||||||
| if err := json.NewDecoder(res.Body).Decode(&tres); err != nil { | ||||||||||
| return nil, err | ||||||||||
| } | ||||||||||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.