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

project-infra: add make targets lint and coverage #3825

Merged
merged 6 commits into from
Dec 19, 2024

Conversation

dhiller
Copy link
Contributor

@dhiller dhiller commented Dec 12, 2024

What this PR does / why we need it:

Adds the coverage and lint make targets and the initial .golangci-lint configuration.

Also it adds //nolint directive to some of the files.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #3822

Special notes for your reviewer:

@kubevirt-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubevirt-bot kubevirt-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Dec 12, 2024
Adds the lint make target and the initial .golangci-lint configuration.

Also it adds //nolint directive to some of the files

Signed-off-by: Daniel Hiller <[email protected]>
Adds a make target that writes a coverage report to ARTIFACTS output
directory sub directory.

Signed-off-by: Daniel Hiller <[email protected]>
@dhiller
Copy link
Contributor Author

dhiller commented Dec 16, 2024

/rehearse ?

@kubevirt-bot
Copy link
Contributor

Rehearsal is available for the following jobs in this PR:

pull-project-infra-lint
pull-project-infra-coverage

You can trigger rehearsal for all jobs by commenting either /rehearse or /rehearse all
on this PR.

For a specific PR you can comment /rehearse {job-name}.

For a list of jobs that you can rehearse you can comment /rehearse ?.

@dhiller
Copy link
Contributor Author

dhiller commented Dec 16, 2024

/rehearse

@kubevirt-bot
Copy link
Contributor

Rehearsal jobs created for this PR:

rehearsal-pull-project-infra-lint
rehearsal-pull-project-infra-coverage

You can trigger rehearsal for all jobs by commenting either /rehearse or /rehearse all
on this PR.

For a specific PR you can comment /rehearse {job-name}.

For a list of jobs that you can rehearse you can comment /rehearse ?.

@dhiller dhiller marked this pull request as ready for review December 16, 2024 12:47
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2024
@kubevirt-bot kubevirt-bot requested a review from xpivarc December 16, 2024 12:47
@dhiller dhiller changed the title lint: add make target lint project-infra: add make targets lint and coverage Dec 16, 2024
@dhiller dhiller marked this pull request as draft December 16, 2024 16:49
@kubevirt-bot kubevirt-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2024
Signed-off-by: Daniel Hiller <[email protected]>
@dhiller
Copy link
Contributor Author

dhiller commented Dec 17, 2024

/rehearse pull-project-infra-coverage

@kubevirt-bot
Copy link
Contributor

Rehearsal jobs created for this PR:

rehearsal-pull-project-infra-coverage

You can trigger rehearsal for all jobs by commenting either /rehearse or /rehearse all
on this PR.

For a specific PR you can comment /rehearse {job-name}.

For a list of jobs that you can rehearse you can comment /rehearse ?.

@dhiller
Copy link
Contributor Author

dhiller commented Dec 17, 2024

/rehearse pull-project-infra-lint

@kubevirt-bot
Copy link
Contributor

Rehearsal jobs created for this PR:

rehearsal-pull-project-infra-lint

You can trigger rehearsal for all jobs by commenting either /rehearse or /rehearse all
on this PR.

For a specific PR you can comment /rehearse {job-name}.

For a list of jobs that you can rehearse you can comment /rehearse ?.

@dhiller
Copy link
Contributor Author

dhiller commented Dec 17, 2024

/rehearse pull-project-infra-lint

@kubevirt-bot
Copy link
Contributor

Rehearsal jobs created for this PR:

rehearsal-pull-project-infra-lint

You can trigger rehearsal for all jobs by commenting either /rehearse or /rehearse all
on this PR.

For a specific PR you can comment /rehearse {job-name}.

For a list of jobs that you can rehearse you can comment /rehearse ?.

@dhiller dhiller marked this pull request as ready for review December 17, 2024 11:44
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 17, 2024
@dhiller
Copy link
Contributor Author

dhiller commented Dec 17, 2024

@brianmcarey mind taking a look? Rehearsal jobs work as expected. (Have decided to add the status in another PR.)

Copy link
Member

@brianmcarey brianmcarey left a comment

Choose a reason for hiding this comment

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

thanks @dhiller for this - added a couple of comments inline.

Makefile Outdated Show resolved Hide resolved
.golangci.yaml Show resolved Hide resolved
@@ -772,7 +772,7 @@ func (r *releaseData) getReleases() ([]*github.RepositoryRelease, error) {
return r.allReleases, nil
}

func (r *releaseData) autoDetectData(autoReleaseCadance string, autoPromoteAfterDays int) error {
func (r *releaseData) autoDetectData(autoReleaseCadance string, autoPromoteAfterDays int) error { //nolint:gocyclo
Copy link
Member

Choose a reason for hiding this comment

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

Are these nolints here just to get something running initially?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, also the git grep is to remind us to remove them

containers:
- args:
- |
GOBIN=/usr/local/bin/ go install github.com/onsi/ginkgo/v2/[email protected]
Copy link
Member

Choose a reason for hiding this comment

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

Having a specific image for this would remove the need for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true - but since we only need this in two cases currently I am not sure whether it's worth it. Also I don't want to put this into the golang image, doesn't seem like a good fit. Maybe some project-infra-test image? WDYT?
(I am not really sure whether we would want to tackle that in this PR, maybe create an issue as tracker?)

@dhiller
Copy link
Contributor Author

dhiller commented Dec 17, 2024

@brianmcarey addressed comments, PTAL thanks!

@dhiller dhiller requested a review from brianmcarey December 17, 2024 15:32
Copy link
Member

@brianmcarey brianmcarey left a comment

Choose a reason for hiding this comment

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

/approve

thanks @dhiller !

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2024
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brianmcarey

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 Dec 18, 2024
@dhiller
Copy link
Contributor Author

dhiller commented Dec 19, 2024

/override pull-project-infra-prow-deploy-test

@kubevirt-bot
Copy link
Contributor

@dhiller: Overrode contexts on behalf of dhiller: pull-project-infra-prow-deploy-test

In response to this:

/override pull-project-infra-prow-deploy-test

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-sigs/prow repository.

@kubevirt-bot kubevirt-bot merged commit 83f8029 into kubevirt:main Dec 19, 2024
9 checks passed
@kubevirt-bot
Copy link
Contributor

@dhiller: Updated the job-config configmap in namespace kubevirt-prow at cluster default using the following files:

  • key project-infra-presubmits.yaml using file github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-presubmits.yaml

In response to this:

What this PR does / why we need it:

Adds the coverage and lint make targets and the initial .golangci-lint configuration.

Also it adds //nolint directive to some of the files.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #3822

Special notes for your reviewer:

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-sigs/prow repository.

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.

lint: integrate golangci-lint into project setup
3 participants