Skip to content

Commit 163db41

Browse files
committed
[CI] Semconv: apply patch to remove path_base
1 parent 9267060 commit 163db41

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

scripts/content-modules/adjust-pages.pl

+13-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
my %versFromSubmod = %versions; # Actual version of submodules. Updated by getVersFromSubmodule().
3737

38-
sub printTitleAndFrontMatter() {
38+
sub printFrontMatter() {
3939
print "---\n";
4040
if ($title eq 'OpenTelemetry Specification') {
4141
$title .= " $otelSpecVers";
@@ -46,7 +46,7 @@ ()
4646
$frontMatterFromFile =~ s/(title|linkTitle): .*/$& $otlpSpecVers/g;
4747
# TODO: add to spec landing page
4848
$frontMatterFromFile .= "weight: 20\n" if $frontMatterFromFile !~ /^\s*weight/;
49-
} elsif ($ARGV =~ /semconv\/docs\/\w+.md$/) {
49+
} elsif ($ARGV =~ /^tmp\/semconv\/docs\/\w+.md$/) {
5050
$title .= " $semconvVers";
5151
$frontMatterFromFile =~ s/linkTitle: .*/$& $semconvVers/;
5252
# $frontMatterFromFile =~ s/body_class: .*/$& td-page--draft/;
@@ -59,6 +59,15 @@ ()
5959
# applyPatchOrPrintMsgIf('2024-12-01-bridge-api', 'spec', '1.39.0');
6060
# }
6161

62+
if ($ARGV =~ m{^tmp/semconv/docs.*/(README|_index)\.md$}
63+
&& applyPatchOrPrintMsgIf('2025-01-29-path-base', 'semconv', '1.30.0-19-g')
64+
&& $frontMatterFromFile =~ /^path_base_for_github_subdir:/m
65+
) {
66+
$frontMatterFromFile =~ s/\npath_base_for_github_subdir:.*?\n/\n/;
67+
$frontMatterFromFile =~ s|\n from: tmp/semconv/docs/.*?\n|\n|;
68+
$frontMatterFromFile =~ s/\n to: .*README.md($|\n)/$1/;
69+
}
70+
6271
my $titleMaybeQuoted = ($title =~ ':') ? "\"$title\"" : $title;
6372
print "title: $titleMaybeQuoted\n" if $frontMatterFromFile !~ /title: /;
6473
if ($title =~ /^OpenTelemetry (Protocol )?(.*)/) {
@@ -103,7 +112,7 @@ ()
103112

104113
sub patchSemConv1_30_0() {
105114
return unless $ARGV =~ /^tmp\/semconv\/docs\//
106-
&& applyPatchOrPrintMsgIf('2025-01-24-emit-an-event', 'semconv', '1.30.0-3-g');
115+
&& applyPatchOrPrintMsgIf('2025-01-24-emit-an-event-etc', 'semconv', '1.30.0-18-g');
107116

108117
s|Emit Event API|Log API|;
109118
s|(docs/specs/otel/logs/api.md#emit-a)n-event|$1-logrecord|;
@@ -162,7 +171,7 @@ ()
162171
if(! $title) {
163172
($title) = /^#\s+(.*)/;
164173
$linkTitle = '';
165-
printTitleAndFrontMatter() if $title;
174+
printFrontMatter() if $title;
166175
next;
167176
}
168177

0 commit comments

Comments
 (0)