Skip to content

Conversation

@dhellmann
Copy link
Contributor

@dhellmann dhellmann commented Apr 10, 2022

  • Add a metadata-lint command to the tools directory for checking enhancements metadata.
  • Update the existing job to run the new tool against enhancements markdown files that are changed in the current pull request.
  • Require an approver in the metadata.
  • Require at least one reviewer in the metadata.
  • Require a string that looks like a URL in the tracking-links metadata.
  • Update the comments in the metadata section of the template to provide better guidance about the new linter rules.

@openshift-ci openshift-ci bot requested review from jerpeter1 and zaneb April 10, 2022 17:03
@dhellmann
Copy link
Contributor Author

/uncc cgwalters
/uncc ststs
/uncc soltysh
/cc @bparees
/cc @aravindhp
/cc @kikisdeliveryservice

// Must have one valid tracking link and no TBD
foundLink := false
for _, trackingLink := range m.TrackingLinks {
if trackingLink == "TBD" {
Copy link
Member

@wking wking Apr 11, 2022

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@aravindhp aravindhp left a 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.

Comment on lines 59 to 66
if trackingLink == "TBD" {
reportError("'TBD' is not a valid value for tracking-link")
continue
}
if trackingLink == "" {
reportError("empty string for tracking-link")
continue
}
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 59 to 66
if trackingLink == "TBD" {
reportError("'TBD' is not a valid value for tracking-link")
continue
}
if trackingLink == "" {
reportError("empty string for tracking-link")
continue
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

dhellmann and others added 6 commits April 11, 2022 17:39
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]>
Move the comments about the reviewers into quotes so the YAML can be parsed.

Signed-off-by: Doug Hellmann <[email protected]>
@dhellmann
Copy link
Contributor Author

I believe I have made updates based on all of the comments on the earlier drafts.

Copy link
Contributor

@aravindhp aravindhp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 11, 2022
@bparees
Copy link
Contributor

bparees commented Apr 13, 2022

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 13, 2022

[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

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 13, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 13, 2022

@dhellmann: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 9c1658c into openshift:master Apr 13, 2022
wking added a commit to wking/openshift-enhancements that referenced this pull request Apr 19, 2022
Catching up with 36e98de (template: update guidance for specifying
that no API approver is needed, 2022-04-10, openshift#1087).
wking added a commit to wking/openshift-enhancements that referenced this pull request Apr 20, 2022
Catching up with 36e98de (template: update guidance for specifying
that no API approver is needed, 2022-04-10, openshift#1087).
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants