Skip to content

Add Common Expression Language (CEL) #322

Description

@DonaldKellett

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.

Activity

  1. DonaldKellett commented on Dec 28, 2024

    @DonaldKellett
    MemberAuthor

    @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
  2. DonaldKellett commented on Dec 31, 2024

    @DonaldKellett
    MemberAuthor

    @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
  3. DonaldKellett commented on Jan 1, 2025

    @DonaldKellett
    MemberAuthor

    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

  4. DonaldKellett commented on Jan 5, 2025

    @DonaldKellett
    MemberAuthor

    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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions