Skip to content

Commit 3e2f586

Browse files
authored
Use flint for link checking (#2654)
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent e875e14 commit 3e2f586

File tree

10 files changed

+26
-73
lines changed

10 files changed

+26
-73
lines changed

.github/config/lychee.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ max_concurrency = 4
99
# Check link anchors
1010
include_fragments = true
1111

12-
remap = [
13-
# workaround for https://github.com/lycheeverse/lychee/issues/1729
14-
"https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4"
15-
]
16-
1712
exclude = [
1813
# excluding links to pull requests and issues is done for performance
1914
"^https://github.com/open-telemetry/opentelemetry-java-contrib/(issues|pull)/\\d+$",
15+
# groovy-lang.org is frequently unreachable / times out
16+
"^https?://[^/]*groovy-lang\\.org",
2017
]

.github/renovate.json5

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,17 @@
266266
},
267267
],
268268
customManagers: [
269+
{
270+
// keep SHA-pinned raw.githubusercontent.com URLs in mise.toml up to date
271+
customType: 'regex',
272+
datasourceTemplate: 'github-tags',
273+
managerFilePatterns: [
274+
'/^mise\\.toml$/',
275+
],
276+
matchStrings: [
277+
'https://raw\\.githubusercontent\\.com/(?<depName>[^/]+/[^/]+)/(?<currentDigest>[a-f0-9]{40})/.*#\\s*(?<currentValue>v\\S+)',
278+
],
279+
},
269280
{
270281
customType: 'regex',
271282
datasourceTemplate: 'npm',

.github/workflows/reusable-link-check.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414
with:
15-
fetch-depth: 0 # needed for merge-base used in lint:links-in-modified-files
15+
fetch-depth: 0 # needed for merge-base used in modified-files mode
1616

1717
- uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3.6.3
1818

1919
- name: Link check for pull requests
2020
if: github.event_name == 'pull_request'
2121
env:
2222
GITHUB_TOKEN: ${{ github.token }}
23-
run: |
24-
mise run lint:local-links
25-
mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }}
23+
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
24+
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
25+
run: mise run lint:links
2626

2727
- name: Link check for pushes and scheduled workflows
2828
if: github.event_name != 'pull_request'
2929
env:
3030
GITHUB_TOKEN: ${{ github.token }}
31-
run: mise run lint:links
31+
run: mise run lint:links --full

.mise/tasks/lint/links-in-modified-files.sh

Lines changed: 0 additions & 36 deletions
This file was deleted.

.mise/tasks/lint/links.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

.mise/tasks/lint/local-links.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

cel-sampler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To use:
1111
* 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.
1212
* Configure the `.tracer_provider.sampler` to include the `cel_based` sampler.
1313

14-
Support is now available for the java agent, see an [example here](https://github.com/open-telemetry/opentelemetry-java-examples/blob/main/javaagent).
14+
Support is now available for the java agent, see an [example here](https://github.com/open-telemetry/opentelemetry-java-examples/tree/main/javaagent).
1515

1616
## Overview
1717

jmx-scraper/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Like with the JMX Gatherer, the selection of provided metrics to use is still do
165165
However, there is now two distinct sets of metrics to select from using the `otel.jmx.target.source` configuration option:
166166

167167
- `legacy`: [metrics definitions](./src/main/resources) equivalent to JMX Gatherer definitions to help transition and preserve compatibility
168-
- `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/).
168+
- `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/).
169169

170170
In both cases, the metrics definitions themselves are embedded in the JMX Scraper binary, thus they
171171
will only change if the release version of the JMX Scraper binary changes.

mise.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ idiomatic_version_file_enable_tools = []
1111
windows_executable_extensions = ["sh"]
1212
windows_default_file_shell_args = "bash"
1313
use_file_shell_for_executable_tasks = true
14+
15+
# Pick the tasks you need from flint (https://github.com/grafana/flint)
16+
[tasks."lint:links"]
17+
description = "Check for broken links in changed files + all local links"
18+
file = "https://raw.githubusercontent.com/grafana/flint/8a39d96e17327c54974623b252eb5260d67ed68a/tasks/lint/links.sh" # v0.9.1

samplers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To use:
1313
* 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.
1414
* Configure the `.tracer_provider.sampler` to include the `rule_based_routing` sampler.
1515

16-
Support is now available for the java agent, see an [example here](https://github.com/open-telemetry/opentelemetry-java-examples/blob/main/javaagent).
16+
Support is now available for the java agent, see an [example here](https://github.com/open-telemetry/opentelemetry-java-examples/tree/main/javaagent).
1717

1818
Schema for `rule_based_routing` sampler:
1919

0 commit comments

Comments
 (0)