10000 Add `make help` command to list available Makefile targets and descriptions by Naman-B-Parlecha · Pull Request #16732 · prometheus/prometheus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add make help command to list available Makefile targets and descriptions #16732

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Naman-B-Parlecha
Copy link

Resolves: #16729

This PR introduces a make help command that displays all available Makefile targets along with their descriptions to eliminating the need to manually scan through the Makefile.

Usage:

make help

Result:

Usage:
  make <target>

Main Targets:
  help                  Displays commands and their descriptions.
  update-npm-deps       Update Prometheus web UI npm dependencies to minor versions
  upgrade-npm-deps      Upgrade Prometheus web UI npm dependencies to latest versions
  ui-bump-version       Bump Prometheus web UI version and update package files
  ui-install            Install npm dependencies for Prometheus web UI
  ui-build              Build Prometheus web UI assets
  ui-build-module       Build Prometheus web UI as a module
  ui-test               Run Prometheus web UI tests
  ui-lint               Lint Prometheus web UI code
  assets                Build and embed Prometheus web UI assets (Skipped if using pre-built assets)
  npm_licenses          Bundle npm license files for Prometheus web UI (Skipped if using pre-built assets)
  assets-compress       Compress Prometheus web UI assets for distribution
  assets-tarball        Package Prometheus web UI assets into tarball
  parser                Generate Prometheus PromQL parser Go code using goyacc
  clean-parser          Remove generated Prometheus PromQL parser files
  check-generated-parser  Verify Prometheus PromQL parser is up to date
  install-goyacc        Install goyacc tool for Prometheus PromQL parser generation
  test                  Run all Prometheus tests including Go, UI, and parser checks (To test Go only set GO_ONLY=1)
  tarball               Create Prometheus release tarball with licenses
  docker                Build Prometheus Docker image with licenses
  plugins               Generate Prometheus plugins list from plugins.yml
  build                 Build complete Prometheus binary with UI, licenses, and plugins
  bench_tsdb            Run Prometheus TSDB benchmarks and generate profiling reports
  cli-documentation     Generate Prometheus and promtool command-line documentation
  check-go-mod-version  Verify Prometheus go.mod version consistency
  update-all-go-deps    Update all Prometheus Go dependencies including examples

Common Targets:
  common-all            Run all Prometheus quality checks and build
  common-style          Check Go code formatting with gofmt
  common-check_license  Verify Prometheus license headers in Go files
  common-deps           Download Go module dependencies
  update-go-deps        Update all Go dependencies to latest versions
  common-test-short     Run short Go tests only
  common-test           Run all Go tests including race detection
  common-format         Format Go code with gofmt and golangci-lint
  common-vet            Run Go vet static analysis
  common-lint           Run golangci-lint code analysis
  common-lint-fix       Run golangci-lint with auto-fix enabled
  common-yamllint       Lint all YAML files in repository
  common-staticcheck    Run static code analysis (deprecated, use lint)
  common-unused         Check for unused dependencies in go.mod
  common-build          Build Prometheus project binaries using promu
  common-tarball        Create Prometheus release tarball with binaries
  common-docker-repo-name  Print Prometheus Docker repository name
  common-docker         Build Prometheus Docker images for all architectures
  common-docker-publish  Push Prometheus Docker images to registry
  common-docker-tag-latest  Tag Prometheus Docker images as latest and version
  common-docker-manifest  Create and push multi-arch Prometheus Docker manifest
  promu                 Install or ensure promu Prometheus build tool is available
  common-proto          Generate Go code from protobuf files
  precheck              Run prerequisite checks for required Prometheus tools
  govulncheck           Run Go vulnerability scanner
  install-govulncheck   Install Go vulnerability checker tool

Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Copy link
Member
@metalmatze metalmatze left a comment

Choose a reason for hiding this comment

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

Don't have a strong opinion on having or not having this functionality. I still open the Makefile in most cases.
The changes to the prometheus-mixin look fine.

@Naman-B-Parlecha
Copy link
Author
Naman-B-Parlecha commented Jun 16, 2025

Don't have a strong opinion on having or not having this functionality. I still open the Makefile in most cases. The changes to the prometheus-mixin look fine.

It will be useful for new contributors and for quick referencing i believe

Never bad to have something like this?
Thanos implements something similar as well

Copy link
Member
@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Nice!

Some comments and suggestion, but overall looks good. Thanks!

I do think some basic help and nice list of possible commands can help 💪🏽

@@ -35,44 +35,50 @@ ifdef PREBUILT_ASSETS_STATIC_DIR
SKIP_UI_BUILD = true
endif

help: ## Displays commands and their descriptions.
Copy link
Member

Choose a reason for hiding this comment

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

This is great, I only wonder if we shouldn't do this in Makefile.common which we propagate cross organization (via https://github.com/prometheus/prometheus/blob/main/scripts/sync_repo_files.sh).

WDYT @SuperQ ?

Signed-off-by: NamanParlecha <namanparlecha@gmail.com>
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
@Naman-B-Parlecha Naman-B-Parlecha force-pushed the NamanParlecha/make-help-command branch from d7d5f32 to 703de20 Compare June 19, 2025 17:47
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
@Naman-B-Parlecha
Copy link
Author

@bwplotka refactored, have a look and let me know if any changes are required

Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add make help target to list available Makefile commands
3 participants
0