-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add sigs validator #100
Add sigs validator #100
Conversation
Signed-off-by: Daniel Hiller <dhiller@redhat.com>
Command: $ go run validators/cmd/sigs/sigs-validator.go --sigs_file_path=./sigs.yaml --dry-run=false Signed-off-by: Daniel Hiller <dhiller@redhat.com>
Signed-off-by: Daniel Hiller <dhiller@redhat.com>
/lgtm |
/retest |
Signed-off-by: Daniel Hiller <dhiller@redhat.com>
@mazzystr sorry, had to fix error regarding the devstats generator, PTAL! Thanks! |
Please see kubevirt/project-infra#1160, there I have added a validation presubmit, so that we can be sure it is correct whenever it changes. |
/approve @dhiller do you want anyone else to approve? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mazzystr 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 |
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.
Looks good, just a couple of suggestions.
func (o *options) Validate() error { | ||
if o.sigsFilePath == "" { | ||
return fmt.Errorf("path to sigs.yaml is required") | ||
} else { |
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 think we can remove tihs else
if response.StatusCode >= http.StatusOK && response.StatusCode < http.StatusMultipleChoices { | ||
foundOwners = append(foundOwners, ownersFileURL) | ||
} else { | ||
log.Printf("failed to retrieve %s", ownersFileURL) |
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.
Would be good to add response.StatusCode
here.
Signed-off-by: Daniel Hiller <dhiller@redhat.com>
@fgimenez addressed review comments, PTAL! Thanks! |
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
Thanks!
This PR adds a tool that can validate the basics of the
sigs.yaml
file. Currently it can validate/remove non existing links to owners elements.Also it updates the sigs.yaml with removed unreachable owners links.
/cc @mazzystr @fabiand @fgimenez