Skip to content
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

Merged
merged 5 commits into from
Apr 27, 2021
Merged

Conversation

dhiller
Copy link
Contributor

@dhiller dhiller commented Apr 23, 2021

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

dhiller added 3 commits April 23, 2021 17:37
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>
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Apr 23, 2021
@mazzystr
Copy link
Contributor

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2021
@dhiller
Copy link
Contributor Author

dhiller commented Apr 23, 2021

/retest

Signed-off-by: Daniel Hiller <dhiller@redhat.com>
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 26, 2021
@dhiller
Copy link
Contributor Author

dhiller commented Apr 26, 2021

@mazzystr sorry, had to fix error regarding the devstats generator, PTAL! Thanks!

@dhiller
Copy link
Contributor Author

dhiller commented Apr 26, 2021

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.

@mazzystr
Copy link
Contributor

/approve

@dhiller do you want anyone else to approve?

@kubevirt-bot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2021
Copy link
Contributor

@fgimenez fgimenez left a 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 {
Copy link
Contributor

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)
Copy link
Contributor

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>
@dhiller
Copy link
Contributor Author

dhiller commented Apr 27, 2021

@fgimenez addressed review comments, PTAL! Thanks!

Copy link
Contributor

@fgimenez fgimenez left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks!

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2021
@kubevirt-bot kubevirt-bot merged commit 850759d into kubevirt:master Apr 27, 2021
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants