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

Bump CEL version to latest version. #1088

Merged
merged 1 commit into from
May 14, 2021

Conversation

bigkevmcd
Copy link
Member

@bigkevmcd bigkevmcd commented May 12, 2021

Changes

This bumps CEL to v0.7.3, fixes the code to work with the new CEL interfaces, and adds in the CEL Base64 encoding functionality.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Release Notes

The CEL interceptor is updated to the latest version of CEL, this brings in the CEL base64 decoding functions.

These are documented here https://github.com/google/cel-go/tree/master/ext#base64decode

Note: the CEL base64 decoding function decodes to a CEL byte array, which is not a string, it uses the b'hello' syntax to represent a string of bytes "hello".

The triggers `decodeb64` CEL function is now deprecated in favour of the upstream encoders package, you can replace `body.value.decodeb64` with `string(base64.decode(body.value))`

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 12, 2021
@tekton-robot tekton-robot requested review from dlorenc and ncskier May 12, 2021 15:22
@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 12, 2021
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/interceptors/cel/triggers.go 88.0% 86.2% -1.8

@dibyom
Copy link
Member

dibyom commented May 12, 2021

Note: the CEL base64 decoding function decodes to a CEL byte array, which is not a string, it uses the b'hello' syntax to represent a string of bytes "hello".

Interesting, is there an easy way to transform that into a string?

@dibyom
Copy link
Member

dibyom commented May 12, 2021

/approve

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 12, 2021
@bigkevmcd bigkevmcd force-pushed the bump-dependencies branch from 5e70c72 to 4009b53 Compare May 13, 2021 06:03
@bigkevmcd
Copy link
Member Author

Note: the CEL base64 decoding function decodes to a CEL byte array, which is not a string, it uses the b'hello' syntax to represent a string of bytes "hello".

Interesting, is there an easy way to transform that into a string?

Good question, so I added a bit of documentation, and some additional tests to show how to handle this :-)

@bigkevmcd
Copy link
Member Author

@dibyom Ideally we'd deprecate the one in the triggers extension.

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/interceptors/cel/triggers.go 88.0% 86.2% -1.8

@dibyom
Copy link
Member

dibyom commented May 13, 2021

@dibyom Ideally we'd deprecate the one in the triggers extension.

That makes sense. We haven't deprecated a CEL function before. What I'm thinking is we add a DEPRECATION NOTICE in the release notes here and update the docs for the triggers extension doc to mention that this function is now deprecated and users should switch to the new CEL function?

This brings in some bug fixes and adds the upstream CEL base64 encoding
and decoding functionality.

This is deprecating the triggers decodeb64 function.
@bigkevmcd bigkevmcd force-pushed the bump-dependencies branch from 4009b53 to 7df5385 Compare May 14, 2021 07:45
@bigkevmcd
Copy link
Member Author

/test pull-tekton-triggers-go-coverage

1 similar comment
@bigkevmcd
Copy link
Member Author

/test pull-tekton-triggers-go-coverage

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/interceptors/cel/triggers.go 88.0% 86.2% -1.8

@dibyom
Copy link
Member

dibyom commented May 14, 2021

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2021
@tekton-robot tekton-robot merged commit 8e20ea8 into tektoncd:main May 14, 2021
@bigkevmcd bigkevmcd deleted the bump-dependencies branch October 26, 2021 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants