-
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
Fix capitalization inconsistency in reconciler #7318
Fix capitalization inconsistency in reconciler #7318
Conversation
|
Hi @mlschmithorst. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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/test-infra repository. |
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.
/ok-to-test
The following is the coverage report on the affected files.
|
I think there is a golangci-lint linter for that we could probably enable |
I did see in the Development guidelines that the linter would be run with each PR, but I don't see it running currently in the list of checks. Should there be a separate issue to implement that? This is my first PR so I'm still learning how everything works. |
Thanks @mlschmithorst |
sideCars: | ||
retriesStatus: | ||
- conditions: | ||
- reason: TaskRunValidationFailed | ||
status: "False" | ||
type: "Succeeded" | ||
message: "Provided results don't match declared results; may be invalid JSON or missing result declaration: \"aResult\": task result is expected to be \"array\" type but was initialized to a different type \"string\"" | ||
message: "provided results don't match declared results; may be invalid JSON or missing result declaration: \"aResult\": task result is expected to be \"array\" type but was initialized to a different type \"string\"" |
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.
This might actually be the ones we want to keep capitalized since users would just read through the retriesStatus message.
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.
This error message is returned from here. Is this only returned for retriesStatus or is that just for this test case? I can update the error message and the test case to be capitalized again. I just wanted to make sure this wasn't also returned somewhere else where the capitalization could be incorrect style.
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.
Thanks for looking into this, Matthew! Your question makes sense.
The message: "Provided results...."
we are seeing is user-facing.
The issue seems to be that we haven't wrapped the error being returned well enough with a capitalized error message in taskrun.go.
So the workaround for this PR here might be just to restore this change and in the future we might want to keep the error messages wrapped so such issue wouldn't recur:/
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.
Thank you for the clarification Jerome. I have reverted that change.
Are we referring to https://golangci-lint.run/usage/linters/#godot . Looks like it has been disabled in our repo Line 67 in f975869
|
I don't see in the docs but it's stylecheck for me: https://golangci-lint.run/usage/linters/#stylecheck one one of my repo where i have it enabled it would show me as error if capitalized: % make lint
Linting go files...
pkg/webhook/reconciler.go:69:10: ST1005: error strings should not be capitalized (stylecheck)
return fmt.Errorf("Secret %q is missing %q key", ac.secretName, certresources.CACert)
^
make: *** [Makefile:75: lint-go] Error 1 |
Fix the first task in tektoncd#7266 Update error messages returned in pkg/reconciler to begin with lowercase. Update error logs in pkg/reconciler to begin with uppercase.
7039282
to
673ae62
Compare
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.
Thanks @mlschmithorst
Cool, thanks @chmouel . I added this to the Epic as an improvement to be done. Will verify there which linter fits in the current use case. |
Thanks for the first contribution to Tekton and welcome! /meow |
In response to this:
Instructions 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/test-infra repository. |
/assign @vdemeester |
I tend to be in the "all errors shouldn't be capitablized" side of things 🙃 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JeromeJu, 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 |
+1 |
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.
Thanks @mlschmithorst!
/lgtm
Changes
Go style states that error messages typically shouldn't be capitalized unless in logs, tests, API response, or UI.
Updates error messages returned in pkg/reconciler to begin with lowercase. Updates error logs in pkg/reconciler to begin with uppercase.
Fixes the first task in #7266
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes
/kind cleanup