diff --git a/.github/.lychee.toml b/.github/.lychee.toml deleted file mode 100644 index 6dea0efc..00000000 --- a/.github/.lychee.toml +++ /dev/null @@ -1,16 +0,0 @@ -include_fragments = true - -accept = ["200..=299", "403"] - -exclude = [ - # excluding links to pull requests and issues is done for performance - "^https://github.com/open-telemetry/opentelemetry-specification/(issues|pull)/\\d+$", - # TODO (trask) look into this - "^https://docs.google.com/document/d/1d0afxe3J6bQT-I6UbRXeIYNcTIyBQv4axfjKF4yvAPA/edit" -] - -# better to be safe and avoid failures -max_retries = 6 - -# this helps slow down the rate of requests to avoid rate limiting -max_concurrency = 4 diff --git a/.github/config/lychee.toml b/.github/config/lychee.toml new file mode 100644 index 00000000..6dfffd34 --- /dev/null +++ b/.github/config/lychee.toml @@ -0,0 +1,19 @@ +timeout = 30 +retry_wait_time = 5 +max_retries = 6 +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', +] + +accept = ["200..=299", "403"] + +exclude = [ + # excluding links to pull requests and issues is done for performance + '^https://github.com/open-telemetry/opentelemetry-configuration/(issues|pull)/\d+$', +] diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 8d51a91d..246c4572 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -13,10 +13,6 @@ { "matchUpdateTypes": ["minor", "major"], "schedule": ["before 8am on Monday"] - }, - { - "matchPackageNames": ["lycheeverse/lychee-action"], - "enabled": false } ], "labels": [ diff --git a/.github/workflows/build-check.yaml b/.github/workflows/build-check.yaml index 1332dcae..fe6f6336 100644 --- a/.github/workflows/build-check.yaml +++ b/.github/workflows/build-check.yaml @@ -42,17 +42,3 @@ jobs: echo $(git diff --cached) exit 1 fi - - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - # pinning this to v2.4.1 as newer versions break things - - uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2.4.1 - with: - # excluding links to pull requests and issues is done for performance - args: > - --config .github/.lychee.toml - -v - . diff --git a/.github/workflows/markdown-link-check.yml b/.github/workflows/markdown-link-check.yml new file mode 100644 index 00000000..70fef151 --- /dev/null +++ b/.github/workflows/markdown-link-check.yml @@ -0,0 +1,31 @@ +name: Link check + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 0 # needed for merge-base used in lint:links-in-modified-files + + - uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1 + + - name: Link check - relative links (all files) + if: github.event_name == 'pull_request' + env: + GITHUB_TOKEN: ${{ github.token }} + run: mise run lint:local-links + + - name: Link check (modified files only) + env: + GITHUB_TOKEN: ${{ github.token }} + run: mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }} --event ${{ github.event_name }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c70ff447..03bf6d83 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -170,7 +170,7 @@ Another example: } ``` -`oneOf` is used to specify that the `value` property matches the [standard attribute](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/common#standard-attribute) definition, and is either a primitive or array of primitives. This type of use is acceptable but should be used judiciously. +`oneOf` is used to specify that the `value` property matches the [standard attribute](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#standard-attribute) definition, and is either a primitive or array of primitives. This type of use is acceptable but should be used judiciously. ### Annotations - title and description diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..2f3504de --- /dev/null +++ b/mise.toml @@ -0,0 +1,21 @@ +[tools] +lychee = "0.20.1" + +[settings] +# Only install tools explicitly defined in the [tools] section above +idiomatic_version_file_enable_tools = [] + +# Windows configuration for file-based tasks +# Based on: https://github.com/jdx/mise/discussions/4461 +windows_executable_extensions = ["sh"] +windows_default_file_shell_args = "bash" +use_file_shell_for_executable_tasks = true + +[tasks."lint:links"] +file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/links.sh" + +[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: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"