Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: divyani-22 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Hi @divyani-22. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
09005de to
bba2d12
Compare
…te names Signed-off-by: Divyani <divyanipapalkar22@gmail.com>
Description
In
cmd/create.go, two usability and input validation issues are addressed:--pathflag and a positional argument (e.g.func create -l go --path=/my/dir /other/dir),newCreateConfigpreviously dropped the positional argument without warning or error. If users passed multiple positional arguments (func create -l go dir1 dir2), extra arguments were discarded. In contrast, other commands likedescribeanddeletefail fast on contradictory inputs.func create -l Goor-l PYTHONfailed withnewInvalidRuntimeError, andfunc create -l go -t HTTPfailed withnewInvalidTemplateError, because validation performed strict literal case matching (v == runtime) against lowercase canonical names (go,python,http, etc.). Normalizing withstrings.ToLowerand comparing withstrings.EqualFoldprovides consistent case-insensitivity.Changes
cmd/create.go:--pathflag and positional argument (cannot specify both --path and a positional argument).accepts at most 1 positional argument [path]).--languageand--templateinputs usingstrings.ToLower(strings.TrimSpace(...))increateConfig.isValidRuntimeandisValidTemplateto usestrings.EqualFoldfor case-insensitive validation.cmd/create_test.go:TestCreate_PathAndPositionalConflictverifying that conflicting--pathand positional arguments are rejected.TestCreate_MultiplePositionalArgsverifying that extra positional arguments are rejected.TestCreate_CaseInsensitiveRuntimetesting mixed-case and uppercase runtime names (Go,GO,Python,PYTHON,Node).TestCreate_CaseInsensitiveTemplatetesting mixed-case and uppercase template names (HTTP,Http,CloudEvents,cloudevents).Testing
TestCreate_PathAndPositionalConflictincmd/create_test.goTestCreate_MultiplePositionalArgsincmd/create_test.goTestCreate_CaseInsensitiveRuntimeincmd/create_test.goTestCreate_CaseInsensitiveTemplateincmd/create_test.go