Skip to content

Commit 7fb0eff

Browse files
szabostevegtback
andauthored
Adds apm_docs variable to Kibana link checker (#2209)
Co-authored-by: Greg Back <[email protected]>
1 parent e04e374 commit 7fb0eff

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

build_docs.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,12 @@ sub check_kibana_links {
356356
# ${KIBANA_DOCS}canvas.html
357357
# ${PLUGIN_DOCS}repository-s3.html
358358
# ${FLEET_DOCS}fleet-overview.html
359+
# ${APM_DOCS}overview.html
359360

360361
my $extractor = sub {
361362
my $contents = shift;
362363
return sub {
363-
while ( $contents =~ m!`(\$\{(?:baseUrl|ELASTIC.+|KIBANA_DOCS|PLUGIN_DOCS|FLEET_DOCS)\}[^`]+)`!g ) {
364+
while ( $contents =~ m!`(\$\{(?:baseUrl|ELASTIC.+|KIBANA_DOCS|PLUGIN_DOCS|FLEET_DOCS|APM_DOCS)\}[^`]+)`!g ) {
364365
my $path = $1;
365366
$path =~ s/\$\{(?:DOC_LINK_VERSION|urlVersion)\}/$branch/;
366367
# In older versions, the variable `${ELASTIC_DOCS}` referred to
@@ -371,6 +372,7 @@ sub check_kibana_links {
371372
$path =~ s!\$\{KIBANA_DOCS\}!en/kibana/$branch/!;
372373
$path =~ s!\$\{PLUGIN_DOCS\}!en/elasticsearch/plugins/$branch/!;
373374
$path =~ s!\$\{FLEET_DOCS\}!en/fleet/$branch/!;
375+
$path =~ s!\$\{APM_DOCS\}!en/apm/!;
374376
# Replace the "https://www.elastic.co/guide/" URL prefix so that
375377
# it becomes a file path in the built docs.
376378
$path =~ s!\$\{(?:baseUrl|ELASTIC_WEBSITE_URL)\}guide/!!;

integtest/spec/all_books_broken_link_detection_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@
156156
include_examples 'there are broken links in kibana',
157157
'en/fleet/master/not-a-fleet-page.html'
158158
end
159+
describe 'when there is a broken APM link' do
160+
include_context 'there is a kibana link', true,
161+
'${APM_DOCS}not-an-apm-page.html', true
162+
include_examples 'there are broken links in kibana',
163+
'en/apm/not-an-apm-page.html'
164+
end
159165
describe 'when using --keep_hash and --sub_dir together like a PR test' do
160166
describe 'when there is a broken link in one of the books being built' do
161167
convert_before do |src, dest|

0 commit comments

Comments
 (0)