-
Notifications
You must be signed in to change notification settings - Fork 533
tools: add metadata linting step to linter job #1087
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
tools: add metadata linting step to linter job #1087
Conversation
|
/uncc cgwalters |
7f8b2ae to
f8f649f
Compare
Signed-off-by: Doug Hellmann <[email protected]>
f8f649f to
359c865
Compare
| // Must have one valid tracking link and no TBD | ||
| foundLink := false | ||
| for _, trackingLink := range m.TrackingLinks { | ||
| if trackingLink == "TBD" { |
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.
We can probably ban TBD in all metadata properties, right? Or perhaps an allow-list of properties where it is a valid value?
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.
We could. I was focusing on the fields that seemed most important right now, based on issues I've seen with PRs.
aravindhp
left a comment
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 doing this, @dhellmann. Just a few non-blocking comments.
| if trackingLink == "TBD" { | ||
| reportError("'TBD' is not a valid value for tracking-link") | ||
| continue | ||
| } | ||
| if trackingLink == "" { | ||
| reportError("empty string for tracking-link") | ||
| continue | ||
| } |
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.
I would simplify and throw an error if the tracking link is not an URL.
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.
I was trying to differentiate between a missing value and an invalid value. Do you think people would understand "could not parse tracking link ''" as meaning the value was empty and it can't be?
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.
How about making the error message something like tracking link has to be a valid URL?
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.
Done
| if trackingLink == "TBD" { | ||
| reportError("'TBD' is not a valid value for tracking-link") | ||
| continue | ||
| } | ||
| if trackingLink == "" { | ||
| reportError("empty string for tracking-link") | ||
| continue | ||
| } |
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.
Done
d2451aa to
b3328be
Compare
Signed-off-by: Doug Hellmann <[email protected]>
Signed-off-by: Doug Hellmann <[email protected]>
We want a copy of the template to fail the linter until the TBD value is replaced with a real name, so remove the things that look like real names. Signed-off-by: Doug Hellmann <[email protected]>
Signed-off-by: Doug Hellmann <[email protected]>
Move the comments about the reviewers into quotes so the YAML can be parsed. Signed-off-by: Doug Hellmann <[email protected]>
Co-authored-by: Ben Parees <[email protected]>
b3328be to
38ea128
Compare
|
I believe I have made updates based on all of the comments on the earlier drafts. |
aravindhp
left a comment
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
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@dhellmann: all tests passed! Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
Catching up with 36e98de (template: update guidance for specifying that no API approver is needed, 2022-04-10, openshift#1087).
Catching up with 36e98de (template: update guidance for specifying that no API approver is needed, 2022-04-10, openshift#1087).
Uh oh!
There was an error while loading. Please reload this page.