diff --git a/.github/lychee.toml b/.github/lychee.toml new file mode 100644 index 00000000000..a228cd08436 --- /dev/null +++ b/.github/lychee.toml @@ -0,0 +1,11 @@ +include-fragments = true + +accept = ["200..=299", "429"] + +exclude = [ + "^http(s)?://localhost", + "^http(s)?://example.com" +] + +# better to be safe and avoid failures +max-retries = 6 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index e6d4225e673..eb6f0ee0e15 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -18,10 +18,6 @@ concurrency: permissions: read-all -env: - # renovate: datasource=github-releases depName=tcort/markdown-link-check - MD_LINK_CHECK_VERSION: "3.12.2" - jobs: changelog: runs-on: ubuntu-latest @@ -81,12 +77,8 @@ jobs: # In order to validate any links in the yaml file, render the config to markdown - name: Render .chloggen changelog entries run: make chlog-preview > changelog_preview.md - - name: Install markdown-link-check - run: npm install -g markdown-link-check@${{ env.MD_LINK_CHECK_VERSION }} - - name: Run markdown-link-check - run: | - npx --no -- markdown-link-check \ - --verbose \ - --config .github/workflows/check_links_config.json \ - changelog_preview.md \ - || { echo "Check that anchor links are lowercase"; exit 1; } + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 + with: + args: "--verbose --no-progress ./changelog_preview.md --config .github/lychee.toml" diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index 7fbda8f515e..23f608c689a 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -49,13 +49,8 @@ jobs: with: fetch-depth: 0 - - name: Install markdown-link-check - run: npm install -g markdown-link-check@${{ env.MD_LINK_CHECK_VERSION }} - - - name: Run markdown-link-check - run: | - npx --no -- markdown-link-check \ - --verbose \ - --config .github/workflows/check_links_config.json \ - ${{needs.changedfiles.outputs.files}} \ - || { echo "Check that anchor links are lowercase"; exit 1; } + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 + with: + args: "--verbose --no-progress ${{needs.changedfiles.outputs.files}} --config .github/lychee.toml" diff --git a/.github/workflows/check_links_config.json b/.github/workflows/check_links_config.json deleted file mode 100644 index 84c68f6fdf3..00000000000 --- a/.github/workflows/check_links_config.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "http(s)?://\\d+\\.\\d+\\.\\d+\\.\\d+" - }, - { - "pattern": "http(s)?://localhost" - }, - { - "pattern": "http(s)?://example.com" - }, - { - "pattern": "#warnings" - } - ], - "aliveStatusCodes": [429, 200], - "httpHeaders": [ - { - "urls": ["https://docs.github.com/"], - "headers": { - "Accept-Encoding": "zstd, br, gzip, deflate" - } - } - ] -} diff --git a/Makefile b/Makefile index 88047fc48bf..55c03e8bc9e 100644 --- a/Makefile +++ b/Makefile @@ -189,8 +189,9 @@ PROTO_PACKAGE=go.opentelemetry.io/collector/$(PROTO_TARGET_GEN_DIR) # Intermediate directory used during generation. PROTO_INTERMEDIATE_DIR=pdata/internal/.patched-otlp-proto +DOCKERCMD ?= docker DOCKER_PROTOBUF ?= otel/build-protobuf:0.23.0 -PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD}/$(PROTO_INTERMEDIATE_DIR) ${DOCKER_PROTOBUF} --proto_path=${PWD} +PROTOC := $(DOCKERCMD) run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD}/$(PROTO_INTERMEDIATE_DIR) ${DOCKER_PROTOBUF} --proto_path=${PWD} PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf -I./ # Cleanup temporary directory @@ -402,9 +403,14 @@ clean: .PHONY: checklinks checklinks: - command -v markdown-link-check >/dev/null 2>&1 || { echo >&2 "markdown-link-check not installed. Run 'npm install -g markdown-link-check'"; exit 1; } - find . -name \*.md -print0 | xargs -0 -n1 \ - markdown-link-check -q -c ./.github/workflows/check_links_config.json || true + command -v $(DOCKERCMD) >/dev/null 2>&1 || { echo >&2 "$(DOCKERCMD) not installed. Install before continuing"; exit 1; } + $(DOCKERCMD) run -w /home/repo --rm \ + --mount 'type=bind,source='$(PWD)',target=/home/repo' \ + lycheeverse/lychee \ + --config .github/lychee.toml \ + --root-dir /home/repo \ + -v \ + --no-progress './**/*.md' # error message "failed to sync logger: sync /dev/stderr: inappropriate ioctl for device" # is a known issue but does not affect function. diff --git a/docs/rfcs/env-vars.md b/docs/rfcs/env-vars.md index 0be8bf8c30b..f404b8dd019 100644 --- a/docs/rfcs/env-vars.md +++ b/docs/rfcs/env-vars.md @@ -149,7 +149,7 @@ expect the string to be `0123`). The Configuration WG defines an [*environment variable expansion feature for SDK -configurations*](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/file-configuration.md#environment-variable-substitution). +configurations*](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/data-model.md#environment-variable-substitution). This accepts only non empty alphanumeric + underscore identifiers starting with alphabetic or underscore. If the Configuration WG were to expand this in the future (e.g. to include other features present in