-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Validate parameter name format #4799
Validate parameter name format #4799
Conversation
The following is the coverage report on the affected files.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additional work to be done with extractVariablesFromString function.
/retest |
`tasks.md` mentioned that the parameter names should follow the following rules. But we didn't enforce it. - Must only contain alphanumeric characters, hyphens (-), underscores (_), and dots (.). - Must begin with a letter or an underscore (_). In this commit, we enforce the rules. If invalid name format is found, validation webhook will complain.
0aced0f
to
133a5ec
Compare
The following is the coverage report on the affected files.
|
/test pull-tekton-pipeline-integration-tests |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester 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 |
We want to extract everything that `NAME` contains in (`$param.<NAME> | $param.<NAME>[*]`) or (`param["<NAME>"] | $param["<NAME>"][*]`) or (`param['NAME'][*] | $param['<NAME>'][*]`). We dont want to enforce the pattern that it should follow. That part should be done by `Step 1` in tektoncd#4799 (comment) The regex pattern substitution `.*?(\[\*\])?` matches and extracts everything that is contained in `<NAME>` or `<NAME>[*]`.
We want to extract everything that `NAME` contains in (`$param.<NAME> | $param.<NAME>[*]`) or (`param["<NAME>"] | $param["<NAME>"][*]`) or (`param['NAME'][*] | $param['<NAME>'][*]`). We dont want to enforce the pattern that it should follow. That part should be done by `Step 1` in tektoncd#4799 (comment) The regex pattern substitution `.*?(\[\*\])?` matches and extracts everything that is contained in `<NAME>` or `<NAME>[*]`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
We want to extract everything that `NAME` contains in (`$param.<NAME> | $param.<NAME>[*]`) or (`param["<NAME>"] | $param["<NAME>"][*]`) or (`param['NAME'][*] | $param['<NAME>'][*]`). We dont want to enforce the pattern that it should follow. That part should be done by `Step 1` in tektoncd#4799 (comment) The regex pattern substitution `.*?(\[\*\])?` matches and extracts everything that is contained in `<NAME>` or `<NAME>[*]`.
We want to extract everything that `NAME` contains in (`$param.<NAME> | $param.<NAME>[*]`) or (`param["<NAME>"] | $param["<NAME>"][*]`) or (`param['NAME'][*] | $param['<NAME>'][*]`). We dont want to enforce the pattern that it should follow. That part should be done by `Step 1` in #4799 (comment) The regex pattern substitution `.*?(\[\*\])?` matches and extracts everything that is contained in `<NAME>` or `<NAME>[*]`.
Changes
Fixes #4792
This doc mentioned that the parameter names should follow the following rules:
But the current code has not implemented the validation against the name format, which can cause some problems mentioned in #4792 .
In this PR, we enforce the rules. If invalid name format is found, validation webhook will complain.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
(if there are no user facing changes, use release note "NONE")
Release Notes