Skip to content

Commit df0ac13

Browse files
authored
[CI] Adjust link-warnings for semconv resource pages (#8290)
1 parent e0630bb commit df0ac13

File tree

5 files changed

+39
-51
lines changed

5 files changed

+39
-51
lines changed

.cspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ words: # Valid words across all locales
7777
- nvmrc
7878
- opentelemetrybot
7979
- warnf
80+
- warnidf

.warnings-skip-list.txt

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,2 @@
11
_filename-error
22
The following package was not found and will be installed
3-
# Temporary until the spec is updated to v1.147+:
4-
specification/profiles/mappings.md: cannot resolve spec link reference '/docs/specs/semconv/attributes-registry/process/#process-attributes'
5-
# Temporary until the following is resolved:
6-
# https://github.com/open-telemetry/semantic-conventions/issues/2690
7-
semconv/docs/gen-ai/aws-bedrock.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-input-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-input-messages.json)
8-
semconv/docs/gen-ai/aws-bedrock.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-output-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-output-messages.json)
9-
semconv/docs/gen-ai/aws-bedrock.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json' (/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json)
10-
semconv/docs/gen-ai/gen-ai-events.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-input-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-input-messages.json)
11-
semconv/docs/gen-ai/azure-ai-inference.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-input-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-input-messages.json)
12-
semconv/docs/gen-ai/gen-ai-events.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-output-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-output-messages.json)
13-
semconv/docs/gen-ai/azure-ai-inference.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-output-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-output-messages.json)
14-
semconv/docs/gen-ai/gen-ai-agent-spans.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-input-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-input-messages.json)
15-
semconv/docs/gen-ai/azure-ai-inference.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json' (/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json)
16-
semconv/docs/gen-ai/gen-ai-agent-spans.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-output-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-output-messages.json)
17-
semconv/docs/gen-ai/gen-ai-events.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json' (/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json)
18-
semconv/docs/gen-ai/gen-ai-agent-spans.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json' (/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json)
19-
semconv/docs/gen-ai/gen-ai-spans.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-input-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-input-messages.json)
20-
semconv/docs/gen-ai/gen-ai-spans.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-output-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-output-messages.json)
21-
semconv/docs/gen-ai/gen-ai-spans.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json' (/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json)
22-
semconv/docs/gen-ai/gen-ai-spans.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/non-normative/models.ipynb' (/docs/specs/semconv/gen-ai/non-normative/models.ipynb)
23-
semconv/docs/gen-ai/openai.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-input-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-input-messages.json)
24-
semconv/docs/gen-ai/openai.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-output-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-output-messages.json)
25-
semconv/docs/gen-ai/openai.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json' (/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json)
26-
semconv/docs/registry/attributes/gen-ai.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-input-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-input-messages.json)
27-
semconv/docs/registry/attributes/gen-ai.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-output-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-output-messages.json)
28-
semconv/docs/registry/attributes/gen-ai.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json' (/docs/specs/semconv/gen-ai/gen-ai-system-instructions.json)
29-
semconv/docs/gen-ai/non-normative/examples-llm-calls.md: cannot resolve spec link reference '/docs/specs/semconv/gen-ai/gen-ai-input-messages.json' (/docs/specs/semconv/gen-ai/gen-ai-input-messages.json)

hugo.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ disableKinds: [taxonomy]
55
theme: [docsy]
66
disableAliases: true # We do redirects via Netlify's _redirects file
77
enableGitInfo: true
8+
ignoreLogs: [spec-resource-not-found]
89

910
# Language settings
1011
defaultContentLanguage: en

layouts/_markup/render-link.html

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
*/ -}}
1818

