@redpanda-data/docs-extensions-and-macros 5.47.1 → 5.47.3

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.47.1",
3
+ "version": "5.47.3",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",
@@ -1249,7 +1249,21 @@ DOCS=../docs # path to your docs repo checkout
1249
1249
  git -C "$DOCS" show origin/main:docs-data/property-overrides.json \
1250
1250
  > __tests__/docs-data/property-overrides.json
1251
1251
 
1252
- git -C "$DOCS" show origin/main:modules/reference/attachments/redpanda-properties-v26.2.2.json \
1252
+ # docs' own regen renames this file forward on every release (see
1253
+ # property-corpus-drift.sh's header), so there is no fixed filename to
1254
+ # git-show -- a tag pinned here today 404s the moment docs regenerates again.
1255
+ # Discover the tag docs main is actually on: the highest version among
1256
+ # whatever is currently in modules/reference/attachments/. An old RC/beta
1257
+ # cycle's last file, if one is still sitting there, sorts lower and is
1258
+ # skipped -- see the property-extractor helpers for why more than one file
1259
+ # can exist at once.
1260
+ TAG="$(git -C "$DOCS" ls-tree origin/main --name-only -- modules/reference/attachments/ \
1261
+ | grep -oE 'redpanda-properties-(v[0-9]+\.[0-9]+\.[0-9]+[^.]*)\.json' \
1262
+ | sed -E 's/redpanda-properties-(.*)\.json/\1/' \
1263
+ | sort -V | tail -1)"
1264
+ echo "Refreshing against $TAG"
1265
+
1266
+ git -C "$DOCS" show "origin/main:modules/reference/attachments/redpanda-properties-${TAG}.json" \
1253
1267
  | node -e '
1254
1268
  const fs = require("fs");
1255
1269
  const src = JSON.parse(fs.readFileSync(0, "utf8"));
@@ -1261,8 +1275,9 @@ git -C "$DOCS" show origin/main:modules/reference/attachments/redpanda-propertie
1261
1275
  }
1262
1276
  const out = JSON.parse(fs.readFileSync("__tests__/docs-data/property-snapshot.json", "utf8"));
1263
1277
  out.properties = properties;
1264
- fs.writeFileSync("__tests__/docs-data/property-snapshot.json", JSON.stringify(out, null, 1));
1265
- '
1278
+ out.source_tag = process.argv[1];
1279
+ fs.writeFileSync("__tests__/docs-data/property-snapshot.json", JSON.stringify(out, null, 1) + "\n");
1280
+ ' "$TAG"
1266
1281
  ----
1267
1282
 
1268
1283
  The `docs` repo fails its own CI when the overrides mirror drifts, following the
@@ -183,9 +183,16 @@ class ConstexprCache:
183
183
  for search_dir in search_dirs:
184
184
  if not os.path.exists(search_dir):
185
185
  continue
186
-
186
+
187
187
  for root, dirs, files in os.walk(search_dir):
188
- for file in files:
188
+ # Deterministic traversal, same reasoning as get_file_pairs:
189
+ # constexpr_cache and function_cache below are plain dict
190
+ # assignment, last-write-wins, and an identifier redefined in
191
+ # more than one file would otherwise resolve to whichever
192
+ # file the filesystem's own directory order happened to
193
+ # visit last.
194
+ dirs.sort()
195
+ for file in sorted(files):
189
196
  if file.endswith(('.h', '.cc', '.hpp', '.cpp')):
190
197
  file_path = os.path.join(root, file)
191
198
  try:
@@ -616,9 +623,13 @@ def resolve_constexpr_identifier(identifier):
616
623
  if not os.path.exists(search_dir):
617
624
  continue
618
625
 
619
- # Walk through the directory recursively
626
+ # Walk through the directory recursively. Deterministic order, same
627
+ # reasoning as the ConstantResolver scan above: this feeds a
628
+ # last-write-wins dict, so an identifier defined in more than one
629
+ # file would otherwise resolve non-deterministically.
620
630
  for root, dirs, files in os.walk(search_dir):
621
- for file in files:
631
+ dirs.sort()
632
+ for file in sorted(files):
622
633
  # Check both .h and .cc files since definitions can be in either
623
634
  if file.endswith(('.h', '.cc', '.hpp', '.cpp')):
624
635
  file_path = os.path.join(root, file)
@@ -686,7 +697,17 @@ def get_file_pairs(options):
686
697
 
687
698
  file_pairs = []
688
699
 
689
- for i in file_iter:
700
+ # Sorted, not raw rglob/glob order: iteration order reflects the
701
+ # filesystem's own directory-entry order, which is not guaranteed stable
702
+ # across clones or machines. A property name registered in more than one
703
+ # file (api_doc_dir, in both pandaproxy/rest/ and
704
+ # pandaproxy/schema_registry/) hits the "different defined_in" branch in
705
+ # transform_files_with_properties below, which keeps whichever file was
706
+ # processed last -- non-deterministically, without the sort, since that
707
+ # depends on this exact order. Confirmed live: two regenerations of the
708
+ # same overrides-unchanged tag six minutes apart produced different
709
+ # defined_in values for api_doc_dir.
710
+ for i in sorted(file_iter):
690
711
  if os.path.exists(i.with_suffix(".cc")):
691
712
  file_pairs.append(FilePair(i.resolve(), i.with_suffix(".cc").resolve()))
692
713