kubernetes / utils

Non-Kubernetes-specific utility libraries which are consumed by multiple projects.
Apache License 2.0
331 stars 196 forks source link

.*: add presubmit check for verifying go directive changes #306

Closed MadhavJivrajani closed 7 months ago

MadhavJivrajani commented 7 months ago

This commit adds a script that checks the changed version in the go.mod file with a certain maximum version that the go directive can have.

We set the maximum version of the go directive as 1.20 here because the oldest go directive that exists on our supported release branches in k/k is 1.20.

This commit additionally changes the requisite GH action to incorporate this check.

Fixes https://github.com/kubernetes/utils/issues/305 xref https://github.com/kubernetes/kubernetes/issues/123744

/sig architecture /area code-organization /kind cleanup /assign @dims @liggitt

k8s-ci-robot commented 7 months ago

@MadhavJivrajani: The label(s) area/code-organization cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/kubernetes/utils/pull/306): >This commit adds a script that checks the changed version in the go.mod file with a certain maximum version that the go directive can have. > >We set the maximum version of the go directive as 1.20 here because the oldest go directive that exists on our supported release branches in k/k is 1.20. > >This commit additionally changes the requisite GH action to incorporate this check. > >Fixes https://github.com/kubernetes/utils/issues/305 >xref https://github.com/kubernetes/kubernetes/issues/123744 > >/sig architecture >/area code-organization >/kind cleanup >/assign @dims @liggitt 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/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
MadhavJivrajani commented 7 months ago

Successful run in the normal case: https://github.com/kubernetes/utils/actions/runs/8169957204/job/22335081807?pr=306 Failing run in invalid case when I try and change go.mod to 1.21: https://github.com/kubernetes/utils/actions/runs/8169981509/job/22335158126?pr=306

dims commented 7 months ago

/approve /lgtm

k8s-ci-robot commented 7 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, MadhavJivrajani

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/kubernetes/utils/blob/master/OWNERS)~~ [dims] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment