refactor(search): derive result labels from products.yml - #7571
Open
jstirnaman wants to merge 3 commits into
Open
refactor(search): derive result labels from products.yml#7571jstirnaman wants to merge 3 commits into
jstirnaman wants to merge 3 commits into
Conversation
Contributor
Release version checkNo release-notes pages with a tracked version changed in this PR. 💡 Badge new features with the versionDocumenting a new feature? Add a version badge in the page frontmatter — the
For inline version text, use |
Contributor
🔗 Link Check Results — Link Check Bot✅ All links are valid
|
| Source File | URL | Issue |
|---|---|---|
content/enterprise_influxdb/v1/introduction/installation/single-server/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/influxdb/v1/introduction/install/_index.md |
https://support.influxdata.com/ | Error (cached): Error (cached) |
content/influxdb/v1/introduction/install/_index.md |
https://reddit.com/r/influxdb | Error (cached) |
content/influxdb/v2/install/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/influxdb/v2/install/_index.md |
https://reddit.com/r/influxdb | Error (cached) |
content/influxdb/v2/install/_index.md |
https://docs.docker.com/engine/reference/run/#detached-vs-foreground | Cannot find fragment: Cannot find fragment |
content/influxdb3/core/install/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/influxdb3/enterprise/install/_index.md |
https://support.influxdata.com/ | Error (cached): Error (cached) |
content/influxdb3/enterprise/install/_index.md |
https://reddit.com/r/influxdb | Error (cached) |
content/influxdb3/explorer/install/_index.md |
https://reddit.com/r/influxdb | Error (cached) |
content/influxdb3/explorer/install/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/telegraf/v1/install/_index.md |
https://support.influxdata.com/ | Error (cached): Error (cached) |
content/telegraf/v1/install/_index.md |
https://reddit.com/r/influxdb | Error (cached) |
content/telegraf/v1/install/_index.md |
https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/starting-windows-powershell… | Cannot find fragment: Cannot find fragment |
Full details: workflow run summary and artifact. Last updated: 2026-07-28 19:25:59 UTC
Contributor
📦 PR Preview — Preview Bot
Preview auto-deploys on push. Will be cleaned up when PR closes. |
feedback.html derives the product key from the URL path, with special cases for InfluxDB 3 and Cloud (TSM). /telegraf/controller/ and /telegraf/enterprise/ hit no special case, so both resolved to the `telegraf` entry and rendered its name and its public issue-tracker button. Telegraf Controller and Telegraf Enterprise are licensed products. Like every other licensed product, they should point customers to support rather than a public tracker. Resolve them to their own products.yml entries, which declare no product_issue_url, so the button does not render. The pages now also name the product they document in the feedback text. Add both URLs to the licensed list in article-feedback.cy.js, along with /influxdb3/cloud/, which was missing from it.
Search result labels were built by concatenating the product and version URL segments through two hardcoded maps. The URL segment is not the product name: /influxdb3/cloud-dedicated/, /influxdb3/cloud-serverless/, and /influxdb3/clustered/ rendered as "InfluxDB 3 Cloud Dedicated", "InfluxDB 3 Cloud Serverless", and "InfluxDB 3 Clustered". Their names are "InfluxDB Cloud Dedicated", "InfluxDB Cloud Serverless", and "InfluxDB Clustered". Hugo already passes data/products.yml into the browser bundle as a js.Build param, so take the names from there. Add utils/product-labels.js, which maps a URL path to a product by matching whole content_path segments, longest path first. Whole-segment matching keeps /influxdb3/cloud/ from matching /influxdb3/cloud-dedicated/, and longest-first keeps /telegraf/ from matching /telegraf/controller/. Add the missing content_path for telegraf_controller and telegraf_enterprise. Both publish content and both are in the search index. getProductLabelMap() in .github/scripts/workflow-utils.js also reads content_path but requires label_group, which neither product has, so GitHub labeling is unchanged. Replaces the product-scoped override map added for /influxdb3/cloud/, which products.yml now covers.
jstirnaman
force-pushed
the
refactor-search-labels-from-products
branch
from
July 28, 2026 13:57
0500a53 to
1dd0903
Compare
sanderson
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #7569. Review that one first; this PR's base is
fix-search-version-label.What changed
Search result labels now come from
data/products.ymlinstead of twohardcoded maps in
assets/js/components/doc-search.js.assets/js/utils/product-labels.js. It maps a URL path to aproduct by matching whole
content_pathsegments, longest path first,and returns that product's
name.doc-search.jsimportsproductsfromassets/js/services/influxdata-products.jsand deletes both display-namemaps, including the product-scoped override added in fix(search): label /influxdb3/cloud hits as Cloud, not Cloud (TSM) #7569.
content_pathtotelegraf_controllerandtelegraf_enterprisein products.yml. Both publish content and both are in the search index.
assets/js/__tests__/product-labels.test.mjs, which runs against the realproducts.yml.
Second commit, required by the products.yml change:
feedback.htmlresolves
/telegraf/controller/and/telegraf/enterprise/to their ownproduct entries.
Why
The URL path segment is not the product name. Concatenating
productDisplayNames[segment0]andversionDisplayNames[segment1]producedthree wrong labels:
name/influxdb3/cloud-dedicated//influxdb3/cloud-serverless//influxdb3/clustered/namespacein products.yml records this: those three products havenamespace: influxdb, notinfluxdb3, even though they live under/influxdb3/. The maps had no way to express that.Hugo already passes products.yml into the browser bundle as a
js.Buildparam (
layouts/partials/header/javascript.html:56), so the data wasavailable the whole time.
Impact
Three products lose the "3" in search result labels, matching their
official names. All other labels are unchanged, including
/influxdb/cloud/-> "InfluxDB Cloud (TSM)" and/influxdb3/cloud/->"InfluxDB 3 Cloud".
/telegraf/controller/and/telegraf/enterprise/no longer render a"Submit Telegraf issue" button, and their feedback text now names the
product they document rather than "Telegraf". Both are licensed products,
so they now behave like every other licensed product: docs issue button
only, support contract link for the product. Flagging this explicitly since
it removes a button. If Telegraf Controller and Telegraf Enterprise are
meant to accept public issues on
influxdata/telegraf, the fix instead isa
product_issue_urlon both entries, and I will swap it.Search tags and the Algolia index are untouched. See below.
Verification
Rendered output, from
public/after a full build:The unit tests load the real
data/products.yml, so they also fail if acontent_pathis dropped or a product is renamed.Not done, and why
The plan included switching
search.htmlandsearch-attributes.htmlofffindREpath parsing and onto theproductcascade param. The data saysnot to.
docsearch:searchTagis an index key, and 53,135 records arealready crawled under path-derived tags.
content_pathdoes not reproducethem for five products:
content_pathtelegraftelegraf-v1chronografchronograf-v1kapacitorkapacitor-v1fluxflux-v0enterprise_influxdbenterprise_influxdb-v1content_pathpoints at the product root; the tag includes the versionsegment. Switching the tag source would orphan those five products from
their indexed records. The tag stays path-derived. Only the display names
move to products.yml.
Follow-up
Four places derive product identity from the URL path, and each handles
/influxdb3/cloud/differently:assets/js/utils/product-mappings.ts:101—URL_PATTERN_MAPhas no/influxdb3/cloud/, sogetProductKeyFromPath()returns null. It alsomatches
/telegraf/before/telegraf/controller/.assets/js/page-context.ts:29— no/influxdb3/cloud/pattern, sogetCurrentProductData()returns{ product: 'other' }. That feedsanalytics context and ask-ai.
layouts/partials/article/feedback.html:17— special-case ladder, whichthis PR adds a fourth branch to.
layouts/partials/footer/search.html:1andheader/search-attributes.html:1—findRE, which must stay for thereason above.
Every page already declares its product via cascade
(
content/*/*/_index.md), andlayouts/partials/product/get-data.htmlresolves it. Worth a separate pass.