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

introduce make help as default make recipe #3888

Merged
merged 17 commits into from
Apr 23, 2023
Merged

Conversation

STRRL
Copy link
Member

@STRRL STRRL commented Jan 9, 2023

What problem does this PR solve?

close #3769

What's changed and how it works?

In this PR, we provide a target called make help like this:

image

Related changes

  • This change also requires further updates to the website (e.g. docs)
  • This change also requires further updates to the UI interface
  • Need to cheery-pick to release branches
    • release-2.5
    • release-2.4

Checklist

CHANGELOG

  • I have updated the CHANGELOG.md
  • I have labeled this PR with "no-need-update-changelog"

Tests

  • Unit test
  • E2E test
  • No code
  • Manual test (add steps below)

Side effects

  • Breaking backward compatibility

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #3888 (36ae2f0) into master (e5c03c2) will decrease coverage by 0.09%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3888      +/-   ##
==========================================
- Coverage   38.62%   38.53%   -0.09%     
==========================================
  Files         167      167              
  Lines       13734    13734              
==========================================
- Hits         5305     5293      -12     
- Misses       7998     8003       +5     
- Partials      431      438       +7     

see 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7c633a...36ae2f0. Read the comment docs.

@STRRL STRRL changed the title use make help which print help message as default make recipe introduce make help which print help message as default make recipe Jan 11, 2023
@STRRL STRRL force-pushed the make-help branch 3 times, most recently from 6eefdae to 25fc391 Compare April 3, 2023 12:33
@STRRL STRRL changed the title introduce make help which print help message as default make recipe introduce make help as default make recipe Apr 3, 2023
STRRL added 12 commits April 12, 2023 14:03
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
@STRRL STRRL marked this pull request as ready for review April 12, 2023 06:37
@STRRL
Copy link
Member Author

STRRL commented Apr 12, 2023

/cc @g1eny0ung

PTAL

@g1eny0ung
Copy link
Member

I will look at it this afternoon and this evening.

Copy link
Member

@g1eny0ung g1eny0ung left a comment

Choose a reason for hiding this comment

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

The rest LGTM. As it's too late, I'll check it again this morning.

Makefile Outdated Show resolved Hide resolved
cmd/generate-makefile/generate_container_image_makefile.go Outdated Show resolved Hide resolved
cmd/generate-makefile/doc.go Outdated Show resolved Hide resolved
@@ -107,7 +107,7 @@ fi

if [ -z "$SKIP_IMAGE_BUILD" ]; then
echo "info: building docker images"
IMAGE_REGISTRY_PREFIX=$IMAGE_REGISTRY_PREFIX IMAGE_PROJECT=chaos-mesh IMAGE_TAG=$IMAGE_TAG UI=1 SWAGGER=1 make image
IMAGE_REGISTRY_PREFIX=$IMAGE_REGISTRY_PREFIX IMAGE_TAG=$IMAGE_TAG UI=1 SWAGGER=1 make image
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
IMAGE_REGISTRY_PREFIX=$IMAGE_REGISTRY_PREFIX IMAGE_TAG=$IMAGE_TAG UI=1 SWAGGER=1 make image
IMAGE_TAG=$IMAGE_TAG UI=1 SWAGGER=1 make image

If I understand correctly, now we are no longer providing the ability to customize the registry, and some targets with docker-push prefix also are being removed.

I agree with these changes, since it's easy to rename the image name with docker image tag, we don't need to keep these seemingly convenient, but somewhat redundant targets.

So the IMAGE_REGISTRY_PREFIX env should be removed here as well as others.

Copy link
Member Author

Choose a reason for hiding this comment

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

If I understand correctly, now we are no longer providing the ability to customize the registry, and some targets with docker-push prefix also are being removed.

Yeah, that's the thing I want to do: do NOT provide the flags/ENVs for configuring different registry/repo, but only during the building process.

It seems the changes in local-up-chaos-mesh.sh is NOT a part of building things but installing things.

So maybe it's better to revert the changes in local-up-chaos-mesh.sh.

If necessary, I would open another PR for similar changes, but for installing scripts like install.sh, local-up-chaos-mesh.sh and other .sh scripts.

What do you think about it? Reverting changes in local-up-chaos-mesh.sh

Copy link
Member

Choose a reason for hiding this comment

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

What do you think about it? Reverting changes in local-up-chaos-mesh.sh

I still don't think it's necessary because these scripts are used more for debugging purposes, and giving them more configurable items is often redundant. As I said above:

I agree with these changes, since it's easy to rename the image name with docker image tag, we don't need to keep these seemingly convenient, but somewhat redundant targets.

Copy link
Member

@g1eny0ung g1eny0ung Apr 13, 2023

Choose a reason for hiding this comment

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

So, keep modifying it like this. :) 🔧

Copy link
Member

Choose a reason for hiding this comment

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

@STRRL Only this place is not updated, after the update I will approve this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @g1eny0ung , I actually prefer to revert changes in local-up-chaos-mesh.sh in this PR.

I totally agree with your opinion. But it's a little out of the scope from this PR.

I would do it, but in another new PR. Not carry changes in .sh files in the PR.

What do you think about it?

Copy link
Member

Choose a reason for hiding this comment

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

But it's a little out of the scope from this PR.

@STRRL That sounds reasonable. I agree that we can wrap up the .sh modifications in the upcoming PR.

cmd/generate-makefile/generate_container_image_makefile.go Outdated Show resolved Hide resolved
@g1eny0ung g1eny0ung requested review from cwen0 and removed request for Hexilee April 13, 2023 06:35
Signed-off-by: STRRL <im@strrl.dev>
…enerating

Signed-off-by: STRRL <im@strrl.dev>
@cwen0
Copy link
Member

cwen0 commented Apr 18, 2023

Cool! I have run this pr on the environment, The make help is very useful!

Signed-off-by: STRRL <im@strrl.dev>
Copy link
Member

@g1eny0ung g1eny0ung left a comment

Choose a reason for hiding this comment

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

LGTM!

@g1eny0ung
Copy link
Member

/merge

@g1eny0ung g1eny0ung merged commit 0b31a51 into chaos-mesh:master Apr 23, 2023
@g1eny0ung
Copy link
Member

@chaos-mesh/maintainers @chaos-mesh/committers Please be aware that any additions or removals of make targets in the Makefile must now be done with consideration for modifying the template.

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

Successfully merging this pull request may close these issues.

Use code generation instead of eval in makefile
4 participants