Skip to content

fix: include agent selector in deployment CEL ctx#942

Merged
adityachoudhari26 merged 1 commit intomainfrom
include-agent-selector-cel-ctx
Apr 8, 2026
Merged

fix: include agent selector in deployment CEL ctx#942
adityachoudhari26 merged 1 commit intomainfrom
include-agent-selector-cel-ctx

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

@adityachoudhari26 adityachoudhari26 commented Apr 8, 2026

Resolves #941

Summary by CodeRabbit

  • Chores
    • Enhanced internal deployment configuration evaluation with additional selector field support.

Copilot AI review requested due to automatic review settings April 8, 2026 21:45
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6bf4ab76-dd6c-47a4-8afc-79922e3b3eb5

📥 Commits

Reviewing files that changed from the base of the PR and between 4b01b97 and 67c517a.

📒 Files selected for processing (1)
  • apps/workspace-engine/pkg/selector/langs/cel/cel.go

📝 Walkthrough

Walkthrough

A single field, jobAgentSelector, is added to the CEL evaluation map in the deploymentToMap function. This makes the deployment's job agent selector available for use in CEL policy expressions, complementing existing deployment fields like jobAgentConfig, metadata, and resourceSelector.

Changes

Cohort / File(s) Summary
CEL Deployment Map
apps/workspace-engine/pkg/selector/langs/cel/cel.go
Added jobAgentSelector field to the CEL evaluation context within deploymentToMap function.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • mleonidas

Poem

🐰 A field hops into the CEL map with grace,
jobAgentSelector finds its rightful place,
Now policies can see what agents may be,
Deployments dance with more visibility! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding the agent selector field to the deployment CEL context map.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch include-agent-selector-cel-ctx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds jobAgentSelector to the deployment map that is exposed to CEL selectors, so CEL expressions can reference a deployment’s job-agent selection criteria.

Changes:

  • Include Deployment.JobAgentSelector in the deployment CEL evaluation context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

m["name"] = d.Name
m["slug"] = d.Slug
m["jobAgentConfig"] = d.JobAgentConfig
m["jobAgentSelector"] = d.JobAgentSelector
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This adds a new field to the deployment CEL context, but there’s no test asserting that jobAgentSelector is present in BuildEntityContext/deploymentToMap. Consider extending apps/workspace-engine/pkg/selector/langs/cel/cel_test.go (e.g. TestBuildEntityContext_AllPopulated) to set Deployment.JobAgentSelector and assert depMap["jobAgentSelector"] matches, so regressions are caught.

Copilot uses AI. Check for mistakes.
@adityachoudhari26 adityachoudhari26 merged commit 9a2a5ae into main Apr 8, 2026
14 checks passed
@adityachoudhari26 adityachoudhari26 deleted the include-agent-selector-cel-ctx branch April 8, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: job agent selector should be included in CEL ctx for matching deployments

2 participants