@redpanda-data/docs-extensions-and-macros 5.11.1 → 5.12.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redpanda-data/docs-extensions-and-macros",
3
- "version": "5.11.1",
3
+ "version": "5.12.0",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",
@@ -102,7 +102,8 @@
102
102
  "cli-utils",
103
103
  "tools",
104
104
  "docker-compose",
105
- "mcp"
105
+ "mcp",
106
+ "docs-data/rpk-overrides.schema.json"
106
107
  ],
107
108
  "license": "ISC",
108
109
  "engines": {
@@ -149,8 +150,8 @@
149
150
  "yargs": "^17.7.2"
150
151
  },
151
152
  "devDependencies": {
152
- "@antora/cli": "3.1.4",
153
- "@antora/site-generator": "3.1.4",
153
+ "@antora/cli": "^3.1.15",
154
+ "@antora/site-generator": "^3.1.15",
154
155
  "@asciidoctor/core": "2.2.8",
155
156
  "@web/dev-server": "^0.2.5",
156
157
  "jest": "^29.7.0",
@@ -500,10 +500,23 @@ def add_cloud_support_metadata(properties: Dict, cloud_config: CloudConfig) -> D
500
500
  skipped_count += 1
501
501
  continue
502
502
 
503
- # Only process cluster, broker, and topic properties for cloud support
503
+ # Only cluster properties get cloud metadata.
504
+ #
505
+ # The two sections this data comes from -- customer_managed_configs
506
+ # and readonly_cluster_config -- describe the Cloud control plane's
507
+ # view of CLUSTER configuration, and contain nothing else: every one
508
+ # of their entries resolves to a cluster property, and no topic
509
+ # property appears anywhere in the install pack.
510
+ #
511
+ # Emitting cloud_supported: false for a topic or broker property
512
+ # therefore asserted something this source cannot know. Downstream
513
+ # that read as "a Cloud reader cannot set this", which is wrong for
514
+ # topic properties -- Cloud users set them routinely through the
515
+ # Kafka API and Console, a surface the control plane does not gate.
516
+ # Leave the fields absent instead, so absent means "no opinion" and
517
+ # false keeps its meaning of "the control plane forbids it".
504
518
  config_scope = prop_data.get('config_scope', '')
505
- if config_scope not in ['cluster', 'broker', 'topic']:
506
- # Skip node config properties and others without cloud relevance
519
+ if config_scope != 'cluster':
507
520
  skipped_count += 1
508
521
  continue
509
522
 
@@ -422,10 +422,50 @@ function buildComponentMap(indexObj) {
422
422
  return map;
423
423
  }
424
424
 
425
+ /**
426
+ * Whether to refresh the Connect plugin before reading its version.
427
+ *
428
+ * Only ephemeral environments should: the refresh uses "install --force",
429
+ * which skips the safeguard that "upgrade" applies to a self-managed plugin
430
+ * (see the comment in getRpkConnectVersion), so on a real machine it can
431
+ * change which Connect binary the user runs afterwards.
432
+ *
433
+ * Defaults to on when CI is set. RPCN_FORCE_CONNECT_INSTALL overrides in
434
+ * either direction, for forcing a refresh locally or suppressing one in a
435
+ * CI-like environment that owns its own Connect installation.
436
+ */
437
+ function shouldRefreshConnectPlugin() {
438
+ const override = process.env.RPCN_FORCE_CONNECT_INSTALL;
439
+ if (override !== undefined && override !== '') {
440
+ return !['0', 'false', 'no', 'off'].includes(override.toLowerCase());
441
+ }
442
+ return Boolean(process.env.CI);
443
+ }
444
+
425
445
  function getRpkConnectVersion() {
426
446
  try {
427
- // Make sure the connect plugin is upgraded first (silent)
428
- execSync('rpk connect upgrade', { stdio: 'ignore' });
447
+ // Ensure the connect plugin is current (silent). Deliberately "install
448
+ // --force", not "upgrade": upgrade's version comparison parses the
449
+ // currently-installed version through a regex capped at two digits per
450
+ // segment (redpanda.VersionFromString in rpk/pkg/redpanda/version.go),
451
+ // which throws for any Connect version >= 4.100.0 — the same bug class
452
+ // as CON-529, in a different function that its fix didn't touch. Fixed
453
+ // upstream on dev (redpanda commit 8fc022e7) but present in all rpk
454
+ // releases up to at least v26.2.1; keep this workaround until a fixed
455
+ // rpk release ships. install's "latest" path (the default) skips that
456
+ // regex entirely, so it isn't exposed to the bug.
457
+ //
458
+ // The trade-off is that "install --force" drops a safeguard "upgrade"
459
+ // keeps: upgrade refuses to touch a plugin whose Managed flag is false
460
+ // (rpk/pkg/cli/connect/upgrade.go), which is how a Connect installed by
461
+ // Homebrew or by hand is protected. A forced install instead writes a
462
+ // managed binary into the plugin dir that rpk prioritises, shadowing
463
+ // that installation for every later rpk call. So refresh only where the
464
+ // Connect installation is disposable, and leave a developer's machine
465
+ // exactly as it is — reporting the version already installed there.
466
+ if (shouldRefreshConnectPlugin()) {
467
+ execSync('rpk connect install --force', { stdio: 'ignore' });
468
+ }
429
469
 
430
470
  // Now capture the --version output
431
471
  const raw = execSync('rpk connect --version', {
@@ -444,7 +484,13 @@ function getRpkConnectVersion() {
444
484
  }
445
485
  return match[1];
446
486
  } catch (err) {
447
- throw new Error(`Unable to run "rpk connect --version": ${err.message}`);
487
+ // Outside CI the plugin is never installed on the caller's behalf, so say
488
+ // how to get one rather than only reporting that the call failed.
489
+ const hint = shouldRefreshConnectPlugin()
490
+ ? ''
491
+ : ' If Redpanda Connect is not installed, run "rpk connect install" first,' +
492
+ ' or set RPCN_FORCE_CONNECT_INSTALL=1 to let this command install it.';
493
+ throw new Error(`Unable to run "rpk connect --version": ${err.message}${hint}`);
448
494
  }
449
495
  }
450
496
 
@@ -11,7 +11,9 @@ const { spawnSync } = require('child_process')
11
11
 
12
12
  const docsDir = process.argv[2] || '../docs'
13
13
  const rpkDir = path.join(docsDir, 'modules/reference/pages/rpk')
14
- const overridesPath = path.join(__dirname, '../../docs-data/rpk-overrides.json')
14
+ // The canonical overrides live in the docs repo (the docsDir this script
15
+ // already takes); this repo ships only the schema.
16
+ const overridesPath = process.argv[3] || path.join(docsDir, 'docs-data/rpk-overrides.json')
15
17
 
16
18
  // Validate docsDir exists and is a directory
17
19
  if (!fs.existsSync(docsDir) || !fs.statSync(docsDir).isDirectory()) {