Skip to content

Commit

Permalink
add links checker readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fantkolja committed Nov 15, 2024
1 parent 03aa760 commit d3029ce
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ NOTE: On Windows, you may need to replace the forward slash in the `--path` valu
npm run-script generate-pdfs-platform-5-1
```

This script generates a PDF for the Hazelcast Platform 5.1 documentation.
This script generates a PDF for the Hazelcast Platform 5.1 documentation.

The result of this script is a `pdf-docs` directory, in which the artifacts for the PDF files are assembled and the PDF files are generated.

Expand All @@ -169,6 +169,44 @@ Some errors are displayed in the output, but you can ignore them.

We will track the status of the extension and update it when new releases are available.

== Links Checker

=== History
Previously each branch of each repo had its own `check-links-playbook.yml` for links-checker. The problem was, that for the correct links check `check-links-playbook.yml` should have contained the full list of all other repos and branches that have targets of the links from the current branch, and all repos and branches that have links TO the current branch. In other words - that file was complicated to maintain, so no one did, resulting in a wrong link check with many false negatives and positives.

=== Idea
We do care about broken links only in the context of the full production build. That's why the only correct way to check links is using global link:https://github.com/hazelcast/hazelcast-docs/blob/main/antora-playbook.yml[`antora-playbook.yml`].

=== How it works now
The links checker workflow consists of the next steps:

. Check out the global `antora-playbook.yml`.
. Check out the local `antora-playbook.yml`.
. Modify `content.sources` from the global `antora-playbook.yml` (use correct syntax for current PR branch).
. Inject `content.sources` from the global `antora-playbook.yml` to the local one (for links check we need only that list, but we cannot reuse the whole global `antora-playbook.yml`, because it might contain some extensions or parts not runnable in the context of a docs repo).
. Run the links check and report the results.

For this to happen we have several common files in the link:https://github.com/hazelcast/hazelcast-docs[hazelcast-docs repo]

.Files for links checker
[cols="m,a"]
|===
|File |Description

|link:https://github.com/hazelcast/hazelcast-docs/blob/main/.github/actions/validate/action.yml[action.yml]
|Contains common parts of the links checker workflow

|link:https://github.com/hazelcast/hazelcast-docs/blob/main/lib/load-check-links-playbook.js[load-check-links-playbook.js]
|Responsible for modification of `content.sources` from the global `antora-playbook.yml`.
|===

Each of the docs repos can just call the common validate action from its workflow.

[source,yaml]
----
uses: hazelcast/hazelcast-docs/.github/actions/validate@main
----

== GitHub Actions

To automate some elements of the build process, this repository includes the following GitHub Actions:
Expand All @@ -193,7 +231,7 @@ As well as these actions, content repositories that are listed under the `conten

```yaml
content:
sources:
sources:
- url: https://github.com/hazelcast/imdg-docs
branches: [master]
start_path: docs
Expand Down

0 comments on commit d3029ce

Please sign in to comment.