openshift / cluster-monitoring-operator

Manage the OpenShift monitoring stack
Apache License 2.0
247 stars 363 forks source link

MON-3850: Lint CMO tests #2292

Closed rexagod closed 4 days ago

rexagod commented 6 months ago

Adds an explicit vet target and also integrates it into the verify flow to catch any such violations within the source code.


simonpasquier commented 6 months ago

Hmm I can't get go vet ./... to fail on my machine :-/

rexagod commented 6 months ago

Strange, are you on go1.21? I can reproduce this in a container if that's better.

machine424 commented 6 months ago

How about making use of golangci's govet https://golangci-lint.run/usage/linters/ and enable it for tests? that way we're sure it'll run in CI as well. (for now we skip all the tests https://github.com/openshift/cluster-monitoring-operator/blob/953011b1a4cdd66e2b42e16facca4ccc65079b7e/.golangci.yaml#L3 but I think we can have better filtering: we want some linters to run on tests as well)

openshift-ci-robot commented 5 months ago

@rexagod: This pull request references MON-3850 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set.

In response to [this](https://github.com/openshift/cluster-monitoring-operator/pull/2292): >Adds an explicit `vet` target and also integrates it into the `verify` flow to catch any such violations within the source code. > >*** > >* [ ] I added CHANGELOG entry for this change. >* [x] No user facing changes, so no entry in CHANGELOG was needed. > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fcluster-monitoring-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-bot commented 3 weeks ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

rexagod commented 1 week ago

/remove-lifecycle stale /cc @machine424

Pushed the suggested changes.

rexagod commented 4 days ago

(bump)

machine424 commented 4 days ago

/lgtm Thanks for this.

openshift-ci[bot] commented 4 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: machine424, rexagod, simonpasquier

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: - ~~[OWNERS](https://github.com/openshift/cluster-monitoring-operator/blob/master/OWNERS)~~ [machine424,rexagod,simonpasquier] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-ci[bot] commented 4 days ago

@rexagod: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
openshift-bot commented 4 days ago

[ART PR BUILD NOTIFIER]

Distgit: cluster-monitoring-operator This PR has been included in build cluster-monitoring-operator-container-v4.18.0-202410162014.p0.g82de4b7.assembly.stream.el9. All builds following this will include this PR.