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 presubmit check for verifying go directive changes #306

Merged

Conversation

MadhavJivrajani
Copy link
Contributor

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 #305
xref kubernetes/kubernetes#123744

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

@k8s-ci-robot k8s-ci-robot added sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Mar 6, 2024
@k8s-ci-robot
Copy link
Contributor

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

In response to this:

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 #305
xref kubernetes/kubernetes#123744

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

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 6, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 6, 2024
@MadhavJivrajani
Copy link
Contributor Author

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

@MadhavJivrajani MadhavJivrajani force-pushed the check-for-go-directive-bump branch 2 times, most recently from 95d906a to b716d8f Compare March 6, 2024 09:49
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.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
@dims
Copy link
Member

dims commented Mar 10, 2024

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2024
@k8s-ci-robot
Copy link
Contributor

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2024
@k8s-ci-robot k8s-ci-robot merged commit 4693a02 into kubernetes:master Mar 10, 2024
14 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add presubmit check to prevent accidental go directive bump
4 participants