From 138e26a300c0356076f113c6dea644819ef6698d Mon Sep 17 00:00:00 2001 From: "james.haytko" Date: Mon, 9 Nov 2026 17:30:15 -0600 Subject: [PATCH 1/2] feat(1secure): keep the 1Secure Beta product off production Adds a devOnly product flag. products.js leaves devOnly products out of PRODUCTS when APP_EXTERNAL_URL is the production host (docs.netwrix.com), so the beta is built on docs-dev and locally but gets no plugin, routes, or pages on production, even though its files merge to main in the daily sync. Remove the flag to release the product. Co-Authored-By: Claude Sonnet 5.5 --- package.json | 2 +- src/config/products.js | 23 ++++++++++++++++++++++- src/config/products.test.mjs | 30 ++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 src/config/products.test.mjs diff --git a/package.json b/package.json index 76d45cf779..d3a28380e6 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "quality:readability": "node scripts/quality/readability.mjs", "quality:fix": "node scripts/quality/fix-loop.mjs", "slack:sync": "node scripts/sync-team-slack-map.mjs", - "test:scripts": "bash scripts/test-slugify.sh && bash scripts/test-heading-skip.sh && bash scripts/test-md-extension-autofix.sh && node --test scripts/test-set-blob-metadata.mjs && node scripts/test-set-blob-metadata-integration.mjs && node --test scripts/claude/test-log-summary.mjs && node --test scripts/test-vale-local.mjs && node --test scripts/test-resolve-path-labels.mjs && node --test scripts/test-sync-team-slack-map.mjs && node --test scripts/test-preserve-content.mjs && node --test src/plugins/robotsTxt.test.mjs && node --test src/config/docVariables.test.mjs && node scripts/quality/gen-lint-digest.mjs --check", + "test:scripts": "bash scripts/test-slugify.sh && bash scripts/test-heading-skip.sh && bash scripts/test-md-extension-autofix.sh && node --test scripts/test-set-blob-metadata.mjs && node scripts/test-set-blob-metadata-integration.mjs && node --test scripts/claude/test-log-summary.mjs && node --test scripts/test-vale-local.mjs && node --test scripts/test-resolve-path-labels.mjs && node --test scripts/test-sync-team-slack-map.mjs && node --test scripts/test-preserve-content.mjs && node --test src/plugins/robotsTxt.test.mjs && node --test src/config/docVariables.test.mjs && node --test src/config/products.test.mjs && node scripts/quality/gen-lint-digest.mjs --check", "prepare": "node scripts/hooks/install.mjs" }, "dependencies": { diff --git a/src/config/products.js b/src/config/products.js index d19c09005a..1f093c2c29 100644 --- a/src/config/products.js +++ b/src/config/products.js @@ -11,6 +11,8 @@ * - Easier maintenance and fewer places for errors */ +import { isIndexableSite } from './indexing.js'; + /** * @typedef {Object} ProductVersion * @property {string} version - Version string (e.g., "12.0", "saas") @@ -33,6 +35,7 @@ * @property {string} [icon] - Icon for the product * @property {string} [navbarGroup] - Products sharing a navbarGroup are shown as one nested submenu with this label inside their category dropdown * @property {boolean} [hideFromNavbar] - Leave the product out of the navbar dropdowns and the landing page. Its pages stay reachable by URL. + * @property {boolean} [devOnly] - Build the product on docs-dev and locally but not on the production site (docs.netwrix.com). The pages still merge to main with the rest of dev; production just doesn't build them. Remove the flag to release the product. * @property {boolean} [noIndex] - Keep the product out of search engines and site search: its pages carry a noindex tag and are left out of the sitemap, production robots.txt disallows its routes, and it is not offered in the search product filter. Pair with hideFromNavbar for an unlisted product such as a beta. */ @@ -40,7 +43,7 @@ * All Netwrix products and their configurations * @type {Product[]} */ -export const PRODUCTS = [ +const ALL_PRODUCTS = [ { id: '1secure', name: '1Secure', @@ -66,6 +69,7 @@ export const PRODUCTS = [ icon: '', hideFromNavbar: true, // Unlisted beta: reachable by URL only noIndex: true, + devOnly: true, // Not built on production until the beta is released versions: [ { version: 'current', @@ -789,6 +793,23 @@ export const PRODUCTS = [ }, ]; +/** + * True when this build is for the production site (docs.netwrix.com). The + * client bundle has no APP_EXTERNAL_URL, so there it is false and devOnly + * products stay in the list. That is harmless: they have no routes in production. + */ +function isProductionBuild() { + const url = typeof process !== 'undefined' ? process.env?.APP_EXTERNAL_URL : undefined; + return Boolean(url) && isIndexableSite(url); +} + +/** + * Products the site builds. Products flagged devOnly are left out of the + * production build, so they get no plugin, routes, or pages there. + * @type {Product[]} + */ +export const PRODUCTS = ALL_PRODUCTS.filter((product) => !(product.devOnly && isProductionBuild())); + /** * Product categories with their metadata */ diff --git a/src/config/products.test.mjs b/src/config/products.test.mjs new file mode 100644 index 0000000000..125d437e32 --- /dev/null +++ b/src/config/products.test.mjs @@ -0,0 +1,30 @@ +import assert from 'node:assert/strict'; +import { test } from 'node:test'; + +// products.js reads APP_EXTERNAL_URL when it loads, so each case imports a fresh copy. +async function loadProducts(siteUrl, tag) { + const previous = process.env.APP_EXTERNAL_URL; + if (siteUrl === undefined) delete process.env.APP_EXTERNAL_URL; + else process.env.APP_EXTERNAL_URL = siteUrl; + try { + return (await import(`./products.js?${tag}`)).PRODUCTS; + } finally { + if (previous === undefined) delete process.env.APP_EXTERNAL_URL; + else process.env.APP_EXTERNAL_URL = previous; + } +} + +const ids = (products) => products.map((product) => product.id); + +test('devOnly products are left out of the production build', async () => { + const products = await loadProducts('https://docs.netwrix.com', 'production'); + assert.equal(ids(products).includes('1securebeta'), false); + assert.equal(ids(products).includes('1secure'), true); +}); + +test('devOnly products are built on docs-dev and locally', async () => { + for (const [url, tag] of [['https://docs-dev.netwrix.com', 'dev'], ['http://localhost:4500', 'local'], [undefined, 'unset']]) { + const products = await loadProducts(url, tag); + assert.equal(ids(products).includes('1securebeta'), true, String(url)); + } +}); From 19197f6a8e5ee13582bbbecf919d1163d8216bbb Mon Sep 17 00:00:00 2001 From: "james.haytko" Date: Mon, 9 Nov 2026 17:31:26 -0600 Subject: [PATCH 2/2] feat(1secure): rename the beta product to 1Secure AI Security Renames the product ID, folder, sidebar, and name to 1secureaisecurity / 1Secure AI Security. The URL is now /docs/1secureaisecurity. Co-Authored-By: Claude Sonnet 5.5 --- .github/CODEOWNERS | 4 ++-- docs/1secureaisecurity/index.md | 11 +++++++++++ docs/1securebeta/index.md | 11 ----------- sidebars/{1securebeta.js => 1secureaisecurity.js} | 0 src/config/products.js | 10 +++++----- src/config/products.test.mjs | 4 ++-- src/plugins/robotsTxt.js | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 docs/1secureaisecurity/index.md delete mode 100644 docs/1securebeta/index.md rename sidebars/{1securebeta.js => 1secureaisecurity.js} (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cd5260e141..485daff9a3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,8 +12,8 @@ # 1Secure team /docs/1secure/ @netwrix/1secure-docs /sidebars/1secure.js @netwrix/1secure-docs -/docs/1securebeta/ @netwrix/1secure-docs -/sidebars/1securebeta.js @netwrix/1secure-docs +/docs/1secureaisecurity/ @netwrix/1secure-docs +/sidebars/1secureaisecurity.js @netwrix/1secure-docs /static/files/1secure/ @netwrix/1secure-docs /static/images/1secure/ @netwrix/1secure-docs diff --git a/docs/1secureaisecurity/index.md b/docs/1secureaisecurity/index.md new file mode 100644 index 0000000000..22f770d1bf --- /dev/null +++ b/docs/1secureaisecurity/index.md @@ -0,0 +1,11 @@ +--- +title: "Netwrix 1Secure AI Security Documentation" +description: "Pre-release documentation for Netwrix 1Secure AI Security." +sidebar_position: 1 +--- + +# Netwrix 1Secure AI Security Documentation + +This section holds pre-release documentation for Netwrix 1Secure AI Security. It isn't listed in the site navigation or search results. + +{/* TODO: replace this placeholder with the beta overview */} diff --git a/docs/1securebeta/index.md b/docs/1securebeta/index.md deleted file mode 100644 index aeba2bcef0..0000000000 --- a/docs/1securebeta/index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Netwrix 1Secure Beta Documentation" -description: "Pre-release documentation for Netwrix 1Secure Beta." -sidebar_position: 1 ---- - -# Netwrix 1Secure Beta Documentation - -This section holds pre-release documentation for Netwrix 1Secure Beta. It isn't listed in the site navigation or search results. - -{/* TODO: replace this placeholder with the beta overview */} diff --git a/sidebars/1securebeta.js b/sidebars/1secureaisecurity.js similarity index 100% rename from sidebars/1securebeta.js rename to sidebars/1secureaisecurity.js diff --git a/src/config/products.js b/src/config/products.js index 1f093c2c29..9a7f24fd8f 100644 --- a/src/config/products.js +++ b/src/config/products.js @@ -61,10 +61,10 @@ const ALL_PRODUCTS = [ ], }, { - id: '1securebeta', - name: '1Secure Beta', - description: 'Pre-release documentation for Netwrix 1Secure', - path: 'docs/1securebeta', + id: '1secureaisecurity', + name: '1Secure AI Security', + description: 'Pre-release documentation for Netwrix 1Secure AI Security', + path: 'docs/1secureaisecurity', categories: ['Data Security Posture Management (DSPM)'], icon: '', hideFromNavbar: true, // Unlisted beta: reachable by URL only @@ -75,7 +75,7 @@ const ALL_PRODUCTS = [ version: 'current', label: 'Current', isLatest: true, - sidebarFile: './sidebars/1securebeta.js', + sidebarFile: './sidebars/1secureaisecurity.js', kb: false, // No Knowledge Base for the beta }, ], diff --git a/src/config/products.test.mjs b/src/config/products.test.mjs index 125d437e32..3be61aaeee 100644 --- a/src/config/products.test.mjs +++ b/src/config/products.test.mjs @@ -18,13 +18,13 @@ const ids = (products) => products.map((product) => product.id); test('devOnly products are left out of the production build', async () => { const products = await loadProducts('https://docs.netwrix.com', 'production'); - assert.equal(ids(products).includes('1securebeta'), false); + assert.equal(ids(products).includes('1secureaisecurity'), false); assert.equal(ids(products).includes('1secure'), true); }); test('devOnly products are built on docs-dev and locally', async () => { for (const [url, tag] of [['https://docs-dev.netwrix.com', 'dev'], ['http://localhost:4500', 'local'], [undefined, 'unset']]) { const products = await loadProducts(url, tag); - assert.equal(ids(products).includes('1securebeta'), true, String(url)); + assert.equal(ids(products).includes('1secureaisecurity'), true, String(url)); } }); diff --git a/src/plugins/robotsTxt.js b/src/plugins/robotsTxt.js index f828ae623d..5ad4b2691d 100644 --- a/src/plugins/robotsTxt.js +++ b/src/plugins/robotsTxt.js @@ -3,7 +3,7 @@ import { join } from 'path'; import { isIndexableSite } from '../config/indexing.js'; import { PRODUCTS, generateRouteBasePath } from '../config/products.js'; -/** Route prefixes of products flagged noIndex, for example /docs/1securebeta. */ +/** Route prefixes of products flagged noIndex, for example /docs/1secureaisecurity. */ export function noIndexRoutes(products = PRODUCTS) { return products .filter((product) => product.noIndex)