Skip to content

feat: add make help target to Makefile #1248

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 3 commits into from
Jul 23, 2025
Merged

Conversation

Jont828
Copy link
Contributor

@Jont828 Jont828 commented Jul 9, 2025

Reason for Change:

Running make help now searches for all make targets with a doc comment and produces the following output.

Usage:
  make <target>

Development
  manifests                  Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
  generate                   Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
  unit-test                  Run unit tests.
  create-rg                  Create resource group
  create-acr                 Create test ACR
  create-aks-cluster         Create test AKS cluster (with msi, oidc, and workload identity enabled)
  create-aks-cluster-with-kaito  Create test AKS cluster (with msi, oidc and kaito enabled)
  create-aks-cluster-for-karpenter  Create test AKS cluster (with msi, cilium, oidc, and workload identity enabled)
  deploy-aws-cloudformation  Deploy AWS CloudFormation stack
  create-eks-cluster         Create test EKS cluster
  docker-buildx              Build and push docker image for the manager for cross-platform support
  az-patch-install-helm      Update Azure client env vars and settings in helm values.yml
  generate-identities        Create identities for the provisioner component.
  gpu-provisioner-helm       Update Azure client env vars and settings in helm values.yml
  azure-karpenter-helm       Update Azure client env vars and settings in helm values.yml

Build
  build-workspace            Build manager binary.
  run-workspace              Run a controller from your host.

Build Dependencies

Deployment
  controller-gen             Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
  envtest                    Download envtest-setup locally if necessary.
  vet                        Run go vet against code.
  fmt                        Run go fmt against code.

Help:
  help                       Display this help.

Requirements

  • added unit tests and e2e tests (if applicable).

Issue Fixed:

Notes for Reviewers:

Copy link

kaito-pr-agent bot commented Jul 9, 2025

Title

Add make help target for usage instructions


Description

  • Added make help target to Makefile

  • Enhances user experience by providing usage instructions


Changes walkthrough 📝

Relevant files
Enhancement
Makefile
Added `make help` target                                                                 

Makefile

  • Added make help target to display usage instructions
  • Used awk to parse comments and print formatted help text
  • +9/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    kaito-pr-agent bot commented Jul 9, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Documentation

    Ensure that the help message is clear and comprehensive, covering all necessary targets and their descriptions.

    help: ## Display this help.
    	@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

    Copy link

    kaito-pr-agent bot commented Jul 9, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Add error handling to help

    Ensure the help target is compatible with different versions of awk and handles
    potential errors gracefully.

    Makefile [544-545]

     help: ## Display this help.
    -	@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
    +	@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m<target>\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) || echo "Failed to generate help"
    Suggestion importance[1-10]: 6

    __

    Why: The suggestion adds basic error handling by appending || echo "Failed to generate help" to the awk command, which is a reasonable improvement for robustness. However, it does not address compatibility across different versions of awk, so the score is not higher.

    Low

    Copy link
    Collaborator

    @chewong chewong left a comment

    Choose a reason for hiding this comment

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

    Thanks for the PR! Could you also help add comments to targets with no comments (like lint, fmt, etc)?

    @Jont828
    Copy link
    Contributor Author

    Jont828 commented Jul 22, 2025

    @chewong Should be done!

    @chewong
    Copy link
    Collaborator

    chewong commented Jul 22, 2025

    @Jont828 please update the PR title to use Semantic Commit Message style 😄

    @Jont828 Jont828 changed the title Add make help target to Makefile feat: add make help target to Makefile Jul 23, 2025
    @chewong chewong merged commit ee0c3d0 into kaito-project:main Jul 23, 2025
    10 of 12 checks passed
    @Jont828 Jont828 deleted the make-help branch July 23, 2025 17:58
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: Done
    Development

    Successfully merging this pull request may close these issues.

    2 participants