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

Test link checker with respect to hard-coded guide URLs #947

Closed
wants to merge 8 commits into from

Conversation

kilfoyle
Copy link
Contributor

@kilfoyle kilfoyle commented Feb 22, 2024

TEST PR ONLY

This adds three links, one using the {security-guide} attribute, one using a hard-coded URL, and one using a hard-coded URL preceded by "link:". Let's see if the link checker complains about these.

Here's how the output renders:

screen

I'm trying to understand the following link checking error from this build:

2024-02-22 15:27:28 EST | INFO:build_docs:  /tmp/docsbuild/target_repo/html/en/security/current/suspicious-file-creation-in-etc-for-persistence.html contains broken links to:
-- | --
  | 2024-02-22 15:27:28 EST | INFO:build_docs:   - en/security/current/osquery-placeholder-fields.html[placeholder

Preview: https://ingest-docs_bk_947.docs-preview.app.elstc.co/guide/en/fleet/master/fleet-troubleshooting.html

@kilfoyle kilfoyle requested a review from a team as a code owner February 22, 2024 20:53
Copy link

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@kilfoyle
Copy link
Contributor Author

@elasticmachine run docs-build

@kilfoyle
Copy link
Contributor Author

Seems like the CI check is stuck, so I've relaunched it.

@kilfoyle
Copy link
Contributor Author

kilfoyle commented Feb 23, 2024

The first check passed swimmingly, so let's now duplicate these links and drop them inside a markdown code block.

It builds locally, though with the {security-guide} attribute uninterpolated:

Screenshot 2024-02-22 at 8 34 23 PM

@kilfoyle
Copy link
Contributor Author

Nice! → [1 placeholder fields]

@lcawl
Copy link
Contributor

lcawl commented Feb 23, 2024

Looks like the link checker doesn't like the fourth or fifth examples:

INFO:build_docs:Bad cross-document links:
--
  | INFO:build_docs: /tmp/docsbuild/target_repo/html/en/fleet/master/fleet-troubleshooting.html contains broken links to:
  | INFO:build_docs: - en/security/current/osquery-placeholder-fields.html[4
  | INFO:build_docs: - en/security/current/osquery-placeholder-fields.html[5

I'll add one more to test a markdown-formatted link in that markdown section.

@kilfoyle
Copy link
Contributor Author

kilfoyle commented Feb 23, 2024

It seems it's not fond of the markdown format either. :-(

2024-02-22 21:56:29 EST | INFO:build_docs:  /tmp/docsbuild/target_repo/html/en/fleet/master/fleet-troubleshooting.html contains broken links to:
-- | --
  | 2024-02-22 21:56:29 EST | INFO:build_docs:   - en/security/current/osquery-placeholder-fields.html)
  | 2024-02-22 21:56:29 EST | INFO:build_docs:   - en/security/current/osquery-placeholder-fields.html[4
  | 2024-02-22 21:56:29 EST | INFO:build_docs:   - en/security/current/osquery-placeholder-fields.html[5

Shall we try just a plain URL with nothing after it, similar to the example you found?

TEST8: This investigation guide uses https://www.elastic.co/guide/en/security/current/es-ui-overview.html

(using a different link so we can see if that one fails or not)

@lcawl
Copy link
Contributor

lcawl commented Feb 23, 2024

Actually I don't think it minded the markdown-formatted link, since it didn't generate an error on that one. However, because of the other errors, I can't tell what it does with that URL. Probably nothing, which might be okay.

@kilfoyle
Copy link
Contributor Author

Oh, sorry. I thought this one en/security/current/osquery-placeholder-fields.html) was due to the markdown version. Anyhow, I'll check in again tomorrow with fresh eyes. Thanks a lot for your help!

@lcawl
Copy link
Contributor

lcawl commented Feb 23, 2024

You're right, I missed seeing the additional error for the markdown-formatted links. The same failures occurred when I was doing similar fixes in elastic/security-docs#4847

@kilfoyle
Copy link
Contributor Author

I completely missed that these links appear in codeblocks and so might not be meant to be clickable. 😊

I didn't want to lose the CI results from this PR, so here's another one that suggests that (non-clickable) links will pass CI checks as long as they're followed by whitespace: #951

@kilfoyle
Copy link
Contributor Author

Test complete.

@kilfoyle kilfoyle closed this Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants