Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve link extraction for Kibana link checking #2085

Merged
merged 1 commit into from
Mar 17, 2021

Conversation

gtback
Copy link
Member

@gtback gtback commented Mar 16, 2021

  • Ignore links to web content that's outside the docs
  • Ensure Elasticsearch Reference content is checked

Fixes #2081

Related: elastic/kibana#94274, #1805

- Ignore links to web content that's outside the docs
- Ensure Elasticsearch Reference content is checked

Fixes #2081
@gtback gtback added the link-checking Link Checking & Redirects label Mar 16, 2021
@gtback
Copy link
Member Author

gtback commented Mar 16, 2021

I don't trust my Perl skills, so there's probably a better way to do these regular expressions. I tested this locally with a copy of doc_links_service.ts from elastic/kibana#94274, and it fixed the three broken ${ELASTIC_WEBSITE_URL} links, and only added one broken Elasticsearch link en/elasticsearch/reference/master/search-aggregations.html#_values_source, which should probably be fixed in the Kibana PR.

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'd always hoped repos could standardize on this sort of thing but I think that's not really a thing we can expect a ton of at this point.

I know that there are tests for this sort of thing off in ruby land. It'd probably be worth adding one just in case.

Copy link

@tylerjl tylerjl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my, perl is very much out of my wheelhouse. But I have implicit confidence in @nik9000's confidence :recursive-approval:

@nik9000
Copy link
Member

nik9000 commented Mar 16, 2021 via email

Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@gtback gtback merged commit a7c1a22 into master Mar 17, 2021
@gtback gtback deleted the gtback/ignore-checking-nondoc-links branch March 17, 2021 11:59
gtback added a commit that referenced this pull request Mar 17, 2021
When tested against a version of this repo prior to when #2085 was merged, it fails with these errors:

```
rspec './integtest/spec/all_books_broken_link_detection_spec.rb[1:2:5:1]' # building all books when broken link detection is enabled when there is a link in kibana to the website outside the guide logs that all the links are ok
rspec './integtest/spec/all_books_broken_link_detection_spec.rb[1:2:6:1]' # building all books when broken link detection is enabled when there is a broken Elasticsearch reference link in Kibana logs there are bad cross document links
rspec './integtest/spec/all_books_broken_link_detection_spec.rb[1:2:6:2]' # building all books when broken link detection is enabled when there is a broken Elasticsearch reference link in Kibana logs the bad link
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
link-checking Link Checking & Redirects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skip checking Kibana links that are on www.elastic.co but not docs links
4 participants