Skip to content

Conversation

@mtulio
Copy link
Contributor

@mtulio mtulio commented Oct 24, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Introduce CI step to validate the Go directive is according to the standard used in kubernetes project (ending with .0, x.y.0).

The step introduces the command verify-go-directive which will use a common script from cluster-api project to verify the directive is in conformance with the project standard.

Please leave a comment with your thoughts of which option would be ok to follow the practice by this project.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

The command is executed both in Github Actions and Prow, where Github Actions is handling correctly the exit code.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot
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

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mmerkes for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 24, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 24, 2025
@mtulio
Copy link
Contributor Author

mtulio commented Oct 24, 2025

/test all

Copy link
Contributor

@elmiko elmiko left a comment

Choose a reason for hiding this comment

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

this makes sense to me

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 24, 2025
@mtulio
Copy link
Contributor Author

mtulio commented Oct 24, 2025

I just added one more option to validate 'go.mod dotzero' using cluster-api practice, which would be preferred as shares practices from other kube projects (suggested by @damdo, TY). PTAL, would love to hear thoughts which path to go.

@mtulio
Copy link
Contributor Author

mtulio commented Oct 24, 2025

/test pull-cloud-provider-aws-check

@mtulio mtulio changed the title ci/gha: introduce step to check go.mod version ci/gomod: added CI validation to prevent changing patch version of Go from non-zero Oct 24, 2025
Comment on lines 50 to 66
gomod-dotzero-check:
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
show-progress: false
- name: "tests/e2e/go.mod must use Go version major.minor.0"
env:
GO_MOD_FILE: go.mod
run: |
test $(grep "^go " $GO_MOD_FILE | awk '{print $2}' | cut -d. -f3) != 0 && exit 1
- name: "tests/e2e/go.mod must use Go version major.minor.0"
env:
GO_MOD_FILE: tests/e2e/go.mod
run: |
test $(grep "^go " $GO_MOD_FILE | awk '{print $2}' | cut -d. -f3) != 0 && exit 1
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to drop this in favour of if the make check. As its passing as a presubmit should already be mandatory for PRs right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Being able to run the same checks locally would be very helpful, and then running that same check in an action gives us continual testing of that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to approach used by cluster-api, I am keeping in GHA while the problem is addressed.

@mtulio
Copy link
Contributor Author

mtulio commented Oct 27, 2025

pull-cloud-provider-aws-check is not reporting as expected, the new make command failed and it report as pass: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/cloud-provider-aws/1283/pull-cloud-provider-aws-check/1981728404394741760#1:build-log.txt%3A143

Suggested action items:

  • (short) use make verify-go-directive on GHA
  • (long) fix CI job to track exit code

@mtulio
Copy link
Contributor Author

mtulio commented Oct 27, 2025

pull-cloud-provider-aws-check is not reporting as expected, the new make command failed and it report as pass: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/cloud-provider-aws/1283/pull-cloud-provider-aws-check/1981728404394741760#1:build-log.txt%3A143

Suggested action items:

  • (short) use make verify-go-directive on GHA
  • (long) fix CI job to track exit code

Not sure if I am looking at the correct place, looks like the runner have expected flags to fail

@mtulio mtulio marked this pull request as ready for review October 27, 2025 19:19
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 27, 2025
@mtulio
Copy link
Contributor Author

mtulio commented Oct 27, 2025

/retest

@mtulio mtulio changed the title ci/gomod: added CI validation to prevent changing patch version of Go from non-zero ci/gomod: added CI steps to check Golang directives Oct 27, 2025
@mtulio mtulio changed the title ci/gomod: added CI steps to check Golang directives ci/gomod: added CI steps to check Golang directive Oct 27, 2025
@mtulio
Copy link
Contributor Author

mtulio commented Oct 27, 2025

/retest

Introduce the step to validate if the go.mod is in conformance with
Kubernetes project standard by using the patch version from the build env
(ending with .0, x.y.0).
@mtulio
Copy link
Contributor Author

mtulio commented Oct 28, 2025

PR ready for review based in the step gomod-dotzero-check logs:

curl --retry 3 -fsL https://raw.githubusercontent.com/kubernetes-sigs/cluster-api/refs/tags/v1.11.0/hack/verify-go-directive.sh | bash -s -- -g 1.24.0
Running go directive verify test for ./tests/e2e/go.mod
Running go directive verify test for ./go.mod

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

Thanks

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2025
Co-authored-by: Damiano Donati <damiano.donati@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2025
@mtulio
Copy link
Contributor Author

mtulio commented Oct 28, 2025

CI infra issues in job test.

/retest

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2025
@mtulio
Copy link
Contributor Author

mtulio commented Oct 28, 2025

/retest

1 similar comment
@mtulio
Copy link
Contributor Author

mtulio commented Oct 29, 2025

/retest

@k8s-ci-robot
Copy link
Contributor

@mtulio: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cloud-provider-aws-e2e-kubetest2-quick dedf7c4 link false /test pull-cloud-provider-aws-e2e-kubetest2-quick
pull-cloud-provider-aws-e2e-kubetest2 dedf7c4 link false /test pull-cloud-provider-aws-e2e-kubetest2

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants