8000 feat: add provisioner daemon and jobs endpoints and commands by mafredri · Pull Request #15940 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add provisioner daemon and jobs endpoints and commands #15940

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

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
gen
  • Loading branch information
mafredri committed Jan 2, 2025
commit a0af6ebf7bd79bcd436376036e7f22d49fbf96ae
4 changes: 2 additions & 2 deletions cli/testdata/coder_list_--output_json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
},
"queue_position": 0,
"queue_size": 0,
"organization_id": "[first org ID]",
"organization_id": "===========[first org ID]===========",
"input": {
"workspace_build_id": "[workspace build ID]"
"workspace_build_id": "========[workspace build ID]========"
},
"type": "workspace_build"
},
Expand Down
4 changes: 2 additions & 2 deletions cli/testdata/coder_provisioners_jobs_list.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ID CREATED AT STATUS TAGS TYPE ORGANIZATION QUEUE
[version job ID] [timestamp] succeeded map[owner: scope:organization] template_version_import Coder
[workspace build job ID] [timestamp] succeeded map[owner: scope:organization] workspace_build Coder
==========[version job ID]========== ====[timestamp]===== succeeded map[owner: scope:organization] template_version_import Coder
======[workspace build job ID]====== ====[timestamp]===== succeeded map[owner: scope:organization] workspace_build Coder
Copy link
Member
@johnstcn johnstcn Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if tags were listed in k1=v1,k2=v2 format.
We can also probably "lie" a bit about the case {"owner": "", "scope": "organization"} and just pretend it's empty.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestions, and I agree we should hide default owner/scope. We should probably update table formatter to change how maps are output.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move "Queue" column to be the first one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move "Queue" column to be the first one.

@mtojek I'm going to create a follow-up issue for this as ordering columns is not supported in our table formatter currently. I would like to avoid us having to craft custom structs every time we want to re-order columns.

32 changes: 16 additions & 16 deletions cli/testdata/coder_provisioners_jobs_list_--output_json.golden
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
[
{
"id": "[version job ID]",
"created_at": "[timestamp]",
"started_at": "[timestamp]",
"completed_at": "[timestamp]",
"id": "==========[version job ID]==========",
"created_at": "====[timestamp]=====",
"started_at": "====[timestamp]=====",
"completed_at": "====[timestamp]=====",
"status": "succeeded",
"worker_id": "[workspace build worker ID]",
"file_id": "[workspace build file ID]",
"worker_id": "====[workspace build worker ID]=====",
"file_id": "=====[workspace build file ID]======",
"tags": {
"owner": "",
"scope": "organization"
},
"queue_position": 0,
"queue_size": 0,
"organization_id": "[first org ID]",
"organization_id": "===========[first org ID]===========",
"input": {
"template_version_id": "[version ID]"
"template_version_id": "============[version ID]============"
},
"type": "template_version_import",
"organization_name": "Coder"
},
{
"id": "[workspace build job ID]",
"created_at": "[timestamp]",
"started_at": "[timestamp]",
"completed_at": "[timestamp]",
"id": "======[workspace build job ID]======",
"created_at": "====[timestamp]=====",
"started_at": "====[timestamp]=====",
"completed_at": "====[timestamp]=====",
"status": "succeeded",
"worker_id": "[workspace build worker ID]",
"file_id": "[workspace build file ID]",
"worker_id": "====[workspace build worker ID]=====",
"file_id": "=====[workspace build file ID]======",
"tags": {
"owner": "",
"scope": "organization"
},
"queue_position": 0,
"queue_size": 0,
"organization_id": "[first org ID]",
"organization_id": "===========[first org ID]===========",
"input": {
"workspace_build_id": "[workspace build ID]"
"workspace_build_id": "========[workspace build ID]========"
},
"type": "workspace_build",
"organization_name": "Coder"
Expand Down
4 changes: 2 additions & 2 deletions cli/testdata/coder_provisioners_list.golden
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CREATED AT LAST SEEN AT NAME VERSION TAGS STATUS ORGANIZATION
[timestamp] [timestamp] test v0.0.0-devel map[owner: scope:organization] offline Coder
CREATED AT LAST SEEN AT NAME VERSION TAGS KEY NAME STATUS ORGANIZATION
====[timestamp]===== ====[timestamp]===== test v0.0.0-devel map[owner: scope:organization] built-in idle Coder
2 changes: 1 addition & 1 deletion cli/testdata/coder_provisioners_list_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OPTIONS:
-O, --org string, $CODER_ORGANIZATION
Select which organization (uuid or name) to use.

-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|key name|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,created at,last seen at,version,tags)
-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|key name|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,key name,created at,last seen at,version,tags)
Columns to display in table output.

-o, --output table|json (default: table)
Expand Down
19 changes: 8 additions & 11 deletions cli/testdata/coder_provisioners_list_--output_json.golden
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[
{
"id": "[workspace build worker ID]",
"organization_id": "[first org ID]",
"id": "====[workspace build worker ID]=====",
"organization_id": "===========[first org ID]===========",
"key_id": "00000000-0000-0000-0000-000000000001",
"created_at": "[timestamp]",
"last_seen_at": "[timestamp]",
"created_at": "====[timestamp]=====",
"last_seen_at": "====[timestamp]=====",
"name": "test",
"version": "v0.0.0-devel",
"api_version": "1.1",
Expand All @@ -15,14 +15,11 @@
"owner": "",
"scope": "organization"
},
"key_name": "",
"status": "offline",
"current_job": {
"id": "[version job ID]",
"status": "succeeded"
},
"key_name": "built-in",
"status": "idle",
"current_job": null,
"previous_job": {
"id": "[workspace build job ID]",
"id": "======[workspace build job ID]======",
"status": "succeeded"
},
"organization_name": "Coder"
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cli/provisioners_list.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OPTIONS:
-O, --org string, $CODER_ORGANIZATION
Select which organization (uuid or name) to use.

-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|key name|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,created at,last seen at,version,tags)
-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|key name|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,key name,created at,last seen at,version,tags)
Columns to display in table output.

-o, --output table|json (default: table)
Expand Down
0