-
Notifications
You must be signed in to change notification settings - Fork 15
feat: support multiple job agent configs for a deployment #807
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
08ff21e
init
adityachoudhari26 c3ebebb
cleanup
adityachoudhari26 050a392
Merge branch 'main' of github.com:sizzldev/ctrlplane into deployment-…
adityachoudhari26 fd3ebe7
cleanup
adityachoudhari26 4d10f38
add tests for array
adityachoudhari26 1e00c9c
Merge branch 'main' of github.com:sizzldev/ctrlplane into deployment-…
adityachoudhari26 4d18faa
Merge branch 'main' of github.com:sizzldev/ctrlplane into deployment-…
adityachoudhari26 27bfb7f
rabbit comments
adityachoudhari26 63eda58
update db schemas and rename to selector
adityachoudhari26 38e43be
fix test
adityachoudhari26 0838c02
fix lint
adityachoudhari26 6593730
fix fmt db
adityachoudhari26 63e336a
Merge branch 'main' of github.com:sizzldev/ctrlplane into deployment-…
adityachoudhari26 80dcbed
add err tests
adityachoudhari26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 2007
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 802
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 694
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 1414
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 167
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 7519
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 3056
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 1989
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 48
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 3337
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 5529
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 866
🏁 Script executed:
Repository: ctrlplanedev/ctrlplane
Length of output: 17722
selectorshould be optional, notrequiredThe tests (e.g.,
TestEngine_DeploymentJobAgentsArray_AllAgentsNoCondition) constructDeploymentJobAgentwithout aSelectorfield, relying on the Go zero value"". Withselectormarkedrequiredin the schema, the generated type isSelector string(non-pointer), making it impossible to distinguish "no filter" from "empty string" at the API boundary. The application logic inpkg/workspace/jobagents/deployment_agent_selector.go(lines 90–100) treats empty string as "always match"—it skips CEL compilation whenSelector != ""is false—but an empty string is not a valid CEL expression.Making
selectoroptional cleanly represents "omit or leave empty to always use this agent":♻️ Proposed fix
DeploymentJobAgent: { type: 'object', - required: ['ref', 'config', 'selector'], + required: ['ref', 'config'], properties: { ref: { type: 'string', description: 'Job agent ID to use for this configuration' }, config: openapi.schemaRef('JobAgentConfig'), - selector: { type: 'string', description: 'CEL expression to determine if the job agent should be used' }, + selector: { type: 'string', description: 'CEL expression to determine if the job agent should be used. Omit or leave empty to always use this agent.' }, }, },📝 Committable suggestion
🤖 Prompt for AI Agents