From 9a9f8436f35f7855bd2643353c6bc8e92e27c888 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 16 Feb 2026 15:40:18 +0100 Subject: [PATCH 1/8] Replace linting setup with flint Adopt grafana/flint v0.2.0 to consolidate lint tasks previously sourced from grafana/docker-otel-lgtm and opentelemetry-java-contrib into a single set of reusable tasks. - Replace 9 lint tasks in mise.toml with 4 flint-based tasks - Merge super-linter.yml and lint-rest.yml into unified lint.yml workflow - Add Renovate custom manager for flint SHA-pinned URL tracking - Update CONTRIBUTING.md and CLAUDE.md lint command references - Clean up .editorconfig stale path references Signed-off-by: Gregor Zeitlinger --- .editorconfig | 2 +- .github/renovate.json5 | 7 ++++ .github/workflows/{lint-rest.yml => lint.yml} | 20 ++++++---- .github/workflows/super-linter.yml | 23 ----------- CLAUDE.md | 7 +++- CONTRIBUTING.md | 6 ++- mise.toml | 38 ++++++------------- 7 files changed, 41 insertions(+), 62 deletions(-) rename .github/workflows/{lint-rest.yml => lint.yml} (78%) delete mode 100644 .github/workflows/super-linter.yml diff --git a/.editorconfig b/.editorconfig index 8bf486f51..146d13757 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,5 +18,5 @@ max_line_length = 120 indent_size = 4 max_line_length = 120 -[{.mise/tasks/build-release.sh,.mise/tasks/lint/super-linter.sh,.mise/tasks/lint/links-in-modified-files.sh,.github/workflows/multi-version-test.yml,.github/workflows/lint-rest.yml}] +[{.mise/tasks/build-release.sh,.github/workflows/multi-version-test.yml}] max_line_length = 200 diff --git a/.github/renovate.json5 b/.github/renovate.json5 index f3bad3c6f..adc6c1dee 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -40,5 +40,12 @@ managerFilePatterns: ["/^mise\\.toml$/"], matchStrings: ['# renovate: datasource=(?[a-z-]+?)(?: depName=(?.+?))?(?: packageName=(?.+?))?(?: versioning=(?[a-z-]+?))?\\s.+?_VERSION="?(?[^@"]+?)(?:@(?sha256:[a-f0-9]+))?"?\\s'], }, + { + customType: "regex", + description: "Update flint version in raw.githubusercontent.com URLs (pinned to SHA)", + managerFilePatterns: ["/^mise\\.toml$/"], + matchStrings: ["https://raw\\.githubusercontent\\.com/(?[^/]+/[^/]+)/(?[a-f0-9]{40})/.*#\\s*(?v\\S+)"], + datasourceTemplate: "github-tags", + }, ], } diff --git a/.github/workflows/lint-rest.yml b/.github/workflows/lint.yml similarity index 78% rename from .github/workflows/lint-rest.yml rename to .github/workflows/lint.yml index b30c81443..2445a410c 100644 --- a/.github/workflows/lint-rest.yml +++ b/.github/workflows/lint.yml @@ -1,5 +1,5 @@ --- -name: Lint What Super Linter Can't +name: Lint on: pull_request: @@ -8,16 +8,20 @@ permissions: {} jobs: lint: + runs-on: ubuntu-24.04 + permissions: contents: read - runs-on: ubuntu-24.04 + steps: - - name: Check out + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - fetch-depth: 0 # needed for merge-base used in lint:links-in-modified-files - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 + fetch-depth: 0 + + - name: Setup mise + uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 - name: Remap main branch URLs to PR branch for link checking env: @@ -27,8 +31,8 @@ jobs: sed -i "/^remap = \[$/a\ \"https://github.com/prometheus/client_java/blob/main/(.*) https://github.com/${PR_HEAD_REPO}/blob/${GITHUB_HEAD_REF}/\$1\"," .github/config/lychee.toml sed -i "/^remap = \[$/a\ \"https://github.com/prometheus/client_java/tree/main/(.*) https://github.com/${PR_HEAD_REPO}/tree/${GITHUB_HEAD_REF}/\$1\"," .github/config/lychee.toml - - name: Lint for pull requests + - name: Lint env: GITHUB_TOKEN: ${{ github.token }} GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }} - run: mise run lint:rest-ci + run: mise run lint diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml deleted file mode 100644 index 332221bf7..000000000 --- a/.github/workflows/super-linter.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Lint - -on: [pull_request] - -jobs: - lint: - runs-on: ubuntu-24.04 - - permissions: - contents: read - - steps: - - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - fetch-depth: 0 - - - uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 - - - name: Super-linter - run: mise run lint:super-linter --no-fix diff --git a/CLAUDE.md b/CLAUDE.md index 406194944..3e5ed1592 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -91,7 +91,9 @@ Pre-built instrumentations: `prometheus-metrics-instrumentation-jvm`, `-caffeine ### Non-Java Files (Markdown, YAML, JSON, shell scripts, etc.) -- **ALWAYS** run `mise run lint:super-linter` after modifying non-Java files +- **ALWAYS** run `mise run lint` after modifying non-Java files + (runs super-linter + link checking + BOM check) +- `mise run fix` auto-fixes lint issues - Super-linter will **auto-fix** many issues (formatting, trailing whitespace, etc.) - It only reports ERROR-level issues (configured via `LOG_LEVEL=ERROR` in `.github/super-linter.env`) - Common issues caught: @@ -107,7 +109,8 @@ Pre-built instrumentations: `prometheus-metrics-instrumentation-jvm`, `-caffeine mise run build # After modifying non-Java files (run BEFORE committing) -mise run lint:super-linter +mise run lint +# or to auto-fix: mise run fix ``` ## Testing diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f27fdc257..2abbd91e2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,11 @@ Run `./mvnw spotless:apply` to format the code (only changed files) before commi Or run all the linters: -`mise run lint:super-linter` +`mise run lint` + +To autofix linting issues: + +`mise run fix` ## Running Tests diff --git a/mise.toml b/mise.toml index 97c7d96a7..3f403f7a0 100644 --- a/mise.toml +++ b/mise.toml @@ -47,38 +47,22 @@ run = "./mvnw verify" description = "build all modules without tests" run = "./mvnw install -DskipTests -Dcoverage.skip=true" +# Shared lint tasks from flint (https://github.com/grafana/flint) [tasks."lint:super-linter"] -description = "Run Super-Linter with auto-fix on the repository" -file = "https://raw.githubusercontent.com/grafana/docker-otel-lgtm/f5d39ffaf01b5bbe815b3821e4e3257db32f49e7/.mise/tasks/lint/super-linter.sh" +description = "Run Super-Linter on the repository" +file = "https://raw.githubusercontent.com/grafana/flint/d51085d44d29d60914eaf1d353a45a68bfccf352/tasks/lint/super-linter.sh" # v0.2.0 [tasks."lint:links"] -file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/links.sh" +description = "Lint links" +file = "https://raw.githubusercontent.com/grafana/flint/d51085d44d29d60914eaf1d353a45a68bfccf352/tasks/lint/links.sh" # v0.2.0 -[tasks."lint:local-links"] -file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/local-links.sh" +[tasks."lint"] +description = "Run all lints" +depends = ["lint:super-linter", "lint:links", "lint:bom"] -[tasks."lint:links-in-modified-files"] -file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/links-in-modified-files.sh" - -[tasks."lint:links-in-modified-files-ci"] -description = "Lint links in modified files (CI configuration)" -run = "mise run lint:links-in-modified-files --base origin/$GITHUB_BASE_REF --head $GITHUB_HEAD_SHA" - -[tasks."lint:links-in-modified-files-local"] -description = "Lint links in modified files (local configuration)" -run = "mise run lint:links-in-modified-files --base origin/main --head HEAD" - -[tasks."lint:rest"] -description = "All lints not covered by super linter" -depends = ["lint:bom", "lint:local-links", "lint:links-in-modified-files-local"] - -[tasks."lint:rest-ci"] -description = "All lints not covered by super linter (CI configuration)" -depends = ["lint:bom", "lint:local-links", "lint:links-in-modified-files-ci"] - -[tasks."lint:all"] -description = "All lints" -depends = ["lint:rest", "lint:super-linter"] +[tasks.fix] +description = "Auto-fix lint issues" +run = "AUTOFIX=true mise run lint" [tasks.acceptance-test] description = "Run OATs acceptance tests" From 1bc6cf80b59c9ca34327140ef6cc7265c0a9932f Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 16 Feb 2026 16:58:05 +0100 Subject: [PATCH 2/8] Add renovate-tracked-deps.json for dependency tracking Document which dependencies in mise.toml are managed by Renovate, following the same pattern used in flint and docker-otel-lgtm. Signed-off-by: Gregor Zeitlinger --- .github/config/.release-please-manifest.json | 3 +++ .github/config/release-please-config.json | 13 +++++++++++++ .github/renovate-tracked-deps.json | 15 +++++++++++++++ .github/workflows/pr-title.yml | 18 ++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 .github/config/.release-please-manifest.json create mode 100644 .github/config/release-please-config.json create mode 100644 .github/renovate-tracked-deps.json create mode 100644 .github/workflows/pr-title.yml diff --git a/.github/config/.release-please-manifest.json b/.github/config/.release-please-manifest.json new file mode 100644 index 000000000..dd8fde779 --- /dev/null +++ b/.github/config/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.5.0" +} diff --git a/.github/config/release-please-config.json b/.github/config/release-please-config.json new file mode 100644 index 000000000..131941946 --- /dev/null +++ b/.github/config/release-please-config.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "java", + "versioning": "always-bump-patch", + "extra-files": [ + "prometheus-metrics-parent/pom.xml", + "integration-tests/it-spring-boot-smoke-test/pom.xml" + ] + } + } +} diff --git a/.github/renovate-tracked-deps.json b/.github/renovate-tracked-deps.json new file mode 100644 index 000000000..48709ac1d --- /dev/null +++ b/.github/renovate-tracked-deps.json @@ -0,0 +1,15 @@ +{ + "mise.toml": { + "mise": [ + "go:github.com/gohugoio/hugo", + "go:github.com/grafana/oats", + "java", + "lychee", + "protoc" + ], + "regex": [ + "ghcr.io/super-linter/super-linter", + "grafana/flint" + ] + } +} diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 000000000..76a13e3df --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,18 @@ +--- +name: PR Title + +on: + pull_request: + types: + - opened + - edited +permissions: + pull-requests: read + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 + env: + GITHUB_TOKEN: ${{ github.token }} From dfeae84dcfebec0c3c81612e39ecc693f0f1f81b Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 16 Feb 2026 17:00:22 +0100 Subject: [PATCH 3/8] Move release-please config to .github/config/ Point the release-please workflow at the new config and manifest paths and remove the old root-level files. Signed-off-by: Gregor Zeitlinger --- .github/workflows/release-please.yml | 3 +++ .release-please-config.json | 13 ------------- .release-please-manifest.json | 3 --- 3 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 .release-please-config.json delete mode 100644 .release-please-manifest.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index f523b0d2d..75cf34f16 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -16,5 +16,8 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0 + id: release-please with: token: ${{ secrets.GITHUB_TOKEN }} + config-file: .github/config/release-please-config.json + manifest-file: .github/config/.release-please-manifest.json diff --git a/.release-please-config.json b/.release-please-config.json deleted file mode 100644 index 131941946..000000000 --- a/.release-please-config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", - "packages": { - ".": { - "release-type": "java", - "versioning": "always-bump-patch", - "extra-files": [ - "prometheus-metrics-parent/pom.xml", - "integration-tests/it-spring-boot-smoke-test/pom.xml" - ] - } - } -} diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index dd8fde779..000000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "1.5.0" -} From 5098439f313aac8d491604e07a419e5daa8317e7 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 16 Feb 2026 17:22:35 +0100 Subject: [PATCH 4/8] ci: add comment explaining fetch-depth: 0 in lint workflow Signed-off-by: Gregor Zeitlinger --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2445a410c..52124b131 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - fetch-depth: 0 + fetch-depth: 0 # needed for merge-base used in lint:links-in-modified-files - name: Setup mise uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 From 17268b74d4bb97b123070954c601604da8f4ece8 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 16 Feb 2026 17:39:13 +0100 Subject: [PATCH 5/8] style: fix Prettier formatting in renovate-tracked-deps.json Signed-off-by: Gregor Zeitlinger --- .github/renovate-tracked-deps.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/renovate-tracked-deps.json b/.github/renovate-tracked-deps.json index 48709ac1d..f515889dc 100644 --- a/.github/renovate-tracked-deps.json +++ b/.github/renovate-tracked-deps.json @@ -7,9 +7,6 @@ "lychee", "protoc" ], - "regex": [ - "ghcr.io/super-linter/super-linter", - "grafana/flint" - ] + "regex": ["ghcr.io/super-linter/super-linter", "grafana/flint"] } } From 908b4beb95e67607a51bfdb49830b0e0505eda03 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 16 Feb 2026 17:40:48 +0100 Subject: [PATCH 6/8] ci: fix line length in lint workflow URL remapping step Signed-off-by: Gregor Zeitlinger --- .github/workflows/lint.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 52124b131..cd68312f0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,8 +28,14 @@ jobs: GITHUB_HEAD_REF: ${{ github.head_ref }} PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} run: | - sed -i "/^remap = \[$/a\ \"https://github.com/prometheus/client_java/blob/main/(.*) https://github.com/${PR_HEAD_REPO}/blob/${GITHUB_HEAD_REF}/\$1\"," .github/config/lychee.toml - sed -i "/^remap = \[$/a\ \"https://github.com/prometheus/client_java/tree/main/(.*) https://github.com/${PR_HEAD_REPO}/tree/${GITHUB_HEAD_REF}/\$1\"," .github/config/lychee.toml + REPO="prometheus/client_java" + BASE="https://github.com" + CFG=".github/config/lychee.toml" + for T in blob tree; do + FROM="${BASE}/${REPO}/${T}/main/(.*)" + TO="${BASE}/${PR_HEAD_REPO}/${T}/${GITHUB_HEAD_REF}/\$1" + sed -i "/^remap = \[$/a\ \"${FROM} ${TO}\"," "${CFG}" + done - name: Lint env: From aa2ded36b7f4bcc76bd7a1350c35868d74a2c47d Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 16 Feb 2026 17:49:39 +0100 Subject: [PATCH 7/8] ci: suppress verbose bom output and fix lychee.toml line length Only print output from the BOM linter on errors, aligning with the super-linter idiom. Add lychee.toml to the relaxed editorconfig line-length group since URL remap patterns exceed 100 chars. Signed-off-by: Gregor Zeitlinger --- .editorconfig | 2 +- .mise/tasks/lint/bom.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 146d13757..80219f95e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,7 +7,7 @@ indent_size = 2 [{version-rules.xml,maven-wrapper.properties,checkstyle.xml,docker-compose.yaml,docker-compose.yml,Dockerfile,example_target_info.json,mise.toml,mvnm,mvnw.cmd,generate-protobuf.sh,.gitleaksignore,prometheus.properties}] max_line_length = 200 -[{grafana-dashboard-*.json,.editorconfig,super-linter.env,renovate.json5}] +[{grafana-dashboard-*.json,.editorconfig,super-linter.env,lychee.toml,renovate.json5}] max_line_length = 300 [pom.xml] diff --git a/.mise/tasks/lint/bom.py b/.mise/tasks/lint/bom.py index bada5bc9f..d77b88e23 100755 --- a/.mise/tasks/lint/bom.py +++ b/.mise/tasks/lint/bom.py @@ -36,7 +36,6 @@ def add_dir(dir_path: Path, want: List[str]): raise FileNotFoundError(f"Directory {dir_path} does not exist.") if any(dir_path.name == ig for ig in IGNORE_DIRS): - print(f"Skipping {dir_path}") return pom = dir_path / "pom.xml" @@ -47,7 +46,6 @@ def add_dir(dir_path: Path, want: List[str]): if not artifact_id: raise RuntimeError(f"No artifactId found in {pom}") - print(f"Found artifactId '{artifact_id}' in {pom}") want.append(artifact_id) @@ -108,7 +106,6 @@ def main() -> int: sys.stdout.writelines(diff) return 1 else: - print("BOM file is up to date.") return 0 except Exception as e: From 9cae5688dc909aa1b5b3317a4dca6fbff0ad92e6 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 16 Feb 2026 20:25:36 +0100 Subject: [PATCH 8/8] ci: upgrade flint to v0.4.0 and adopt renovate-deps lint - Update flint from v0.2.0 to v0.4.0 (SHA-pinned) - Use flint Renovate preset for custom managers - Remove manual URL remap step from lint workflow (now in flint) - Add lint:renovate-deps task and regenerate tracked deps Signed-off-by: Gregor Zeitlinger --- .github/renovate-tracked-deps.json | 548 +++++++++++++++++++++++++++++ .github/renovate.json5 | 18 +- .github/workflows/lint.yml | 17 +- mise.toml | 13 +- 4 files changed, 562 insertions(+), 34 deletions(-) diff --git a/.github/renovate-tracked-deps.json b/.github/renovate-tracked-deps.json index f515889dc..d3089ecb7 100644 --- a/.github/renovate-tracked-deps.json +++ b/.github/renovate-tracked-deps.json @@ -1,12 +1,560 @@ { + ".github/renovate.json5": { + "renovate-config-presets": ["grafana/flint"] + }, + ".mise/envs/native/mise.toml": { + "mise": ["java"] + }, + ".mvn/wrapper/maven-wrapper.properties": { + "maven-wrapper": ["maven"] + }, + "benchmarks/pom.xml": { + "maven": [ + "com.codahale.metrics:metrics-core", + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exposition-textformats", + "io.prometheus:simpleclient", + "org.openjdk.jmh:jmh-core", + "org.openjdk.jmh:jmh-generator-annprocess" + ] + }, + "integration-tests/it-common/pom.xml": { + "maven": [ + "io.prometheus:integration-tests", + "io.prometheus:prometheus-metrics-exposition-formats" + ] + }, + "integration-tests/it-exporter/it-exporter-duplicate-metrics-sample/pom.xml": { + "maven": [ + "io.prometheus:it-exporter", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-httpserver" + ] + }, + "integration-tests/it-exporter/it-exporter-httpserver-sample/pom.xml": { + "maven": [ + "io.prometheus:it-exporter", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-httpserver" + ] + }, + "integration-tests/it-exporter/it-exporter-no-protobuf/pom.xml": { + "maven": [ + "io.prometheus:it-exporter", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-httpserver" + ] + }, + "integration-tests/it-exporter/it-exporter-servlet-jetty-sample/pom.xml": { + "maven": [ + "io.prometheus:it-exporter", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-servlet-jakarta", + "org.eclipse.jetty.ee10:jetty-ee10-servlet", + "org.eclipse.jetty:jetty-server" + ] + }, + "integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/pom.xml": { + "maven": [ + "io.prometheus:it-exporter", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-servlet-jakarta", + "org.apache.tomcat.embed:tomcat-embed-core" + ] + }, + "integration-tests/it-exporter/it-exporter-test/pom.xml": { + "maven": ["io.prometheus:it-common", "io.prometheus:it-exporter"] + }, + "integration-tests/it-exporter/it-no-protobuf-test/pom.xml": { + "maven": ["io.prometheus:it-common", "io.prometheus:it-exporter"] + }, + "integration-tests/it-exporter/pom.xml": { + "maven": ["io.prometheus:integration-tests"] + }, + "integration-tests/it-pushgateway/pom.xml": { + "maven": [ + "com.jayway.jsonpath:json-path", + "com.squareup.okhttp:okhttp", + "io.prometheus:integration-tests", + "io.prometheus:it-common", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-pushgateway" + ] + }, + "integration-tests/it-spring-boot-smoke-test/pom.xml": { + "maven": [ + "com.diffplug.spotless:spotless-maven-plugin", + "io.prometheus:it-common", + "io.prometheus:prometheus-metrics-bom", + "org.junit:junit-bom", + "org.springframework.boot:spring-boot-starter-parent" + ] + }, + "integration-tests/pom.xml": { + "maven": [ + "commons-io:commons-io", + "io.prometheus:client_java", + "org.testcontainers:junit-jupiter" + ] + }, "mise.toml": { "mise": [ "go:github.com/gohugoio/hugo", "go:github.com/grafana/oats", "java", "lychee", + "node", + "npm:renovate", "protoc" ], "regex": ["ghcr.io/super-linter/super-linter", "grafana/flint"] + }, + "mvnw": { + "maven-wrapper": ["maven-wrapper"] + }, + "mvnw.cmd": { + "maven-wrapper": ["maven-wrapper"] + }, + "pom.xml": { + "maven": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_core", + "com.google.guava:guava", + "com.google.protobuf:protobuf-java", + "com.uber.nullaway:nullaway", + "io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha", + "io.opentelemetry:opentelemetry-proto", + "io.prometheus:client_java_parent", + "org.apache.felix:maven-bundle-plugin", + "org.apache.maven.plugins:maven-checkstyle-plugin", + "org.apache.maven.plugins:maven-clean-plugin", + "org.apache.maven.plugins:maven-compiler-plugin", + "org.apache.maven.plugins:maven-dependency-plugin", + "org.apache.maven.plugins:maven-deploy-plugin", + "org.apache.maven.plugins:maven-enforcer-plugin", + "org.apache.maven.plugins:maven-failsafe-plugin", + "org.apache.maven.plugins:maven-install-plugin", + "org.apache.maven.plugins:maven-jar-plugin", + "org.apache.maven.plugins:maven-javadoc-plugin", + "org.apache.maven.plugins:maven-resources-plugin", + "org.apache.maven.plugins:maven-shade-plugin", + "org.apache.maven.plugins:maven-site-plugin", + "org.apache.maven.plugins:maven-surefire-plugin", + "org.assertj:assertj-core", + "org.awaitility:awaitility", + "org.codehaus.mojo:build-helper-maven-plugin", + "org.codehaus.mojo:exec-maven-plugin", + "org.codehaus.mojo:versions-maven-plugin", + "org.jacoco:jacoco-maven-plugin", + "org.junit-pioneer:junit-pioneer", + "org.junit.jupiter:junit-jupiter", + "org.junit.jupiter:junit-jupiter-params", + "org.junit:junit-bom", + "org.mockito:mockito-core", + "org.slf4j:slf4j-simple", + "org.wiremock:wiremock" + ] + }, + "prometheus-metrics-bom/pom.xml": { + "maven": [ + "io.prometheus:client_java_parent", + "io.prometheus:prometheus-metrics-config", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-common", + "io.prometheus:prometheus-metrics-exporter-httpserver", + "io.prometheus:prometheus-metrics-exporter-opentelemetry", + "io.prometheus:prometheus-metrics-exporter-opentelemetry-no-otel", + "io.prometheus:prometheus-metrics-exporter-opentelemetry-otel-agent-resources", + "io.prometheus:prometheus-metrics-exporter-pushgateway", + "io.prometheus:prometheus-metrics-exporter-servlet-jakarta", + "io.prometheus:prometheus-metrics-exporter-servlet-javax", + "io.prometheus:prometheus-metrics-exposition-formats", + "io.prometheus:prometheus-metrics-exposition-formats-no-protobuf", + "io.prometheus:prometheus-metrics-exposition-textformats", + "io.prometheus:prometheus-metrics-instrumentation-caffeine", + "io.prometheus:prometheus-metrics-instrumentation-dropwizard", + "io.prometheus:prometheus-metrics-instrumentation-dropwizard5", + "io.prometheus:prometheus-metrics-instrumentation-guava", + "io.prometheus:prometheus-metrics-instrumentation-jvm", + "io.prometheus:prometheus-metrics-model", + "io.prometheus:prometheus-metrics-otel-support", + "io.prometheus:prometheus-metrics-simpleclient-bridge", + "io.prometheus:prometheus-metrics-tracer", + "io.prometheus:prometheus-metrics-tracer-common", + "io.prometheus:prometheus-metrics-tracer-initializer", + "io.prometheus:prometheus-metrics-tracer-otel", + "io.prometheus:prometheus-metrics-tracer-otel-agent" + ] + }, + "prometheus-metrics-config/pom.xml": { + "maven": ["io.prometheus:client_java"] + }, + "prometheus-metrics-core/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-config", + "io.prometheus:prometheus-metrics-exposition-formats-no-protobuf", + "io.prometheus:prometheus-metrics-model", + "io.prometheus:prometheus-metrics-tracer-initializer", + "org.apache.commons:commons-math3" + ] + }, + "prometheus-metrics-exporter-common/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exposition-formats", + "io.prometheus:prometheus-metrics-exposition-textformats", + "io.prometheus:prometheus-metrics-model" + ] + }, + "prometheus-metrics-exporter-httpserver/pom.xml": { + "maven": ["io.prometheus:client_java", "io.prometheus:prometheus-metrics-exporter-common"] + }, + "prometheus-metrics-exporter-opentelemetry-otel-agent-resources/pom.xml": { + "maven": [ + "io.opentelemetry:opentelemetry-api", + "io.opentelemetry:opentelemetry-context", + "io.prometheus:client_java" + ] + }, + "prometheus-metrics-exporter-opentelemetry-shaded/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-opentelemetry-otel-agent-resources" + ] + }, + "prometheus-metrics-exporter-opentelemetry/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-opentelemetry-otel-agent-resources" + ] + }, + "prometheus-metrics-exporter-pushgateway/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-common", + "org.mock-server:mockserver-netty-no-dependencies" + ] + }, + "prometheus-metrics-exporter-servlet-jakarta/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-common", + "jakarta.servlet:jakarta.servlet-api" + ] + }, + "prometheus-metrics-exporter-servlet-javax/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-common", + "javax.servlet:javax.servlet-api" + ] + }, + "prometheus-metrics-exposition-formats-shaded/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-exposition-textformats" + ] + }, + "prometheus-metrics-exposition-formats/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-exposition-textformats" + ] + }, + "prometheus-metrics-exposition-textformats/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-config", + "io.prometheus:prometheus-metrics-model" + ] + }, + "prometheus-metrics-instrumentation-caffeine/pom.xml": { + "maven": [ + "com.github.ben-manes.caffeine:caffeine", + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exposition-textformats" + ] + }, + "prometheus-metrics-instrumentation-dropwizard/pom.xml": { + "maven": [ + "io.dropwizard.metrics:metrics-core", + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-httpserver", + "io.prometheus:prometheus-metrics-exposition-textformats", + "io.prometheus:prometheus-metrics-instrumentation-dropwizard5" + ] + }, + "prometheus-metrics-instrumentation-dropwizard5/pom.xml": { + "maven": [ + "io.dropwizard.metrics5:metrics-core", + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-httpserver", + "io.prometheus:prometheus-metrics-exposition-textformats" + ] + }, + "prometheus-metrics-instrumentation-guava/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exposition-textformats" + ] + }, + "prometheus-metrics-instrumentation-jvm/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-core", + "io.prometheus:prometheus-metrics-exporter-httpserver", + "io.prometheus:prometheus-metrics-exposition-textformats" + ] + }, + "prometheus-metrics-model/pom.xml": { + "maven": ["io.prometheus:client_java", "io.prometheus:prometheus-metrics-config"] + }, + "prometheus-metrics-otel-support/pom.xml": { + "maven": ["io.prometheus:client_java"] + }, + "prometheus-metrics-parent/pom.xml": { + "maven": [ + "com.diffplug.spotless:spotless-maven-plugin", + "org.apache.maven.plugins:maven-gpg-plugin", + "org.apache.maven.plugins:maven-source-plugin", + "org.sonatype.central:central-publishing-maven-plugin" + ] + }, + "prometheus-metrics-simpleclient-bridge/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:prometheus-metrics-config", + "io.prometheus:prometheus-metrics-exposition-textformats", + "io.prometheus:prometheus-metrics-model", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_common" + ] + }, + "prometheus-metrics-tracer/pom.xml": { + "maven": ["io.prometheus:client_java"] + }, + "prometheus-metrics-tracer/prometheus-metrics-tracer-common/pom.xml": { + "maven": ["io.prometheus:prometheus-metrics-tracer"] + }, + "prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/pom.xml": { + "maven": [ + "io.prometheus:prometheus-metrics-tracer", + "io.prometheus:prometheus-metrics-tracer-common", + "io.prometheus:prometheus-metrics-tracer-otel", + "io.prometheus:prometheus-metrics-tracer-otel-agent" + ] + }, + "prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/pom.xml": { + "maven": [ + "io.prometheus:prometheus-metrics-tracer", + "io.prometheus:prometheus-metrics-tracer-common" + ] + }, + "prometheus-metrics-tracer/prometheus-metrics-tracer-otel/pom.xml": { + "maven": [ + "io.prometheus:prometheus-metrics-tracer", + "io.prometheus:prometheus-metrics-tracer-common" + ] + }, + "simpleclient-archive/integration_tests/it_common/pom.xml": { + "maven": ["io.prometheus:integration_tests"] + }, + "simpleclient-archive/integration_tests/it_exemplars_otel_agent/pom.xml": { + "maven": [ + "ch.qos.logback:logback-classic", + "io.prometheus:integration_tests", + "io.prometheus:it_common", + "io.prometheus:simpleclient_bom", + "io.prometheus:simpleclient_hotspot", + "io.prometheus:simpleclient_servlet", + "org.springframework.boot:spring-boot-dependencies", + "org.springframework.boot:spring-boot-maven-plugin" + ] + }, + "simpleclient-archive/integration_tests/it_exemplars_otel_sdk/pom.xml": { + "maven": [ + "io.opentelemetry:opentelemetry-api", + "io.opentelemetry:opentelemetry-sdk", + "io.prometheus:integration_tests", + "io.prometheus:it_common", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_httpserver" + ] + }, + "simpleclient-archive/integration_tests/it_java_versions/pom.xml": { + "maven": [ + "io.prometheus:integration_tests", + "io.prometheus:it_common", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_hotspot", + "io.prometheus:simpleclient_httpserver" + ] + }, + "simpleclient-archive/integration_tests/it_log4j2/pom.xml": { + "maven": [ + "io.prometheus:integration_tests", + "io.prometheus:it_common", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_httpserver", + "io.prometheus:simpleclient_log4j2", + "org.apache.logging.log4j:log4j-api", + "org.apache.logging.log4j:log4j-core" + ] + }, + "simpleclient-archive/integration_tests/it_pushgateway/pom.xml": { + "maven": [ + "ch.qos.logback:logback-classic", + "com.squareup.okhttp3:okhttp", + "io.prometheus:integration_tests", + "io.prometheus:it_common", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_pushgateway" + ] + }, + "simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/pom.xml": { + "maven": [ + "ch.qos.logback:logback-classic", + "com.squareup.okhttp3:okhttp", + "io.prometheus:integration_tests", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_hotspot", + "io.prometheus:simpleclient_servlet_jakarta", + "jakarta.servlet:jakarta.servlet-api", + "org.apache.maven.plugins:maven-war-plugin" + ] + }, + "simpleclient-archive/integration_tests/pom.xml": { + "maven": [ + "ch.qos.logback:logback-classic", + "com.squareup.okhttp3:okhttp", + "io.prometheus:client_java", + "org.testcontainers:testcontainers" + ] + }, + "simpleclient-archive/simpleclient_graphite_bridge/pom.xml": { + "maven": ["io.prometheus:client_java", "io.prometheus:simpleclient"] + }, + "simpleclient-archive/simpleclient_hibernate/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "org.hibernate:hibernate-core" + ] + }, + "simpleclient-archive/simpleclient_httpserver/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_common", + "javax.xml.bind:jaxb-api" + ] + }, + "simpleclient-archive/simpleclient_jetty/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "org.eclipse.jetty:jetty-server", + "org.eclipse.jetty:jetty-servlet", + "org.hamcrest:hamcrest-all" + ] + }, + "simpleclient-archive/simpleclient_jetty_jdk8/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "org.eclipse.jetty:jetty-server", + "org.eclipse.jetty:jetty-servlet", + "org.hamcrest:hamcrest-all" + ] + }, + "simpleclient-archive/simpleclient_log4j/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "org.apache.logging.log4j:log4j-1.2-api", + "org.apache.logging.log4j:log4j-core" + ] + }, + "simpleclient-archive/simpleclient_log4j2/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "org.apache.logging.log4j:log4j-core" + ] + }, + "simpleclient-archive/simpleclient_logback/pom.xml": { + "maven": [ + "ch.qos.logback:logback-classic", + "io.prometheus:client_java", + "io.prometheus:simpleclient" + ] + }, + "simpleclient-archive/simpleclient_servlet/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_common", + "io.prometheus:simpleclient_servlet_common", + "javax.servlet:javax.servlet-api", + "org.eclipse.jetty:jetty-servlet" + ] + }, + "simpleclient-archive/simpleclient_servlet_common/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_common" + ] + }, + "simpleclient-archive/simpleclient_servlet_jakarta/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_common", + "io.prometheus:simpleclient_servlet_common", + "jakarta.servlet:jakarta.servlet-api", + "org.eclipse.jetty:jetty-servlet" + ] + }, + "simpleclient-archive/simpleclient_spring_web/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_common", + "org.apache.commons:commons-lang3", + "org.aspectj:aspectjweaver", + "org.springframework:spring-aop", + "org.springframework:spring-context", + "org.springframework:spring-test", + "org.springframework:spring-web" + ] + }, + "simpleclient-archive/simpleclient_vertx/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_common", + "io.vertx:vertx-web" + ] + }, + "simpleclient-archive/simpleclient_vertx4/pom.xml": { + "maven": [ + "io.prometheus:client_java", + "io.prometheus:simpleclient", + "io.prometheus:simpleclient_common", + "io.vertx:vertx-web" + ] } } diff --git a/.github/renovate.json5 b/.github/renovate.json5 index adc6c1dee..ff4363ba5 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,6 +1,6 @@ { $schema: "https://docs.renovatebot.com/renovate-schema.json", - extends: ["config:best-practices", "config:recommended"], + extends: ["config:best-practices", "config:recommended", "github>grafana/flint"], platformCommit: "enabled", automerge: true, ignorePaths: [ @@ -33,19 +33,5 @@ matchPackageNames: ["/^io\\.prometheus:(examples|example-.+|integration-tests|it-.+)$/"], }, ], - customManagers: [ - { - customType: "regex", - description: "Update _VERSION variables in mise.toml", - managerFilePatterns: ["/^mise\\.toml$/"], - matchStrings: ['# renovate: datasource=(?[a-z-]+?)(?: depName=(?.+?))?(?: packageName=(?.+?))?(?: versioning=(?[a-z-]+?))?\\s.+?_VERSION="?(?[^@"]+?)(?:@(?sha256:[a-f0-9]+))?"?\\s'], - }, - { - customType: "regex", - description: "Update flint version in raw.githubusercontent.com URLs (pinned to SHA)", - managerFilePatterns: ["/^mise\\.toml$/"], - matchStrings: ["https://raw\\.githubusercontent\\.com/(?[^/]+/[^/]+)/(?[a-f0-9]{40})/.*#\\s*(?v\\S+)"], - datasourceTemplate: "github-tags", - }, - ], + customManagers: [], } diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd68312f0..c6a2575c1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,27 +18,14 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - fetch-depth: 0 # needed for merge-base used in lint:links-in-modified-files + fetch-depth: 0 # needed for git diff --merge-base in lint:links - name: Setup mise uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 - - name: Remap main branch URLs to PR branch for link checking - env: - GITHUB_HEAD_REF: ${{ github.head_ref }} - PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} - run: | - REPO="prometheus/client_java" - BASE="https://github.com" - CFG=".github/config/lychee.toml" - for T in blob tree; do - FROM="${BASE}/${REPO}/${T}/main/(.*)" - TO="${BASE}/${PR_HEAD_REPO}/${T}/${GITHUB_HEAD_REF}/\$1" - sed -i "/^remap = \[$/a\ \"${FROM} ${TO}\"," "${CFG}" - done - - name: Lint env: GITHUB_TOKEN: ${{ github.token }} GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} run: mise run lint diff --git a/mise.toml b/mise.toml index 3f403f7a0..604ff36e2 100644 --- a/mise.toml +++ b/mise.toml @@ -3,9 +3,12 @@ "go:github.com/grafana/oats" = "0.6.1" java = "temurin-25.0.2+10.0.LTS" lychee = "0.23.0" +node = "24.13.1" +"npm:renovate" = "43.8.5" protoc = "33.5" [env] +RENOVATE_TRACKED_DEPS_EXCLUDE="github-actions,github-runners" # renovate: datasource=docker depName=ghcr.io/super-linter/super-linter SUPER_LINTER_VERSION="v8.5.0@sha256:6831c0a801d353b510e4e468a3209a8a48bf0102e193d5c7e94e57667fdf64eb" @@ -50,15 +53,19 @@ run = "./mvnw install -DskipTests -Dcoverage.skip=true" # Shared lint tasks from flint (https://github.com/grafana/flint) [tasks."lint:super-linter"] description = "Run Super-Linter on the repository" -file = "https://raw.githubusercontent.com/grafana/flint/d51085d44d29d60914eaf1d353a45a68bfccf352/tasks/lint/super-linter.sh" # v0.2.0 +file = "https://raw.githubusercontent.com/grafana/flint/986a4ca33894e67ac54363fe9c814432ffd6dd9b/tasks/lint/super-linter.sh" # v0.4.0 [tasks."lint:links"] description = "Lint links" -file = "https://raw.githubusercontent.com/grafana/flint/d51085d44d29d60914eaf1d353a45a68bfccf352/tasks/lint/links.sh" # v0.2.0 +file = "https://raw.githubusercontent.com/grafana/flint/986a4ca33894e67ac54363fe9c814432ffd6dd9b/tasks/lint/links.sh" # v0.4.0 + +[tasks."lint:renovate-deps"] +description = "Verify renovate-tracked-deps.json is up to date" +file = "https://raw.githubusercontent.com/grafana/flint/986a4ca33894e67ac54363fe9c814432ffd6dd9b/tasks/lint/renovate-deps.py" # v0.4.0 [tasks."lint"] description = "Run all lints" -depends = ["lint:super-linter", "lint:links", "lint:bom"] +depends = ["lint:super-linter", "lint:links", "lint:bom", "lint:renovate-deps"] [tasks.fix] description = "Auto-fix lint issues"