Skip to content
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

Add Common Expression Language (CEL) #322

Open
4 of 5 tasks
DonaldKellett opened this issue Dec 28, 2024 · 4 comments
Open
4 of 5 tasks

Add Common Expression Language (CEL) #322

DonaldKellett opened this issue Dec 28, 2024 · 4 comments
Assignees

Comments

@DonaldKellett
Copy link
Member

DonaldKellett commented Dec 28, 2024

Motivation

Qualified customers can leverage CEL support for interview challenges tailored to DevOps and platform engineering roles.

Common Expression Language (CEL) is a domain-specific language with bounded execution time optimized for defining authorization policies, validating API requests and transforming data.

CEL was initially developed by Google and widely adopted within Kubernetes and the wider cloud-native ecosystem, e.g.:

Introducing CEL support on Codewars opens the doors to a new class of policy authoring and data validation challenges tailored to cloud infrastructure and DevOps engineers who may not necessarily be well-versed in programming and software development. Furthermore, Qualified customers can leverage CEL support for interview challenges tailored to DevOps and platform engineering roles.

Required information

Please complete the following information about the language:

  • Name: Common Expression Language (CEL)
  • Website: https://cel.dev/
  • Language Version: v0.19.1 or any sufficiently recent version of CEL

The following are optional, but will help us add the language:

  • Test Frameworks:

    1. Evaluate CEL expressions in Go using the Undistro CEL playground evaluator: undistro/cel-playground
    2. Define assertions for unit testing: onsi/ginkgo
    3. BDD: onsi/gomega
  • How to install: use an official Go base image and import the required Go packages in the runtime setup and test fixture:

    1. github.com/undistro/cel-playground/eval
    2. github.com/onsi/ginkgo/v2
    3. github.com/onsi/gomega
  • How to compile/run: like any other Go project, e.g. with ginkgo

  • Any comments: see "Motivation" above


  • Building
  • Executing
  • Testing
  • CodeMirror mode
  • Icon

👍 reaction might help to get this request prioritized.

@DonaldKellett
Copy link
Member Author

@kazk would an example setup similar to codewars/riscv speed up the process of adding CEL support to Codewars? If so, I might work on one in the coming weeks subject to availability, minus the following deliverables:

  1. Conversion to Codewars test output format - we can probably refer to the Codewars Go setup afterwards
  2. CodeMirror syntax highlighting - not too familiar with it

@DonaldKellett
Copy link
Member Author

@kazk An example setup is now available at DonaldKellett/codewars-cel and I've invited you as a collaborator to the repository; feel free to take a look and reach out in case of any suggestions or outstanding issues 😄

The example setup demonstrates 3 cases based on rejecting Pods with gitRepo volumes using CEL expressions, motivated by the recent CVE-2024-10220 vulnerability:

  1. Passing tests
  2. Failing tests
  3. Syntax error

@DonaldKellett
Copy link
Member Author

Just realized that the current Codewars Go setup uses Ginkgo+Gomega for unit testing, I've migrated the examples over from Testify to Ginkgo+Gomega

@DonaldKellett
Copy link
Member Author

The official CEL SVG logo taken from cel.dev:

lockup

Perhaps we can use a variant thereof for our Codewars CEL logo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants