Skip to content

Commit

Permalink
Merge develop into main (#413)
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Howell <[email protected]>
Co-authored-by: Anatolii Zhmaiev <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2024
1 parent b34dc81 commit 5f3522d
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These owners will be the default owners for everything in
# the repo
* @Serdaro
* @oliverhowell @amandalindsay @Rob-Hazelcast
30 changes: 30 additions & 0 deletions .github/actions/validate/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Validate
description: Check for dead links

runs:
using: 'composite'
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Checkout global antora-playbook
uses: actions/checkout@v4
with:
repository: hazelcast/hazelcast-docs
sparse-checkout: |
antora-playbook.yml
lib/load-check-links-playbook.js
sparse-checkout-cone-mode: false
path: hazelcast-docs
ref: main

- name: Check for broken internal links
shell: bash
run: |
cp "./hazelcast-docs/lib/load-check-links-playbook.js" "./load-check-links-playbook.js"
npm i
npm i -D [email protected]
node load-check-links-playbook.js $GITHUB_REPOSITORY $GITHUB_BASE_REF
./node_modules/.bin/antora --fetch --to-dir test --log-level=error --log-failure-level=error --extension=@jcahills/antora-link-checker check-links-playbook.yml
62 changes: 37 additions & 25 deletions antora-playbook-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ content:
start_path: docs
- url: https://github.com/hazelcast/hz-flow-docs
branches: [main]
start_path: docs
start_path: docs
- url: https://github.com/hazelcast/imdg-docs
branches: [v/*]
start_path: docs
Expand Down Expand Up @@ -231,8 +231,20 @@ antora:
- require: '@djencks/antora-aggregate-collector'
trace: true
componentversions:
- name: management-center
version: '6.0-snapshot'
mappings:
- module: integrate
family: attachment
origin:
url:
include:
- '**/hazelcast/management-center'
branch:
includes:
- 'master'
- name: hazelcast
version: '5.5-snapshot'
version: '6.0-snapshot'
mappings:
- module: maintain-cluster
family: attachment
Expand All @@ -244,7 +256,7 @@ antora:
includes:
- 'master'
- name: management-center
version: '5.5-snapshot'
version: '5.6'
mappings:
- module: integrate
family: attachment
Expand All @@ -254,9 +266,9 @@ antora:
- '**/hazelcast/management-center'
branch:
includes:
- 'master'
- '5.6.0'
- name: management-center
version: '5.3'
version: '5.5'
mappings:
- module: integrate
family: attachment
Expand All @@ -266,21 +278,21 @@ antora:
- '**/hazelcast/management-center'
branch:
includes:
- '5.3.0'
- name: management-center
version: '5.2'
- '5.5.2'
- name: hazelcast
version: '5.5'
mappings:
- module: integrate
- module: maintain-cluster
family: attachment
origin:
url:
include:
- '**/hazelcast/management-center'
- '**/hazelcast/hazelcast-mono'
branch:
includes:
- '5.2.z'
- '5.5.z'
- name: management-center
version: '5.1'
version: '5.4'
mappings:
- module: integrate
family: attachment
Expand All @@ -290,43 +302,43 @@ antora:
- '**/hazelcast/management-center'
branch:
includes:
- '5.1.z'
- '5.4.1'
- name: management-center
version: '5.4'
version: '5.3'
mappings:
- module: integrate
family: attachment
origin:
url:
include:
- '**/hazelcast/management-center'
branch:
includes:
- '5.4.0'
branch:
includes:
- '5.3.4'
- name: management-center
version: "5.5"
version: '5.2'
mappings:
- module: integrate
family: attachment
origin:
url:
include:
- '**/hazelcast/management-center'
branch:
includes:
- 5.5.0
branch:
includes:
- '5.2.1'
- name: management-center
version: "5.6"
version: '5.1'
mappings:
- module: integrate
family: attachment
origin:
url:
include:
- '**/hazelcast/management-center'
branch:
includes:
- 5.6.0
branch:
includes:
- '5.1.4'
- require: ./lib/api_json.js
tags:
- Favorites
Expand Down
66 changes: 33 additions & 33 deletions antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ site:
docsearch_id: 'QK2EAH8GB0'
docsearch_api: 'ef7bd9485eafbd75d6e8425949eda1f5'
docsearch_index: 'prod_hazelcast_docs'
ai_search_id: '6b326171-dd1e-40c6-a948-1f9bb6c0ed52'
ai_search_id: '6b326171-dd1e-40c6-a948-1f9bb6c0ed52'
urls:
# https://docs.antora.org/antora/latest/playbook/urls-html-extension-style/
html_extension_style: drop
Expand Down Expand Up @@ -203,10 +203,10 @@ content:
branches: [master, 5.5.z]
start_path: docs/rest
- url: https://github.com/hazelcast/management-center
branches: [master, 5.4.0, 5.5.0, 5.6.0]
branches: [master, 5.4.1, 5.5.2, 5.6.0]
start_path: hazelcast-management-center/src/openapi/external
- url: https://github.com/hazelcast/management-center
branches: [5.1.z, 5.2.z, 5.3.0]
branches: [5.1.4, 5.2.1, 5.3.4]
start_path: openapi/external
- url: https://github.com/hazelcast-guides/csharp-client-getting-started
branches: master
Expand Down Expand Up @@ -236,7 +236,7 @@ ui:
# Needed for API calls from Cloud Web App (Learning Centre page)
supplemental_files:
- path: netlify.toml
contents: >
contents: |
[[headers]]
for = "/api/*"
[headers.values]
Expand All @@ -249,6 +249,18 @@ antora:
- require: '@djencks/antora-aggregate-collector'
trace: true
componentversions:
- name: management-center
version: '6.0-snapshot'
mappings:
- module: integrate
family: attachment
origin:
url:
include:
- '**/hazelcast/management-center'
branch:
includes:
- 'master'
- name: hazelcast
version: '6.0-snapshot'
mappings:
Expand All @@ -270,23 +282,11 @@ antora:
url:
include:
- '**/hazelcast/management-center'
branch:
includes:
- '5.6.0'
- name: hazelcast
version: '5.5'
mappings:
- module: maintain-cluster
family: attachment
origin:
url:
include:
- '**/hazelcast/hazelcast-mono'
branch:
includes:
- '5.5.z'
- '5.6.0'
- name: management-center
version: '6.0-snapshot'
version: '5.5'
mappings:
- module: integrate
family: attachment
Expand All @@ -296,21 +296,21 @@ antora:
- '**/hazelcast/management-center'
branch:
includes:
- 'master'
- name: management-center
- '5.5.2'
- name: hazelcast
version: '5.5'
mappings:
- module: integrate
- module: maintain-cluster
family: attachment
origin:
url:
include:
- '**/hazelcast/management-center'
- '**/hazelcast/hazelcast-mono'
branch:
includes:
- '5.5.0'
- '5.5.z'
- name: management-center
version: '5.3'
version: '5.4'
mappings:
- module: integrate
family: attachment
Expand All @@ -320,9 +320,9 @@ antora:
- '**/hazelcast/management-center'
branch:
includes:
- '5.3.0'
- '5.4.1'
- name: management-center
version: '5.2'
version: '5.3'
mappings:
- module: integrate
family: attachment
Expand All @@ -332,9 +332,9 @@ antora:
- '**/hazelcast/management-center'
branch:
includes:
- '5.2.z'
- '5.3.4'
- name: management-center
version: '5.1'
version: '5.2'
mappings:
- module: integrate
family: attachment
Expand All @@ -344,19 +344,19 @@ antora:
- '**/hazelcast/management-center'
branch:
includes:
- '5.1.z'
- '5.2.1'
- name: management-center
version: '5.4'
version: '5.1'
mappings:
- module: integrate
family: attachment
origin:
url:
include:
- '**/hazelcast/management-center'
branch:
includes:
- '5.4.0'
branch:
includes:
- '5.1.4'
- require: ./lib/api_json.js
tags:
- Favorites
Expand Down
54 changes: 54 additions & 0 deletions lib/load-check-links-playbook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const YAML = require('yaml');
const fs = require('fs');

const [currentRepoName, baseBranchName] = process.argv.slice(-2);

console.log('Checking links...');

if (currentRepoName.endsWith('.js') || baseBranchName.endsWith('.js')) {
throw new Error('GitHub repository name and base branch should be passed as arguments');
}

console.log('Repository name: ', currentRepoName);
console.log('Base branch: ', baseBranchName);

// 1. Load and parse local antora-playbook.yml
const localAntoraPlaybookContent = fs.readFileSync('./antora-playbook.yml', 'utf8');
const localAntoraPlaybook = YAML.parse(localAntoraPlaybookContent);

// 2. Load and parse global antora-playbook.yml's content.sources
const globalAntoraPlaybookContent = fs.readFileSync('./hazelcast-docs/antora-playbook.yml', 'utf8');
const globalAntoraPlaybook = YAML.parse(globalAntoraPlaybookContent);
let globalSources = globalAntoraPlaybook.content.sources;
// 3. Modify global content.sources
// - add hazelcast-docs GitHub URL
const hazelcastDocsSource = globalSources.find(source => source.url === '.');
hazelcastDocsSource.url = 'https://github.com/hazelcast/hazelcast-docs';

// - remove hazelcast-mono & management-center,
// because they have only Swagger docs thus will never have links to the current
// and also they require authentication
globalSources = globalSources.filter(source =>
!(source.url === 'https://github.com/hazelcast/hazelcast-mono')
&& !(source.url === 'https://github.com/hazelcast/management-center'));

// - add current branch
globalSources.unshift({
url: '.',
branches: 'HEAD',
start_path: 'docs',
});

// - remove current target branch from the global content list
const currentRepoSource = globalSources.find(source => source.url.endsWith(currentRepoName));
currentRepoSource.branches.push(`!${baseBranchName}`);

// 4. Replace local content.sources with the modified content.sources
localAntoraPlaybook.content.sources = globalSources;
const checkLinksPlaybook = YAML.stringify(localAntoraPlaybook);

fs.writeFileSync(
'./check-links-playbook.yml',
checkLinksPlaybook,
{ encoding: 'utf8' },
);
2 changes: 0 additions & 2 deletions templates/antora.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: templates
title: Templates
version: v0.1
nav:
- modules/ROOT/nav.adoc


0 comments on commit 5f3522d

Please sign in to comment.