From 77b9b04f1df3dcf3e78404ba2dd00a3b64be9184 Mon Sep 17 00:00:00 2001 From: kapunahelewong Date: Thu, 1 Oct 2026 14:59:16 -0700 Subject: [PATCH] Support renamed gen_reference_docs target in Mintlify docs check bazelbuild/bazel#31268 renames gen_mdx_reference_docs to gen_reference_docs, and the draft bazelbuild/bazel#31269 renames its output from mdx-reference-docs.zip to reference-docs.zip. Build whichever target the checked-out Bazel defines and ask Bazel for the output name, so the check works before and after both renames. --- mintlify/check_docs.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mintlify/check_docs.sh b/mintlify/check_docs.sh index 2d7962696a..9b2809dcb4 100644 --- a/mintlify/check_docs.sh +++ b/mintlify/check_docs.sh @@ -13,10 +13,20 @@ if [[ "$(git config --get remote.origin.url)" == */bazel.git ]]; then echo "--- :bazel::books: Building reference docs" echo "Work dir: $(pwd)" - bazel --quiet build \ - //src/main/java/com/google/devtools/build/lib:gen_mdx_reference_docs - - ARCHIVE=bazel-bin/src/main/java/com/google/devtools/build/lib/mdx-reference-docs.zip + # gen_mdx_reference_docs was renamed to gen_reference_docs + # (https://github.com/bazelbuild/bazel/issues/31211). + # Support both names so that older commits and release branches still work. + LIB_PKG=src/main/java/com/google/devtools/build/lib + TARGET="//${LIB_PKG}:gen_reference_docs" + if ! grep -q 'name = "gen_reference_docs"' "${LIB_PKG}/BUILD"; then + TARGET="//${LIB_PKG}:gen_mdx_reference_docs" + fi + + bazel --quiet build "$TARGET" + + # Ask Bazel for the output name instead of hardcoding it, since the archive + # may be renamed too (mdx-reference-docs.zip -> reference-docs.zip). + ARCHIVE="bazel-bin/${LIB_PKG}/$(basename "$(bazel --quiet cquery --output=files "$TARGET")")" buildkite-agent artifact upload "$ARCHIVE" || echo "--- [nonblocker] FYI: Docs upload failed"