@redpanda-data/docs-extensions-and-macros 3.2.9 → 3.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,6 @@ module.exports = async () => {
33
33
  .filter(tag => semver.valid(tag))
34
34
  // Sort in descending order to get the highest version first
35
35
  .sort(semver.rcompare);
36
- console.log(sortedReleases)
37
36
 
38
37
  if (sortedReleases.length > 0) {
39
38
  const latestRedpandaReleaseVersion = sortedReleases[0];
@@ -1,13 +1,14 @@
1
- const GetLatestRedpandaVersion = require('./get-latest-redpanda-version');
2
- const GetLatestConsoleVersion = require('./get-latest-console-version');
3
- const GetLatestOperatorVersion = require('./get-latest-operator-version');
4
- const GetLatestHelmChartVersion = require('./get-latest-redpanda-helm-version');
5
- const chalk = require('chalk');
1
+ const GetLatestRedpandaVersion = require('./get-latest-redpanda-version')
2
+ const GetLatestConsoleVersion = require('./get-latest-console-version')
3
+ const GetLatestOperatorVersion = require('./get-latest-operator-version')
4
+ const GetLatestHelmChartVersion = require('./get-latest-redpanda-helm-version')
5
+ const chalk = require('chalk')
6
+ const semver = require('semver')
6
7
 
7
8
  module.exports.register = function ({ config }) {
8
- const logger = this.getLogger('set-latest-version-extension');
9
+ const logger = this.getLogger('set-latest-version-extension')
9
10
  if (!process.env.REDPANDA_GITHUB_TOKEN) {
10
- logger.warn('REDPANDA_GITHUB_TOKEN environment variable not set. Attempting unauthenticated request.');
11
+ logger.warn('REDPANDA_GITHUB_TOKEN environment variable not set. Attempting unauthenticated request.')
11
12
  }
12
13
 
13
14
  this.on('contentClassified', async ({ contentCatalog }) => {
@@ -17,54 +18,49 @@ module.exports.register = function ({ config }) {
17
18
  GetLatestConsoleVersion(),
18
19
  GetLatestOperatorVersion(),
19
20
  GetLatestHelmChartVersion()
20
- ]);
21
+ ])
21
22
 
22
- // Extracting results with fallbacks if promises were rejected
23
- const LatestRedpandaVersion = results[0].status === 'fulfilled' ? results[0].value : null;
24
- const LatestConsoleVersion = results[1].status === 'fulfilled' ? results[1].value : null;
25
- const LatestOperatorVersion = results[2].status === 'fulfilled' ? results[2].value : null;
26
- const LatestHelmChartVersion = results[3].status === 'fulfilled' ? results[3].value : null;
23
+ const LatestRedpandaVersion = results[0].status === 'fulfilled' ? results[0].value : null
24
+ const LatestConsoleVersion = results[1].status === 'fulfilled' ? results[1].value : null
25
+ const LatestOperatorVersion = results[2].status === 'fulfilled' ? results[2].value : null
26
+ const LatestHelmChartVersion = results[3].status === 'fulfilled' ? results[3].value : null
27
27
 
28
- const components = await contentCatalog.getComponents();
28
+ const components = await contentCatalog.getComponents()
29
29
  components.forEach(component => {
30
30
  component.versions.forEach(({ name, version, asciidoc }) => {
31
31
  if (LatestConsoleVersion) {
32
- asciidoc.attributes['latest-console-version'] = LatestConsoleVersion;
33
- logger.info(`Set Redpanda Console version to ${LatestConsoleVersion} in ${name} ${version}`);
32
+ asciidoc.attributes['latest-console-version'] = `${LatestConsoleVersion}@`
33
+ logger.info(`Set Redpanda Console version to ${LatestConsoleVersion} in ${name} ${version}`)
34
34
  }
35
- });
35
+ })
36
36
 
37
37
  if (!component.latest.asciidoc) {
38
- component.latest.asciidoc = { attributes: {} };
38
+ component.latest.asciidoc = { attributes: {} }
39
39
  }
40
40
 
41
- // Handle each version setting with appropriate logging
42
- if (LatestRedpandaVersion) {
43
- component.latest.asciidoc.attributes['full-version'] = LatestRedpandaVersion[0];
44
- component.latest.asciidoc.attributes['latest-release-commit'] = LatestRedpandaVersion[1];
45
- logger.info(`Set the latest Redpanda version to ${LatestRedpandaVersion[0]} ${LatestRedpandaVersion[1]}`);
46
- } else {
47
- logger.warn("Failed to get the latest Redpanda version - using defaults");
41
+ if (LatestRedpandaVersion && semver.valid(LatestRedpandaVersion[0])) {
42
+ let currentVersion = component.latest.asciidoc.attributes['full-version'] || '0.0.0'
43
+ if (semver.gt(LatestRedpandaVersion[0], currentVersion)) {
44
+ component.latest.asciidoc.attributes['full-version'] = `${LatestRedpandaVersion[0]}@`
45
+ component.latest.asciidoc.attributes['latest-release-commit'] = `${LatestRedpandaVersion[1]}@`
46
+ logger.info(`Updated to latest Redpanda version: ${LatestRedpandaVersion[0]} with commit: ${LatestRedpandaVersion[1]}`)
47
+ }
48
48
  }
49
49
 
50
50
  if (LatestOperatorVersion) {
51
- component.latest.asciidoc.attributes['latest-operator-version'] = LatestOperatorVersion;
52
- logger.info(`Set the latest Redpanda Operator version to ${LatestOperatorVersion}`);
53
- } else {
54
- logger.warn("Failed to get the latest Operator version from GitHub - using default");
51
+ component.latest.asciidoc.attributes['latest-operator-version'] = `${LatestOperatorVersion}@`
52
+ logger.info(`Updated to latest Redpanda Operator version: ${LatestOperatorVersion}`)
55
53
  }
56
54
 
57
55
  if (LatestHelmChartVersion) {
58
- component.latest.asciidoc.attributes['latest-redpanda-helm-chart-version'] = LatestHelmChartVersion;
59
- logger.info(`Set the latest Redpanda Helm chart version to ${LatestHelmChartVersion}`);
60
- } else {
61
- logger.warn("Failed to get the latest Helm Chart version - using default");
56
+ component.latest.asciidoc.attributes['latest-redpanda-helm-chart-version'] = `${LatestHelmChartVersion}@`
57
+ logger.info(`Updated to latest Redpanda Helm chart version: ${LatestHelmChartVersion}`)
62
58
  }
63
- });
59
+ })
64
60
 
65
- console.log(`${chalk.green('Updated Redpanda documentation versions successfully.')}`);
61
+ console.log(`${chalk.green('Updated Redpanda documentation versions successfully.')}`)
66
62
  } catch (error) {
67
- logger.error(`Error updating versions: ${error}`);
63
+ logger.error(`Error updating versions: ${error}`)
68
64
  }
69
- });
70
- };
65
+ })
66
+ }
@@ -13,12 +13,12 @@ const buildConfigReference = ({ configRef, isKubernetes, isLink, path }) => {
13
13
  let ref = '';
14
14
  if (isLink) {
15
15
  if (isKubernetes) {
16
- ref = `xref:reference:${path}.adoc#${configRef}[storage.tieredConfig.${configRef}]`;
16
+ ref = `xref:reference:${path}.adoc#${configRef}[storage.tiered.config.${configRef}]`;
17
17
  } else {
18
18
  ref = `xref:reference:${path}.adoc#${configRef}[${configRef}]`;
19
19
  }
20
20
  } else {
21
- ref = isKubernetes ? `storage.tieredConfig.${configRef}` : `${configRef}`;
21
+ ref = isKubernetes ? `storage.tiered.config.${configRef}` : `${configRef}`;
22
22
  }
23
23
  return ref;
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redpanda-data/docs-extensions-and-macros",
3
- "version": "3.2.9",
3
+ "version": "3.2.11",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",