Skip to content

Commit 54cd2af

Browse files
committed
Adjust patches and update refcache
1 parent 1bba31e commit 54cd2af

File tree

2 files changed

+348
-29
lines changed

2 files changed

+348
-29
lines changed

scripts/content-modules/adjust-pages.pl

+8-29
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ ($$$)
9393
return 0;
9494
}
9595

96-
sub patchAttrNaming() {
97-
return unless $ARGV =~ /^tmp\/otel\/specification/
98-
&& applyPatchOrPrintMsgIf('2025-01-22-attribute-naming', 'semconv', '1.29.0');
99-
100-
my $semconv_attr_naming = '(/docs/specs/semconv/general)/naming/';
101-
s|$semconv_attr_naming|$1/attribute-naming/|g if /$semconv_attr_naming/;
102-
}
103-
10496
sub patchEventAliases() {
10597
return unless $ARGV =~ /^tmp\/otel\/specification\/logs\//
10698
&& applyPatchOrPrintMsgIf('2025-01-23-event-aliases', 'spec', '1.41.0');
@@ -109,12 +101,13 @@ ()
109101
s|$aliases|$1./$2|g if /$aliases/;
110102
}
111103

112-
sub patchSemConvAlias() {
113-
return unless $ARGV =~ /^tmp\/semconv\/docs\/general\//
114-
&& applyPatchOrPrintMsgIf('2025-01-23-general-aliases', 'semconv', '1.29.0');
104+
sub patchSemConvEmitAnEvent() {
105+
return unless $ARGV =~ /^tmp\/semconv\/docs\//
106+
&& applyPatchOrPrintMsgIf('2025-01-24-emit-an-event', 'semconv', '1.30.0');
115107

116-
my $aliases = '\[docs/specs/semconv/general/(trace-general)\]';
117-
s|$aliases|[$1]|g if /$aliases/;
108+
s|Emit Event API|Log API|;
109+
my $path = '(docs/specs/otel/logs/api.md#emit-a)n-event';
110+
s|$path|$1-logrecord|g if /$path/;
118111
}
119112

120113
sub getVersFromSubmodule() {
@@ -158,9 +151,7 @@ ()
158151
while(<>) {
159152
$lineNum++;
160153
last if /^-?-->/;
161-
patchAttrNaming();
162154
patchEventAliases();
163-
patchSemConvAlias();
164155
$frontMatterFromFile .= $_;
165156
}
166157
next;
@@ -193,28 +184,14 @@ ()
193184
## Semconv
194185

195186
if ($ARGV =~ /^tmp\/semconv/) {
196-
if (applyPatchOrPrintMsgIf('2025-01-22-event-(api|sdk)', 'semconv', '1.29.0')) {
197-
# Cf. https://github.com/open-telemetry/opentelemetry-specification/pull/4359
198-
my $otel_spec_event_deprecation = '(opentelemetry-specification/blob/main/specification/logs)/event-(api|sdk).md';
199-
s|$otel_spec_event_deprecation\b|$1/|g if /$otel_spec_event_deprecation/;
200-
}
201-
202187
s|(\]\()/docs/|$1$specBasePath/semconv/|g;
203188
s|(\]:\s*)/docs/|$1$specBasePath/semconv/|;
204189

205190
s|\((/model/.*?)\)|($semconvSpecRepoUrl/tree/v$semconvVers/$1)|g;
206191
}
207192

208-
209193
# SPECIFICATION custom processing
210194

211-
if ($ARGV =~ /^tmp\/otel\/specification/ && applyPatchOrPrintMsgIf('2025-01-22-attribute-naming.md', 'semconv', '1.29.0')) {
212-
my $semconv_attr_naming_md = '(semantic-conventions/blob/main/docs/general)/naming.md(#\w+)?';
213-
s|$semconv_attr_naming_md\b|$1/attribute-naming.md|g if /$semconv_attr_naming_md/;
214-
}
215-
216-
patchAttrNaming(); # TEMPORARY patch
217-
218195
s|\(https://github.com/open-telemetry/opentelemetry-specification\)|($specBasePath/otel/)|;
219196
s|(\]\()/specification/|$1$specBasePath/otel/)|;
220197
s|\.\./specification/(.*?\))|../otel/$1|g if $ARGV =~ /otel\/specification/;
@@ -254,5 +231,7 @@ ()
254231

255232
s|\]\((proto/opamp.proto)\)|]($opAmpSpecRepoUrl/blob/main/$1)|;
256233

234+
patchSemConvEmitAnEvent();
235+
257236
print;
258237
}

0 commit comments

Comments
 (0)