Skip to content

🌱 (ci) - Add test for release mock #4939

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

camilamacedo86
Copy link
Member

No description provided.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 19, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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 Jul 19, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 19, 2025
@camilamacedo86 camilamacedo86 force-pushed the test-release branch 6 times, most recently from 559fefa to e7c407f Compare July 19, 2025 20:01
@camilamacedo86 camilamacedo86 changed the title (ci) - Add test for release mock 🌱 (ci) - Add test for release mock Jul 19, 2025
Copy link
Contributor

@bavarianbidi bavarianbidi left a comment

Choose a reason for hiding this comment

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

nice idea.
One small comment

Comment on lines +48 to +59
- name: Init project using built kubebuilder binary and check cliVersion
run: |
mkdir test-operator && cd test-operator
go mod init test-operator
chmod +x ../dist/kubebuilder_linux_amd64_v1/kubebuilder
../dist/kubebuilder_linux_amd64_v1/kubebuilder init --domain example.com

echo "PROJECT file content:"
cat PROJECT

echo "Verifying cliVersion value..."
grep '^cliVersion: 4.5.3-rc.1$' PROJECT
Copy link
Contributor

Choose a reason for hiding this comment

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

for the init subcommand we already have e2e-tests. If it's just to test the generated binary via goreleaser, than this might be a simpler approach - WDYT?

Suggested change
- name: Init project using built kubebuilder binary and check cliVersion
run: |
mkdir test-operator && cd test-operator
go mod init test-operator
chmod +x ../dist/kubebuilder_linux_amd64_v1/kubebuilder
../dist/kubebuilder_linux_amd64_v1/kubebuilder init --domain example.com
echo "PROJECT file content:"
cat PROJECT
echo "Verifying cliVersion value..."
grep '^cliVersion: 4.5.3-rc.1$' PROJECT
- name: check kubebuilder cliVersion
run: |
echo "Verifying cliVersion value..."
../dist/kubebuilder_linux_amd64_v1/kubebuilder init | grep '4.5.3-rc.1'

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is nice we have the content in case it fails, so we do not need to take the steps locally to discover the reason. WDYT? Could we proceed as it is?

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, we can proceed as it is.

The following is just a small Feedback from a new contributor PoV:
I totally got your intention and the way you've implemented this, is definitely cool.
But I also love the "defacto standard" in the k8s ecosystem where mostly a make lint && make test works out of the box on my machine and I get early feedback - even before i push and raise a PR.

And sometimes users have to spend more time in understanding and fixing code/tests which are not covered by a local test setup (which sometimes isn't that easy for sure).

Having this scenario as ginkgo based e2e-test would make it more accessible, as at least the .github folder is something I mostly do not care about.
But this also introduces new complexity - and we have to deal with that as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

We use Goreleaser and GitHub Actions for our release process.
This test is specifically validating Goreleaser / Release process

Why do we check the CliVersion?
Because it's only output from the Binary released.
(tag version);Not from the one build with make install.
See: https://github.com/kubernetes-sigs/kubebuilder/blob/master/build/.goreleaser.yml#L35

That’s why this doesn’t quite fit in the standard GoLang e2e test suite—what we really want is to test the release process itself, not just the CLI in isolation.

@bavarianbidi
Copy link
Contributor

/lgtm

@k8s-ci-robot
Copy link
Contributor

@bavarianbidi: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 23, 2025
@k8s-ci-robot k8s-ci-robot merged commit 18ee4b1 into kubernetes-sigs:master Jul 23, 2025
23 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

3 participants