diff --git a/.github/config/lychee.toml b/.github/config/lychee.toml index 70986bfb44..633748a9e5 100644 --- a/.github/config/lychee.toml +++ b/.github/config/lychee.toml @@ -9,12 +9,9 @@ max_concurrency = 4 # Check link anchors include_fragments = true -remap = [ - # workaround for https://github.com/lycheeverse/lychee/issues/1729 - "https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4" -] - exclude = [ # excluding links to pull requests and issues is done for performance "^https://github.com/open-telemetry/opentelemetry-java-contrib/(issues|pull)/\\d+$", + # groovy-lang.org is frequently unreachable / times out + "^https?://[^/]*groovy-lang\\.org", ] diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 84d4c27032..86a62ed9c5 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -243,6 +243,17 @@ }, ], customManagers: [ + { + // keep SHA-pinned raw.githubusercontent.com URLs in mise.toml up to date + customType: 'regex', + datasourceTemplate: 'github-tags', + managerFilePatterns: [ + '/^mise\\.toml$/', + ], + matchStrings: [ + 'https://raw\\.githubusercontent\\.com/(?[^/]+/[^/]+)/(?[a-f0-9]{40})/.*#\\s*(?v\\S+)', + ], + }, { customType: 'regex', datasourceTemplate: 'npm', diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml index d27cedfdff..bd7902f4c4 100644 --- a/.github/workflows/reusable-link-check.yml +++ b/.github/workflows/reusable-link-check.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: - fetch-depth: 0 # needed for merge-base used in lint:links-in-modified-files + fetch-depth: 0 # needed for merge-base used in modified-files mode - uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 @@ -20,12 +20,12 @@ jobs: if: github.event_name == 'pull_request' env: GITHUB_TOKEN: ${{ github.token }} - run: | - mise run lint:local-links - mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }} + GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} + run: mise run lint:links - name: Link check for pushes and scheduled workflows if: github.event_name != 'pull_request' env: GITHUB_TOKEN: ${{ github.token }} - run: mise run lint:links + run: mise run lint:links --full diff --git a/.mise/tasks/lint/links-in-modified-files.sh b/.mise/tasks/lint/links-in-modified-files.sh deleted file mode 100755 index 64ccbeb43a..0000000000 --- a/.mise/tasks/lint/links-in-modified-files.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Lint links in modified files" - -set -e - -#USAGE flag "--base " help="base branch to compare against (default: origin/main)" default="origin/main" -#USAGE flag "--head " help="head branch to compare against (empty for local changes) (default: empty)" default="" - -if [ "$usage_head" = "''" ]; then - usage_head="" -fi - -# Check if lychee config was modified -# - because usage_head may be empty -config_modified=$(git diff --name-only --merge-base "$usage_base" $usage_head \ - | grep -E '^(\.github/config/lychee\.toml|\.mise/tasks/lint/.*|mise\.toml)$' || true) - -if [ -n "$config_modified" ] ; then - echo "config changes, checking all files." - mise run lint:links -else - # Using lychee's default extension filter here to match when it runs against all files - # Note: --diff-filter=d filters out deleted files - # - because usage_head may be empty - modified_files=$(git diff --name-only --diff-filter=d "$usage_base" $usage_head \ - | grep -E '\.(md|mkd|mdx|mdown|mdwn|mkdn|mkdown|markdown|html|htm|txt)$' \ - | tr '\n' ' ' || true) - - if [ -z "$modified_files" ]; then - echo "No modified files, skipping link linting." - exit 0 - fi - - mise run lint:links $modified_files -fi - diff --git a/.mise/tasks/lint/links.sh b/.mise/tasks/lint/links.sh deleted file mode 100755 index 5f22566ad3..0000000000 --- a/.mise/tasks/lint/links.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Lint links in all files" - -set -e - -#USAGE arg "" var=#true help="files to check" default="." - -for f in $usage_file; do - echo "Checking links in file: $f" -done - -lychee --verbose --config .github/config/lychee.toml $usage_file diff --git a/.mise/tasks/lint/local-links.sh b/.mise/tasks/lint/local-links.sh deleted file mode 100755 index 3285761050..0000000000 --- a/.mise/tasks/lint/local-links.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Lint links in local files" - -set -e - -#USAGE arg "" var=#true help="files to check" default="." - -for f in $usage_file; do - echo "Checking links in file: $f" -done - -lychee --verbose --scheme file --include-fragments --config .github/config/lychee.toml $usage_file diff --git a/cel-sampler/README.md b/cel-sampler/README.md index 62f1ed5b1a..1ebeba7ec7 100644 --- a/cel-sampler/README.md +++ b/cel-sampler/README.md @@ -11,7 +11,7 @@ To use: * Follow the [instructions](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/incubator/README.md#declarative-configuration) to configure OpenTelemetry with declarative configuration. * Configure the `.tracer_provider.sampler` to include the `cel_based` sampler. -Support is now available for the java agent, see an [example here](https://github.com/open-telemetry/opentelemetry-java-examples/blob/main/javaagent). +Support is now available for the java agent, see an [example here](https://github.com/open-telemetry/opentelemetry-java-examples/tree/main/javaagent). ## Overview diff --git a/jmx-scraper/README.md b/jmx-scraper/README.md index 287dbad748..eb49ca9ba2 100644 --- a/jmx-scraper/README.md +++ b/jmx-scraper/README.md @@ -164,7 +164,7 @@ Like with the JMX Gatherer, the selection of provided metrics to use is still do However, there is now two distinct sets of metrics to select from using the `otel.jmx.target.source` configuration option: - `legacy`: [metrics definitions](./src/main/resources) equivalent to JMX Gatherer definitions to help transition and preserve compatibility -- `instrumentation`: [metrics definitions inherited from instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/jmx-metrics/library/src/main/resources/jmx/rules/), which is now used as a reference for JMX metrics, those also aim to provide better alignment with [metrics semantic conventions](https://opentelemetry.io/docs/specs/semconv/general/metrics/). +- `instrumentation`: [metrics definitions inherited from instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/jmx-metrics/library/src/main/resources/jmx/rules/), which is now used as a reference for JMX metrics, those also aim to provide better alignment with [metrics semantic conventions](https://opentelemetry.io/docs/specs/semconv/general/metrics/). In both cases, the metrics definitions themselves are embedded in the JMX Scraper binary, thus they will only change if the release version of the JMX Scraper binary changes. diff --git a/mise.toml b/mise.toml index 9cd21e80d4..b44c5c5fc8 100644 --- a/mise.toml +++ b/mise.toml @@ -11,3 +11,8 @@ idiomatic_version_file_enable_tools = [] windows_executable_extensions = ["sh"] windows_default_file_shell_args = "bash" use_file_shell_for_executable_tasks = true + +# Pick the tasks you need from flint (https://github.com/grafana/flint) +[tasks."lint:links"] +description = "Check for broken links in changed files + all local links" +file = "https://raw.githubusercontent.com/grafana/flint/8a39d96e17327c54974623b252eb5260d67ed68a/tasks/lint/links.sh" # v0.9.1 diff --git a/samplers/README.md b/samplers/README.md index e248dd9958..8915737b8e 100644 --- a/samplers/README.md +++ b/samplers/README.md @@ -13,7 +13,7 @@ To use: * Follow the [instructions](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/incubator/README.md#declarative-configuration) to configure OpenTelemetry with declarative configuration. * Configure the `.tracer_provider.sampler` to include the `rule_based_routing` sampler. -Support is now available for the java agent, see an [example here](https://github.com/open-telemetry/opentelemetry-java-examples/blob/main/javaagent). +Support is now available for the java agent, see an [example here](https://github.com/open-telemetry/opentelemetry-java-examples/tree/main/javaagent). Schema for `rule_based_routing` sampler: