diff --git a/build_docs.pl b/build_docs.pl index cb67179f093af..defebe4045dfb 100755 --- a/build_docs.pl +++ b/build_docs.pl @@ -352,11 +352,14 @@ sub check_kibana_links { # ${baseUrl}guide/en/elasticsearch/reference/${urlVersion}/modules-scripting-expression.html # ${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION} # ${ELASTIC_DOCS}search-aggregations-bucket-datehistogram-aggregation.html +# ${ELASTICSEARCH_DOCS}update-transform.html +# ${KIBANA_DOCS}canvas.html +# ${PLUGIN_DOCS}repository-s3.html my $extractor = sub { my $contents = shift; return sub { - while ( $contents =~ m!`(\$\{(?:baseUrl|ELASTIC.+)\}[^`]+)`!g ) { + while ( $contents =~ m!`(\$\{(?:baseUrl|ELASTIC.+|KIBANA_DOCS|PLUGIN_DOCS)\}[^`]+)`!g ) { my $path = $1; $path =~ s/\$\{(?:DOC_LINK_VERSION|urlVersion)\}/$branch/; # In older versions, the variable `${ELASTIC_DOCS}` referred to @@ -364,6 +367,8 @@ sub check_kibana_links { # variable is called `${ELASTICSEARCH_DOCS}` $path =~ s!\$\{ELASTIC_DOCS\}!en/elasticsearch/reference/$branch/!; $path =~ s!\$\{ELASTICSEARCH_DOCS\}!en/elasticsearch/reference/$branch/!; + $path =~ s!\$\{KIBANA_DOCS\}!en/kibana/$branch/!; + $path =~ s!\$\{PLUGIN_DOCS\}!en/elasticsearch/plugins/$branch/!; # Replace the "https://www.elastic.co/guide/" URL prefix so that # it becomes a file path in the built docs. $path =~ s!\$\{(?:baseUrl|ELASTIC_WEBSITE_URL)\}guide/!!; diff --git a/integtest/spec/all_books_broken_link_detection_spec.rb b/integtest/spec/all_books_broken_link_detection_spec.rb index 3120507eacd97..87b36e1a7ed79 100644 --- a/integtest/spec/all_books_broken_link_detection_spec.rb +++ b/integtest/spec/all_books_broken_link_detection_spec.rb @@ -134,9 +134,21 @@ end describe 'when there is a broken Elasticsearch Guide link in Kibana' do include_context 'there is a kibana link', true, - '${ELASTICSEARCH_DOCS}missing-page', true + '${ELASTICSEARCH_DOCS}missing-page.html', true include_examples 'there are broken links in kibana', - 'en/elasticsearch/reference/master/missing-page' + 'en/elasticsearch/reference/master/missing-page.html' + end + describe 'when there is a broken Kibana guide link' do + include_context 'there is a kibana link', true, + '${KIBANA_DOCS}not-a-kibana-page.html', true + include_examples 'there are broken links in kibana', + 'en/kibana/master/not-a-kibana-page.html' + end + describe 'when there is a broken ES Plugin link' do + include_context 'there is a kibana link', true, + '${PLUGIN_DOCS}not-a-valid-plugin.html', true + include_examples 'there are broken links in kibana', + 'en/elasticsearch/plugins/master/not-a-valid-plugin.html' end describe 'when using --keep_hash and --sub_dir together like a PR test' do describe 'when there is a broken link in one of the books being built' do