influxdata / influxdata/docs-v2
product-selector: v1 alt_link key collides between InfluxDB OSS v1 and InfluxDB Cloud 1
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 82
- Forks
- 326
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 82
Description
## Problem
`layouts/partials/topnav/product-selector.html` uses the alt_link key `v1` for both **InfluxDB OSS v1** (line 16) and **InfluxDB Cloud 1** (line 31):
```
{{ $influxdbOSSv1 := dict "influxdb/v1" (slice "InfluxDB OSS v1" "v1") }}
...
{{ $influxdbCloud1 := dict "influxcloud/v1" (slice $.Site.Data.products.influxdb_cloud1.name "v1") }}
```
When a page's frontmatter declares `alt_links: { v1: /some/path/ }`, the `productLink` template looks up the key and applies the same URL to both the OSS v1 slot and the Cloud 1 slot of the product selector dropdown — regardless of which product the link was intended for.
## Repro
1. Visit a page whose frontmatter sets `alt_links: { v1: /influxdb/v1/some-path/ }` (for example, any v1 release-notes or API page).
2. Open the product selector.
3. Both **InfluxDB OSS v1** and **InfluxDB Cloud 1** entries point to the same OSS v1 URL.
## Fix options
- Give Cloud 1 a distinct key, e.g. `cloud_v1` (parallel with `enterprise_v1`).
- Or: drop alt_link support for `influxcloud/v1` entirely and always use its special-link path (it already has a `$specialLink` branch in `productLink`).
Either way, any existing page-level `v1:` alt_links will still resolve correctly for OSS v1, and Cloud 1 will route through an unambiguous key or the special-link branch.
## Context
Found while auditing alt_link keys during #6622 (feat-api-uplift). Separate from that PR's fix for the `enterprise-v1` → `enterprise_v1` mismatch in `data/api_products.yml`.
Recap:
- Fixed in #6622 : data/api_products.yml's enterprise-v1 → enterprise_v1 key (commit a08dde3c1). That was the API pages' alt_links mapping to
layouts/partials/topnav/product-selector.html's enterprise_v1 key for enterprise_influxdb/v1.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in layouts/partials/topnav/product-selector.html and inspect the alt_link keys for the InfluxDB OSS v1 and Cloud 1 entries, including the productLink lookup and special-link branch. Choose one of the stated fixes with the maintainer, then reproduce the page-level v1 alt_link case and verify the product selector no longer sends both entries to the same URL.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100