|
18 | 18 | my $semConvRef = "$otelSpecRepoUrl/blob/main/semantic_conventions/README.md";
|
19 | 19 | my $specBasePath = '/docs/specs';
|
20 | 20 | my %versions = qw(
|
21 |
| - spec: 1.38.0 |
| 21 | + spec: 1.39.0 |
22 | 22 | otlp: 1.3.2
|
23 | 23 | semconv: 1.28.0
|
24 | 24 | );
|
25 | 25 | my $otelSpecVers = $versions{'spec:'};
|
26 | 26 | my $otlpSpecVers = $versions{'otlp:'};
|
27 | 27 | my $semconvVers = $versions{'semconv:'};
|
| 28 | +my $warn2 = 0; # TODO remove along with warning 002 |
28 | 29 |
|
29 | 30 | sub printTitleAndFrontMatter() {
|
30 | 31 | print "---\n";
|
|
42 | 43 | $frontMatterFromFile =~ s/linkTitle: .*/$& $semconvVers/;
|
43 | 44 | # $frontMatterFromFile =~ s/body_class: .*/$& td-page--draft/;
|
44 | 45 | # $frontMatterFromFile =~ s/cascade:\n/$& draft: true\n/;
|
| 46 | + } elsif ($ARGV =~ /otel\/specification\/logs\/api.md$/) { |
| 47 | + if ($otelSpecVers ne "1.39.0") { |
| 48 | + # TODO: delete the enclosing elsif body |
| 49 | + print STDOUT "WARNING [001]: $0: remove obsolete code now that OTel spec has been updated.\n" |
| 50 | + } |
| 51 | + $frontMatterFromFile .= "linkTitle: API\naliases: [bridge-api]\n"; |
45 | 52 | }
|
46 | 53 | my $titleMaybeQuoted = ($title =~ ':') ? "\"$title\"" : $title;
|
47 | 54 | print "title: $titleMaybeQuoted\n" if $frontMatterFromFile !~ /title: /;
|
|
109 | 116 |
|
110 | 117 | # SPECIFICATION custom processing
|
111 | 118 |
|
| 119 | + # TODO: drop the entire if-then-else statement patch code when OTel spec vers contains |
| 120 | + # https://github.com/open-telemetry/opentelemetry-specification/pull/4287, |
| 121 | + # which should be vers > 1.39.0. |
| 122 | + if ($otelSpecVers eq "1.39.0") { |
| 123 | + s|(/api\.md)#logs-api\b|$1|g; |
| 124 | + } elsif ($ARGV =~ /otel\/spec/) { |
| 125 | + print STDOUT "WARNING [002]: $0: remove obsolete code now that OTel spec has been updated.\n" unless $warn2++ |
| 126 | + } |
| 127 | + |
112 | 128 | s|\(https://github.com/open-telemetry/opentelemetry-specification\)|($specBasePath/otel/)|;
|
113 | 129 | s|(\]\()/specification/|$1$specBasePath/otel/)|;
|
114 | 130 | s|\.\./semantic_conventions/README.md|$semConvRef| if $ARGV =~ /overview/;
|
|
0 commit comments