From 8d855e9465b67cbc3806ad686fbf6c33fa621bfe Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Mon, 2 Dec 2024 11:50:39 +0100 Subject: [PATCH 1/6] Fix broken references to public doc_links --- build_docs.pl | 2 +- integtest/spec/all_books_broken_link_detection_spec.rb | 4 ++-- integtest/spec/all_books_change_detection_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build_docs.pl b/build_docs.pl index b833cc2530198..582b8a7bb95e8 100755 --- a/build_docs.pl +++ b/build_docs.pl @@ -428,7 +428,7 @@ sub check_kibana_links { $links_file = $legacy_path . ".ts"; $repo->show_file( $link_check_name, $branch, $links_file ); } || eval { - $links_file = "src/core/public/doc_links/doc_links_service.ts"; + $links_file = "packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts"; $repo->show_file( $link_check_name, $branch, $links_file ); }; die "failed to find kibana links file;\n$@" unless $source; diff --git a/integtest/spec/all_books_broken_link_detection_spec.rb b/integtest/spec/all_books_broken_link_detection_spec.rb index 675e151d5e486..44f72a17808ec 100644 --- a/integtest/spec/all_books_broken_link_detection_spec.rb +++ b/integtest/spec/all_books_broken_link_detection_spec.rb @@ -6,7 +6,7 @@ # Assertions about when books are rebuilt based on changes in source # repositories or the book's configuration. RSpec.describe 'building all books' do - KIBANA_LINKS_FILE = 'src/core/public/doc_links/doc_links_service.ts' + KIBANA_LINKS_FILE = 'packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts' shared_context 'there is a broken link in the docs' do |text, check_links| convert_before do |src, dest| repo = src.repo_with_index 'repo', text @@ -112,7 +112,7 @@ end it 'logs the bad link' do expect(outputs[-1]).to include(indent(<<~LOG.strip, ' ')) - Kibana [master]: src/core/public/doc_links/doc_links_service.ts contains broken links to: + Kibana [master]: packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts contains broken links to: - #{url} LOG end diff --git a/integtest/spec/all_books_change_detection_spec.rb b/integtest/spec/all_books_change_detection_spec.rb index 964585b9e3d00..f5efe5f608d79 100644 --- a/integtest/spec/all_books_change_detection_spec.rb +++ b/integtest/spec/all_books_change_detection_spec.rb @@ -326,7 +326,7 @@ def chapter(index) kibana_repo.rename_branch 'main' kibana_repo.write( - 'src/core/public/doc_links/doc_links_service.ts', + 'packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts', 'text but no links actually' ) kibana_repo.commit 'add links file' From a0403eb9a841962bd53bf848705572c68c3ec973 Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Mon, 2 Dec 2024 12:00:24 +0100 Subject: [PATCH 2/6] Include new location for `get_doc_links.ts` --- build_docs.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build_docs.pl b/build_docs.pl index 582b8a7bb95e8..70119c6e268bb 100755 --- a/build_docs.pl +++ b/build_docs.pl @@ -413,6 +413,9 @@ sub check_kibana_links { say " Branch: $branch, Version: $version"; my $links_file; my $source = eval { + $links_file = "src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts"; + $repo->show_file( $link_check_name, $branch, $links_file ); + } || eval { $links_file = "packages/kbn-doc-links/src/get_doc_links.ts"; $repo->show_file( $link_check_name, $branch, $links_file ); } || eval { From c6cad757eda5f6f20e9dbcdefeef879a3b0b1a43 Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Tue, 3 Dec 2024 10:33:03 +0100 Subject: [PATCH 3/6] Continue to support 7.13 --- build_docs.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build_docs.pl b/build_docs.pl index 70119c6e268bb..1813790557393 100755 --- a/build_docs.pl +++ b/build_docs.pl @@ -433,6 +433,9 @@ sub check_kibana_links { } || eval { $links_file = "packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts"; $repo->show_file( $link_check_name, $branch, $links_file ); + } || eval { + $links_file = "src/core/public/doc_links/doc_links_service.ts"; + $repo->show_file( $link_check_name, $branch, $links_file ); }; die "failed to find kibana links file;\n$@" unless $source; From 3039bb684a0ae5d8828dde56a8aa0c38bb734a38 Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Tue, 3 Dec 2024 10:51:05 +0100 Subject: [PATCH 4/6] Use old paths in tests (new ones are too long) --- integtest/spec/all_books_broken_link_detection_spec.rb | 2 +- integtest/spec/all_books_change_detection_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integtest/spec/all_books_broken_link_detection_spec.rb b/integtest/spec/all_books_broken_link_detection_spec.rb index 44f72a17808ec..a94986a4a2eca 100644 --- a/integtest/spec/all_books_broken_link_detection_spec.rb +++ b/integtest/spec/all_books_broken_link_detection_spec.rb @@ -6,7 +6,7 @@ # Assertions about when books are rebuilt based on changes in source # repositories or the book's configuration. RSpec.describe 'building all books' do - KIBANA_LINKS_FILE = 'packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts' + KIBANA_LINKS_FILE = 'src/core/public/doc_links/doc_links_service.ts' shared_context 'there is a broken link in the docs' do |text, check_links| convert_before do |src, dest| repo = src.repo_with_index 'repo', text diff --git a/integtest/spec/all_books_change_detection_spec.rb b/integtest/spec/all_books_change_detection_spec.rb index f5efe5f608d79..964585b9e3d00 100644 --- a/integtest/spec/all_books_change_detection_spec.rb +++ b/integtest/spec/all_books_change_detection_spec.rb @@ -326,7 +326,7 @@ def chapter(index) kibana_repo.rename_branch 'main' kibana_repo.write( - 'packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts', + 'src/core/public/doc_links/doc_links_service.ts', 'text but no links actually' ) kibana_repo.commit 'add links file' From 5f806b5a0b7e5748f01e8d12dcd020709ac699dc Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Tue, 3 Dec 2024 10:58:17 +0100 Subject: [PATCH 5/6] Include future location of doc-links packages --- build_docs.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build_docs.pl b/build_docs.pl index 1813790557393..d32210bb81be0 100755 --- a/build_docs.pl +++ b/build_docs.pl @@ -430,6 +430,9 @@ sub check_kibana_links { } || eval { $links_file = $legacy_path . ".ts"; $repo->show_file( $link_check_name, $branch, $links_file ); + } || eval { + $links_file = "src/core/packages/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts"; + $repo->show_file( $link_check_name, $branch, $links_file ); } || eval { $links_file = "packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts"; $repo->show_file( $link_check_name, $branch, $links_file ); From 93733db592036029dde12ee33c60b79bd87c6551 Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Tue, 3 Dec 2024 11:32:20 +0100 Subject: [PATCH 6/6] Update old test references --- integtest/spec/all_books_broken_link_detection_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integtest/spec/all_books_broken_link_detection_spec.rb b/integtest/spec/all_books_broken_link_detection_spec.rb index a94986a4a2eca..675e151d5e486 100644 --- a/integtest/spec/all_books_broken_link_detection_spec.rb +++ b/integtest/spec/all_books_broken_link_detection_spec.rb @@ -112,7 +112,7 @@ end it 'logs the bad link' do expect(outputs[-1]).to include(indent(<<~LOG.strip, ' ')) - Kibana [master]: packages/core/doc-links/core-doc-links-browser-internal/src/doc_links_service.ts contains broken links to: + Kibana [master]: src/core/public/doc_links/doc_links_service.ts contains broken links to: - #{url} LOG end