Skip to content

chore: align version list endpoint CEL filtering#1123

Merged
adityachoudhari26 merged 1 commit into
mainfrom
align-version-cel
May 12, 2026
Merged

chore: align version list endpoint CEL filtering#1123
adityachoudhari26 merged 1 commit into
mainfrom
align-version-cel

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

@adityachoudhari26 adityachoudhari26 commented May 12, 2026

Summary by CodeRabbit

Bug Fixes

  • Fixed deployment version filtering to properly process filter queries, ensuring version-based filters work as expected across API queries and tests.

Review Change Stack

Copilot AI review requested due to automatic review settings May 12, 2026 18:48
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 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: 1ef8ca1d-06ac-48dc-b0c6-021c99a59d4d

📥 Commits

Reviewing files that changed from the base of the PR and between f00eb8b and 49b9428.

📒 Files selected for processing (2)
  • apps/api/src/routes/v1/workspaces/deployments.ts
  • e2e/tests/api/deployment-version-list.spec.ts

📝 Walkthrough

Walkthrough

This PR corrects the CEL variable name used when filtering deployment versions from deploymentVersion to version. The implementation change in the deployments route is paired with updates to all seven e2e tests that verify the filtering behavior across pagination, limits, ordering, and deployment isolation scenarios.

Changes

CEL Variable Name Refactoring

Layer / File(s) Summary
Implementation and test updates for version variable naming
apps/api/src/routes/v1/workspaces/deployments.ts, e2e/tests/api/deployment-version-list.spec.ts
The filterDeploymentVersions function now passes deployment versions under the version identifier to CEL evaluation instead of deploymentVersion. All seven e2e tests that verify CEL paging, limits, emptiness, ordering, and deployment-scoped isolation are updated to reference version.metadata.* in their CEL predicates.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • ctrlplanedev/ctrlplane#1119: Both PRs modify the same CEL evaluation in the deployments endpoint; the retrieved PR evaluates CEL over deployment version rows while this PR changes the CEL variable identifier from deploymentVersion to version.
  • ctrlplanedev/ctrlplane#1047: This PR modifies the CEL evaluation call that was introduced in that PR, changing the variable name passed to the evaluator.

Suggested reviewers

  • mleonidas
  • zacharyblasczyk

Poem

🐰 A variable rename hops through the code,
From deploymentVersion to version we strode,
The tests all now match with the API's new name,
CEL predicates corrected—no more naming shame!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: aligning the CEL variable name in the version list endpoint from 'deploymentVersion' to 'version'.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 align-version-cel

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
Contributor

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

This PR aligns the CEL filtering variable name used by the deployment version list endpoint and its e2e coverage, switching the CEL context from deploymentVersion to version for consistency with other CEL usages in the codebase.

Changes:

  • Updated the deployment version list endpoint’s CEL evaluation context to expose the current item as version.
  • Updated e2e tests to use version.metadata.* in CEL expressions instead of deploymentVersion.metadata.*.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
e2e/tests/api/deployment-version-list.spec.ts Updates CEL filter strings in e2e tests to reference version instead of deploymentVersion.
apps/api/src/routes/v1/workspaces/deployments.ts Changes the CEL evaluation context variable passed to cel-js from deploymentVersion to version.

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

return versions.filter((version) => {
try {
return evaluate(cel, { deploymentVersion: version });
return evaluate(cel, { version });
@adityachoudhari26 adityachoudhari26 merged commit 80c1a65 into main May 12, 2026
13 checks passed
@adityachoudhari26 adityachoudhari26 deleted the align-version-cel branch May 12, 2026 19:01
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.

2 participants