bonitasoft / bonita-documentation-site

The sources of the Bonita Documentation site
https://documentation.bonitasoft.com/
GNU General Public License v2.0
9 stars 5 forks source link

chore: add a tool to check links [POC] #618

Open tbouffard opened 10 months ago

tbouffard commented 10 months ago

WIP Covers #430.

Use htmltest: https://github.com/wjdp/htmltest

Configuration of the preview script use to build the site that is checked. This is why we are not using the production build for the checks:

The GH workflow enables the real use of Antora Atlas to resolve links to pages not built in the preview (links to pages related to unsupported versions). This may consume extra bandwidth in our Netlify plan.

Remaining tasks

Example of preview commands to generate the site to check locally

Single component version

$./build-preview-dev.bash --hide-edit-page-links true --force-production-navbar true --type links-check --local-sources --component bonita --branch 2021.2
$ ./build-preview-dev.bash --hide-edit-page-links true --force-production-navbar true --type links-check --local-sources --component cloud --branch master

Note:

Build whole site (include bonita out of support version)

$ ./build-preview-dev.bash --hide-edit-page-links true --force-production-navbar true --type links-check --local-sources --use-all-repositories true

Command to only build supported versions The real check requires to enable Antora Atlas. Otherwise, some cross references are not resolved like WARN: missing ref for bonita 2021.1 - some content have xref to this version

./build-preview-dev.bash \
  --hide-edit-page-links true \
  --force-production-navbar \
  --type links-check \
  --use-multi-repositories \
  --component-with-branches bcd:3.6,4.0 \
  --component-with-branches bonita:archives,2021.2,2022.1,2022.2,2023.1,2023.2 \
  --component-with-branches central:1.0 \
  --component-with-branches cloud:master \
  --component-with-branches labs:master \
  --component-with-branches test-toolkit:1.0,2.0 \
  --local-sources

Output

analysis of supported versions (without bonita 2021.1) 2023-09-01
✘✘✘ failed in 11m27.1693513s
987 errors in 3135 documents

Installation options

$ curl https://htmltest.wjdp.uk | bash -s -- -h
bash: download go binaries for wjdp/htmltest

Usage: bash [-b] bindir [-d] [tag]
  -b sets bindir or installation directory, Defaults to ./bin
  -d turns on debug logging
   [tag] is a tag from
   https://github.com/wjdp/htmltest/releases
   If tag is missing, then the latest will be used.
github-actions[bot] commented 10 months ago

🎊 PR Preview c7f6a8f730d191297abaf776e30ba3497362a4ae has been successfully built and deployed to https://bonitasoft-bonita-documentation-site-test-pr-618.surge.sh

:clock1: Build time: 0.013s

🤖 By surge-preview

github-actions[bot] commented 10 months ago

🎊 PR Preview 944a9bb937d99a98539bb2b5a1632686b4a3394c has been successfully built and deployed to https://bonitasoft-bonita-documentation-site-site-pr-618.surge.sh

:clock1: Build time: 0.013s

🤖 By surge-preview

sonarcloud[bot] commented 10 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud