-
Notifications
You must be signed in to change notification settings - Fork 18
chore: jobAgentSelector is required field in deployment schema #940
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -490,6 +490,7 @@ | |
| "id", | ||
| "name", | ||
| "slug", | ||
| "jobAgentSelector", | ||
| "jobAgentConfig" | ||
| ], | ||
| "type": "object" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -266,6 +266,7 @@ | |
| "id", | ||
| "name", | ||
| "slug", | ||
| "jobAgentSelector", | ||
| "jobAgentConfig", | ||
| "metadata" | ||
| ], | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -218,7 +218,7 @@ func testDeployment(hasSelector bool) *oapi.Deployment { | |
| } | ||
| if hasSelector { | ||
| sel := "true" | ||
| dep.JobAgentSelector = &sel | ||
| dep.JobAgentSelector = sel | ||
| } | ||
| return dep | ||
| } | ||
|
|
@@ -300,8 +300,7 @@ func TestProcess_NoAgents_CompletesPlan(t *testing.T) { | |
|
|
||
| func TestProcess_EmptySelector_CompletesPlan(t *testing.T) { | ||
| dep := testDeployment(false) | ||
| emptySel := "" | ||
| dep.JobAgentSelector = &emptySel | ||
| dep.JobAgentSelector = "" | ||
|
|
||
|
Comment on lines
301
to
304
|
||
| getter := &mockGetter{plan: testPlan(), deployment: dep} | ||
| setter := &mockSetter{} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making
jobAgentSelectorrequired in theDeploymentschema appears inconsistent with current API behavior:apps/api/src/routes/v1/workspaces/deployments.tsformatsjobAgentSelectorasundefinedwhen the stored value isnullor the default string "false", which causes the property to be omitted from JSON responses. Either update the API formatting to always return a string value (e.g. include "false"/""), or keepjobAgentSelectoroptional in theDeploymentresponse schema to match what the server actually returns.