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

🐛 (go/v4) fix makefile target to build images ensuring its single responsibility #3353

Merged

Conversation

camilamacedo86
Copy link
Member

Description

fix makefile target to build images ensuring its single responsibility

Motivation

When we call make build we want only to build the image and run the tests is not a pre-requirement. It can make take too long to build the image.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 22, 2023
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 22, 2023
@@ -72,7 +72,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
docker-build: ## Build docker image with the manager.
Copy link
Member

Choose a reason for hiding this comment

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

@camilamacedo86 Was there any specific reason to remove the test target apart from it taking long time. I'm still inclined towards us keeping it, as if the test fails the user would know the issue before proceeding to building the image. Imo I don't see any harm in having test target before building image.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Following scenarios where does not respect single responsibility one this brings bad side effect:

If you use a tool to create a project and want to either release the project or use it for development purposes, you may encounter a situation where you need to wait for all tests to be complete before building the image. This can be frustrating if you have many tests and only want to build the image.

In addition, when you perform Continuous Integration (CI) to test your project, you may need to run all tests again before building the image if you have an end-to-end (e2e) test. This process can significantly increase the time it takes for your CI job to complete and force you to repeat all tests when you only need to build an image.

Why do I need to run the tests before building the image?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 5, 2023
@camilamacedo86
Copy link
Member Author

@varshaprasad96 thank you for the review, can we merge this one now?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 6, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2023
Copy link
Contributor

@Kavinjsir Kavinjsir left a comment

Choose a reason for hiding this comment

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

I'm cool with either side. To me, it feels like this is something that depends on the user side.
(And I personally prefer making the content of a target more focused on itself)

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 15, 2023
Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, Kavinjsir, varshaprasad96

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 [camilamacedo86,varshaprasad96]

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

@Kavinjsir
Copy link
Contributor

/retest pull-kubebuilder-e2e-k8s-1-27-1

@k8s-ci-robot
Copy link
Contributor

@Kavinjsir: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test pull-kubebuilder-e2e-k8s-1-25-3
  • /test pull-kubebuilder-e2e-k8s-1-26-0
  • /test pull-kubebuilder-e2e-k8s-1-27-1
  • /test pull-kubebuilder-test

Use /test all to run all jobs.

In response to this:

/retest pull-kubebuilder-e2e-k8s-1-27-1

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.

@Kavinjsir
Copy link
Contributor

/retest

@camilamacedo86
Copy link
Member Author

/test pull-kubebuilder-e2e-k8s-1-26-0

@k8s-ci-robot k8s-ci-robot merged commit cd1341d into kubernetes-sigs:master Aug 25, 2023
13 of 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. 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.

4 participants