Skip to content

feat: add eval cmd#154

Merged
moshloop merged 1 commit into
mainfrom
cel-eval-cmd
Apr 21, 2026
Merged

feat: add eval cmd#154
moshloop merged 1 commit into
mainfrom
cel-eval-cmd

Conversation

@yashmehrotra
Copy link
Copy Markdown
Member

@yashmehrotra yashmehrotra commented Apr 21, 2026

Summary by CodeRabbit

  • New Features

    • Added ceval CLI tool for evaluating CEL expressions against YAML/JSON files.
  • Documentation

    • Added documentation and usage examples for the new CEL eval helper.
  • Tests

    • Added comprehensive test coverage for the new tool.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Walkthrough

Added a new CEL expression evaluator CLI tool at cmd/ceval that evaluates CEL expressions against data loaded from YAML or JSON files. Includes implementation with comprehensive tests and documentation describing usage and example invocations.

Changes

Cohort / File(s) Summary
CEL eval CLI implementation
cmd/ceval/main.go
New executable with functions to load YAML/JSON environments, evaluate CEL expressions via gomplate.RunExpression, and output results. Supports -f/-file and -e/-expr flags with proper error handling and exit codes.
CEL eval CLI tests
cmd/ceval/main_test.go
Test suite covering loadEnvironment (YAML parsing) and run command execution, validating expression evaluation against nested data structures.
Documentation
README.md
Added "CEL eval helper" section with usage description, sample invocation example, and expected output for evaluating expressions like labels['a/b/c'].
🚥 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 'feat: add eval cmd' accurately describes the main change: introducing a new CEL expression evaluation command-line tool at cmd/ceval with supporting code and tests.
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 cel-eval-cmd
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch cel-eval-cmd

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

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 154-155: The README has an unclosed Go code fence so the "## CEL
eval helper" heading is rendered as code; close the open Go fence (the ```go
block started earlier) immediately before the "## CEL eval helper" heading so
the new section is treated as Markdown rather than code (i.e., insert the
matching closing triple-backtick right before the heading).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8837a93-74bc-4f1f-baf2-56a53e7de92c

📥 Commits

Reviewing files that changed from the base of the PR and between ccb784c and 3ce2212.

📒 Files selected for processing (3)
  • README.md
  • cmd/ceval/main.go
  • cmd/ceval/main_test.go

Comment thread README.md
Comment on lines +154 to +155

## CEL eval helper
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Close the previous Go code fence before this new section.

The ## CEL eval helper heading is currently still inside the Go fenced block opened earlier, so the new docs will render as code instead of Markdown.

📝 Proposed fix
 err := gomplate.Walk(map[string]any{"name": "world"}, &cfg)
 // cfg.Message == "Hello, world!"
+
+```
 
 ## CEL eval helper
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 154 - 155, The README has an unclosed Go code fence
so the "## CEL eval helper" heading is rendered as code; close the open Go fence
(the ```go block started earlier) immediately before the "## CEL eval helper"
heading so the new section is treated as Markdown rather than code (i.e., insert
the matching closing triple-backtick right before the heading).

@moshloop moshloop merged commit 8fc62b3 into main Apr 21, 2026
8 checks passed
@moshloop moshloop deleted the cel-eval-cmd branch April 21, 2026 12:23
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