19-
19+
{{/* Note: $u.IsAbs is true if $url has a scheme (e.g., "http:") */ -}}
2020
{{ if and
2121
(hasPrefix $.PageInner.RelPermalink "/docs/specs")
2222
(not $u.IsAbs)
@@ -33,7 +33,35 @@
3333
{{ with $u.RawQuery -}}{{ $href = printf "%s?%s" $href . -}}{{ end -}}
3434
{{ with $u.Fragment -}}{{ $href = printf "%s#%s" $href . -}}{{ end -}}
3535
{{ else -}}
36-
{{ warnf "File %s: cannot resolve spec link reference '%s' (%s)" .Page.File.Filename $url $path -}}
36+
37+
{{/* We can't find a page for $url.
38+
39+
- If $url refers to a Markdown file, issue a warning, since we should be
40+
able to find it.
41+
42+
- Otherwise, it's a path to a resource file. Most often, $path is absolute,
43+
and the resource is inside a page bundle. Hugo's global or page Resource.Get
44+
can't handle that, so just ignore the issue. If there is a real problem, and
45+
the path is invalid, it will be caught by the link checker.
46+
47+
- If the resource path starts with `./`, adjust it to be `../` to match
48+
GitHub's relative paths, provide the page this link is in is not an index
49+
page.
50+
51+
*/ -}}
52+
53+
{{ if hasSuffix $path ".md" -}}
54+
{{ warnf "File %s: cannot resolve spec link reference '%s' (%s)" .Page.File.Filename $url $path -}}
55+
{{ else -}}
56+
{{ if and
57+
(hasPrefix $href "./")
58+
(not (hasSuffix .Page.File.Filename "_index.md"))
59+
(not (hasSuffix .Page.File.Filename "README.md"))
60+
-}}
61+
{{ $href = add "." $href -}}
62+
{{ end -}}
63+
{{ warnidf "spec-resource-not-found" "File %s: cannot resolve spec link reference '%s' (%s)" .Page.File.Filename $url $href -}}
64+
{{ end -}}
3765
{{ end -}}
3866
{{ $url = $href -}}
3967
{{ else if hasPrefix $url "/" -}}

scripts/content-modules/adjust-pages.pl

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,15 @@ ($$$)
9595
return 0;
9696
}
9797

98-
# sub patchSpec_because_of_SemConv_MetricReqLevelHashDNE() {
99-
# return unless $ARGV =~ /^tmp\/semconv\/docs\//
100-
# && applyPatchOrPrintMsgIf('2025-08-28-metric-request-level-hash-dne', 'semconv', '1.37.0-dev');
101-
102-
# # See https://github.com/open-telemetry/semantic-conventions/issues/2690#issuecomment-3235079573
103-
# s|/docs/general/metrics.md#metric-requirement-levels|/docs/general/metric-requirement-level.md#recommended|g;
98+
# sub patchSpec_because_of_SemConv_GenAiSpanRelativePath() {
99+
# return unless $ARGV =~ /^tmp\/semconv\/docs\/gen-ai\/gen-ai-spans/
100+
# && applyPatchOrPrintMsgIf('2025-08-28-gen-ai-span-relative-path', 'semconv', '1.38.0-dev');
101+
#
102+
# # See https://github.com/open-telemetry/semantic-conventions/issues/2690#issue-3364744586
103+
# # Replace [foo](./some-path) with [foo](/docs/gen-ai/some-path)
104+
# s|\]\(\./|](/docs/gen-ai/|g;
104105
# }
105106

106-
sub patchSpec_because_of_SemConv_GenAiSpanRelativePath() {
107-
return unless $ARGV =~ /^tmp\/semconv\/docs\/gen-ai\/gen-ai-spans/
108-
&& applyPatchOrPrintMsgIf('2025-08-28-gen-ai-span-relative-path', 'semconv', '1.38.0-dev');
109-
110-
# See https://github.com/open-telemetry/semantic-conventions/issues/2690#issue-3364744586
111-
# Replace [foo](./some-path) with [foo](/docs/gen-ai/some-path)
112-
s|\]\(\./|](/docs/gen-ai/|g;
113-
}
114-
115107
sub getVersFromSubmodule() {
116108
my %repoNames = qw(
117109
otlp opentelemetry-proto
@@ -194,16 +186,9 @@ ()
194186
## Semconv
195187

196188
if ($ARGV =~ /^tmp\/semconv/) {
197-
# patchSpec_because_of_SemConv_MetricReqLevelHashDNE();
198-
patchSpec_because_of_SemConv_GenAiSpanRelativePath();
199-
200189
s|(\]\()/docs/|$1$specBasePath/semconv/|g;
201190
s|(\]:\s*)/docs/|$1$specBasePath/semconv/|;
202191
s|\((/model/.*?)\)|($semconvSpecRepoUrl/tree/v$semconvVers/$1)|g;
203-
204-
# Remove the .md extension from the link title
205-
# TODO: remove this once the .md extension is removed from the link title
206-
s|(<td><a href=")(.*)\.md(#.*">.*</a></td>)|$1$2$3|g;
207192
}
208193

209194

0 commit comments

Comments
 (0)