diff --git a/.ci/link-checker/default.lycherc.toml b/.ci/link-checker/default.lycherc.toml index f769afc367..c247f67309 100644 --- a/.ci/link-checker/default.lycherc.toml +++ b/.ci/link-checker/default.lycherc.toml @@ -1,38 +1,36 @@ # Lychee link checker configuration -# Generated by link-checker +# Updated for link-checker v1.3.0 with severity-based classification +# +# With severity levels, we no longer need to exclude sites that return: +# - 403/401/429 (classified as "info" - shown but don't fail CI) +# - 5xx/timeout (classified as "warning" - shown but don't fail CI) +# Only 404/410/DNS failures are classified as "error" and fail CI. + [lychee] # Performance settings - -# Maximum number of retries for failed checks - max_retries = 3 - -# Timeout for each link check (in seconds) timeout = 30 - -# Maximum number of concurrent checks max_concurrency = 128 - skip_code_blocks = false # HTTP settings -# Identify the tool to external services user_agent = "Mozilla/5.0 (compatible; link-checker)" -# Accept these HTTP status codes as valid -accept = [200, 201, 202, 203, 204, 206, 301, 302, 303, 304, -307, 308] +# Accept these HTTP status codes as valid (2xx and redirects) +accept = [200, 201, 202, 203, 204, 206, 301, 302, 303, 304, 307, 308] # Skip these URL schemes scheme = ["file", "mailto", "tel"] # Exclude patterns (regex supported) +# NOTE: With v1.3.0 severity classification, we only need to exclude: +# - Non-HTTP URLs (localhost, local networks) +# - Placeholder/example URLs +# - Known false positives (not HTTP status related) exclude = [ - # Localhost URLs + # Localhost and local network URLs "^https?://localhost", "^https?://127\\.0\\.0\\.1", - - # Common CI/CD environments "^https?://.*\\.local", # Example domains used in documentation @@ -42,22 +40,6 @@ exclude = [ "https://example.com/REMOVED_FROM_CODE_BLOCK", "example.com/INLINE_CODE_URL", - # URLs that require authentication - "^https?://.*\\.slack\\.com", - "^https?://.*\\.atlassian\\.net", - - # GitHub URLs (often fail due to rate limiting and bot - # detection) - "^https?://github\\.com", - - # StackExchange network URLs (often block automated requests) - "^https?://.*\\.stackexchange\\.com", - "^https?://stackoverflow\\.com", - "^https?://.*\\.stackoverflow\\.com", - - # Docker Hub URLs (rate limiting and bot detection) - "^https?://hub\\.docker\\.com", - # Common documentation placeholders "YOUR_.*", "REPLACE_.*", @@ -67,8 +49,22 @@ exclude = [ # Request headers [headers] # Add custom headers here if needed -# "Authorization" = "Bearer $GITHUB_TOKEN" # Cache settings cache = true -max_cache_age = "1d" \ No newline at end of file +max_cache_age = "1d" + +# Severity classification (link-checker v1.3.0+) +# These settings control which HTTP status codes fail CI vs show as warnings/info +[severity] +# Error codes fail CI - genuine broken links +error_codes = [404, 410] + +# Warning codes are shown but don't fail CI - transient issues +warning_codes = [500, 502, 503, 504] + +# Info codes are low priority - access restrictions, bot protection +info_codes = [401, 403, 429] + +# Set to true to treat warnings as errors (stricter validation) +strict = false diff --git a/.ci/link-checker/production.lycherc.toml b/.ci/link-checker/production.lycherc.toml index 04fd241a8b..6f72bab1ac 100644 --- a/.ci/link-checker/production.lycherc.toml +++ b/.ci/link-checker/production.lycherc.toml @@ -1,23 +1,20 @@ # Production Link Checker Configuration for InfluxData docs-v2 -# Optimized for performance, reliability, and reduced false positives +# Updated for link-checker v1.3.0 with severity-based classification +# +# With severity levels, we no longer need to exclude sites that return: +# - 403/401/429 (classified as "info" - shown but don't fail CI) +# - 5xx/timeout (classified as "warning" - shown but don't fail CI) +# Only 404/410/DNS failures are classified as "error" and fail CI. + [lychee] # Performance settings - -# Maximum number of retries for failed checks - max_retries = 3 - -# Timeout for each link check (in seconds) timeout = 30 - -# Maximum number of concurrent checks max_concurrency = 128 - skip_code_blocks = false # HTTP settings -# Identify the tool to external services -"User-Agent" = "Mozilla/5.0 (compatible; influxdata-link-checker/1.0; +https://github.com/influxdata/docs-v2)" +"User-Agent" = "Mozilla/5.0 (compatible; influxdata-link-checker/1.3; +https://github.com/influxdata/docs-v2)" accept = [200, 201, 202, 203, 204, 206, 301, 302, 303, 304, 307, 308] # Skip these URL schemes @@ -31,12 +28,15 @@ max_cache_age = "1h" include_verbatim = false # Exclusion patterns for docs-v2 (regex supported) +# NOTE: With v1.3.0 severity classification, we only need to exclude: +# - Non-HTTP URLs (localhost, local networks) +# - Placeholder/example URLs +# - Known false positives (not HTTP status related) +# - CI-specific workarounds exclude = [ - # Localhost URLs + # Localhost and local network URLs "^https?://localhost", "^https?://127\\.0\\.0\\.1", - - # Common CI/CD environments "^https?://.*\\.local", # Example domains used in documentation @@ -46,51 +46,6 @@ exclude = [ "https://example.com/REMOVED_FROM_CODE_BLOCK", "example.com/INLINE_CODE_URL", - # URLs that require authentication - "^https?://.*\\.slack\\.com", - "^https?://.*\\.atlassian\\.net", - - # GitHub URLs (often fail due to rate limiting and bot - # detection) - "^https?://github\\.com", - - # Social media URLs (often block bots) - "^https?://reddit\\.com", - "^https?://.*\\.reddit\\.com", - - # StackExchange network URLs (often block automated requests) - "^https?://.*\\.stackexchange\\.com", - "^https?://stackoverflow\\.com", - "^https?://.*\\.stackoverflow\\.com", - - # Docker Hub URLs (rate limiting and bot detection) - "^https?://hub\\.docker\\.com", - - # InfluxData support URLs (certificate/SSL issues in CI) - "^https?://support\\.influxdata\\.com", - "^https?://influxdata\\.com/slack", - - # NSSM download URLs (403 errors for automated requests) - "^https?://nssm\\.cc/download", - - # AI platforms (often block automated requests) - "^https?://claude\\.ai", - "^https?://.*\\.claude\\.ai", - - # Microsoft Learn documentation (bot detection/rate limiting) - "^https?://learn\\.microsoft\\.com", - "^https?://.*\\.microsoft\\.com/.*", - - # Dremio download URLs (403 errors for automated requests) - "^https?://download\\.dremio\\.com", - - # Scarf analytics tracking pixels (certificate/network errors) - "^https?://static\\.scarf\\.sh", - - # Grafana documentation (bot detection/rate limiting) - "^https?://grafana\\.com", - "^https?://.*\\.grafana\\.com", - # Production site URLs (when testing locally, these should be relative) # This excludes canonical URLs and other absolute production URLs # TODO: Remove after fixing canonical URL generation or link-checker domain replacement @@ -100,7 +55,6 @@ exclude = [ # link-checker converts /path/to/page#fragment to file:///path/to/page#fragment # but the actual file is at /path/to/page/index.html, causing false fragment errors # TODO: Remove after fixing link-checker to handle Hugo pretty URLs with fragments - # See: https://github.com/influxdata/docs-tooling/issues/XXX "^file://.*#", # Common documentation placeholders @@ -109,10 +63,8 @@ exclude = [ "<.*>", ] -# Request headers +# Request headers (help avoid bot detection on some sites) [headers] -# Add custom headers here if needed -# "Authorization" = "Bearer $GITHUB_TOKEN" "Accept" = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" "Accept-Language" = "en-US,en;q=0.5" "Accept-Encoding" = "gzip, deflate" @@ -120,6 +72,21 @@ exclude = [ "Connection" = "keep-alive" "Upgrade-Insecure-Requests" = "1" +# Severity classification (link-checker v1.3.0+) +# These settings control which HTTP status codes fail CI vs show as warnings/info +[severity] +# Error codes fail CI - genuine broken links +error_codes = [404, 410] + +# Warning codes are shown but don't fail CI - transient issues +warning_codes = [500, 502, 503, 504] + +# Info codes are low priority - access restrictions, bot protection +info_codes = [401, 403, 429] + +# Set to true to treat warnings as errors (stricter validation) +strict = false + [ci] # CI-specific settings @@ -147,4 +114,4 @@ no_progress = true # Disable progress bar in CI # Summary settings show_success_count = true -show_skipped_count = true +show_skipped_count = true diff --git a/.github/workflows/pr-link-check.yml b/.github/workflows/pr-link-check.yml index 7f33806e0a..f4f280fa23 100644 --- a/.github/workflows/pr-link-check.yml +++ b/.github/workflows/pr-link-check.yml @@ -95,7 +95,7 @@ jobs: curl -L -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -o link-checker-info.json \ - "https://api.github.com/repos/influxdata/docs-v2/releases/tags/link-checker-v1.2.5" + "https://api.github.com/repos/influxdata/docs-v2/releases/tags/link-checker-v1.3.0" # Extract download URL for linux binary DOWNLOAD_URL=$(jq -r '.assets[] | select(.name | test("link-checker.*linux")) | .url' link-checker-info.json) diff --git a/content/influxdb3/cloud-serverless/sign-up.md b/content/influxdb3/cloud-serverless/sign-up.md index 7660c0817e..d79d24957e 100644 --- a/content/influxdb3/cloud-serverless/sign-up.md +++ b/content/influxdb3/cloud-serverless/sign-up.md @@ -137,7 +137,7 @@ complete the following steps: Click the following button to download and install `influx` CLI for macOS. -influx CLI (macOS) +influx CLI (macOS) #### Step 2: Unpackage the influx binary @@ -149,7 +149,7 @@ or run the following command in a macOS command prompt application such ```sh # Unpackage contents to the current working directory -tar zxvf ~/Downloads/influxdb2-client-2.7.5-darwin-amd64.tar.gz +tar zxvf ~/Downloads/influxdb2-client-{{< latest-patch cli=true >}}-darwin-amd64.tar.gz ``` #### Step 3: (Optional) Place the binary in your $PATH @@ -161,7 +161,7 @@ prefix the executable with `./` to run in place. If the binary is on your $PATH, ```sh # Copy the influx binary to your $PATH -sudo cp influxdb2-client-2.7.5-darwin-amd64/influx /usr/local/bin/ +sudo cp influxdb2-client-{{< latest-patch cli=true >}}-darwin-amd64/influx /usr/local/bin/ ``` > [!Note] @@ -204,8 +204,8 @@ To see all available `influx` commands, type `influx -h` or check out [influx - Click one of the following buttons to download and install the `influx` CLI appropriate for your chipset. -influx CLI (amd64) -influx CLI (arm) +influx CLI (amd64) +influx CLI (arm) #### Step 2: Unpackage the influx binary @@ -213,7 +213,7 @@ Click one of the following buttons to download and install the `influx` CLI appr ```sh # Unpackage contents to the current working directory -tar xvfz influxdb2-client-2.7.5-linux-amd64.tar.gz +tar xvfz influxdb2-client-{{< latest-patch cli=true >}}-linux-amd64.tar.gz ``` #### Step 3: (Optional) Place the binary in your $PATH @@ -225,7 +225,7 @@ prefix the executable with `./` to run in place. If the binary is on your $PATH, ```sh # Copy the influx and influxd binary to your $PATH -sudo cp influxdb2-client-2.7.5-linux-amd64/influx /usr/local/bin/ +sudo cp influxdb2-client-{{< latest-patch cli=true >}}-linux-amd64/influx /usr/local/bin/ ``` > [!Note] @@ -263,7 +263,7 @@ To see all available `influx` commands, type `influx -h` or check out [influx - Click the following button to download and install `influx` CLI for Windows. -influx CLI (Windows) +influx CLI (Windows) #### Step 2: Expand the downloaded archive diff --git a/content/shared/influxdb-v2/reference/cli/influx/_index.md b/content/shared/influxdb-v2/reference/cli/influx/_index.md index cbbb18516a..8d252697f4 100644 --- a/content/shared/influxdb-v2/reference/cli/influx/_index.md +++ b/content/shared/influxdb-v2/reference/cli/influx/_index.md @@ -79,12 +79,12 @@ brew list | grep influxdb-cli 1. **Download the `influx` CLI package.** - influx CLI v{{< latest-patch cli=true >}} (macOS) + influx CLI v{{< latest-patch cli=true >}} (macOS) @@ -99,7 +99,7 @@ brew list | grep influxdb-cli ```sh # Unpackage contents to the current working directory - tar zxvf ~/Downloads/influxdb2-client-2.7.5-darwin-amd64.tar.gz + tar zxvf ~/Downloads/influxdb2-client-{{< latest-patch cli=true >}}-darwin-amd64.tar.gz ``` 3. **(Optional) Place the binary in your `$PATH`.** @@ -107,7 +107,7 @@ brew list | grep influxdb-cli ```sh # (Optional) Copy the influx binary to your $PATH - sudo cp ~/Downloads/influxdb2-client-2.7.5-darwin-amd64/influx /usr/local/bin/ + sudo cp ~/Downloads/influxdb2-client-{{< latest-patch cli=true >}}-darwin-amd64/influx /usr/local/bin/ ``` If you do not move the `influx` binary into your `$PATH`, prefix the executable @@ -137,22 +137,22 @@ brew list | grep influxdb-cli #### Download from your browser - influx CLI v{{< latest-patch cli=true >}} (amd64) - influx CLI v{{< latest-patch cli=true >}} (arm) + influx CLI v{{< latest-patch cli=true >}} (amd64) + influx CLI v{{< latest-patch cli=true >}} (arm) #### Download from the command line ```bash # amd64 curl -O \ - https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.5-linux-amd64.tar.gz + https://dl.influxdata.com/influxdb/releases/influxdb2-client-{{< latest-patch cli=true >}}-linux-amd64.tar.gz ``` ```bash # arm curl -O \ - https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.5-linux-arm64.tar.gz \ + https://dl.influxdata.com/influxdb/releases/influxdb2-client-{{< latest-patch cli=true >}}-linux-arm64.tar.gz \ ``` 2. **Unpackage the downloaded package.** @@ -162,13 +162,13 @@ brew list | grep influxdb-cli ```bash # amd64 - tar xvzf influxdb2-client-2.7.5-linux-amd64.tar.gz + tar xvzf influxdb2-client-{{< latest-patch cli=true >}}-linux-amd64.tar.gz ``` ```bash # arm - tar xvzf influxdb2-client-2.7.5-linux-arm64.tar.gz + tar xvzf influxdb2-client-{{< latest-patch cli=true >}}-linux-arm64.tar.gz ``` 3. **(Optional) Place the unpackaged `influx` executable in your system `$PATH`.** @@ -196,15 +196,15 @@ Command Prompt is not fully compatible. 1. **Download the `influx` CLI package.** - influx CLI v{{< latest-patch cli=true >}} (Windows) + influx CLI v{{< latest-patch cli=true >}} (Windows) 2. **Expand the downloaded archive.** Expand the downloaded archive into `C:\Program Files\InfluxData\` and rename it if desired. ```powershell - > Expand-Archive .\influxdb2-client-2.7.5-windows-amd64.zip -DestinationPath 'C:\Program Files\InfluxData\' - > mv 'C:\Program Files\InfluxData\influxdb2-client-{{% latest-patch cli=true %}}-windows-amd64' 'C:\Program Files\InfluxData\influx' + > Expand-Archive .\influxdb2-client-{{< latest-patch cli=true >}}-windows-amd64.zip -DestinationPath 'C:\Program Files\InfluxData\' + > mv 'C:\Program Files\InfluxData\influxdb2-client-{{< latest-patch cli=true >}}-windows-amd64' 'C:\Program Files\InfluxData\influx' ``` 3. **Grant network access to the `influx` CLI.** diff --git a/cypress/e2e/content/latest-patch-shortcode.cy.js b/cypress/e2e/content/latest-patch-shortcode.cy.js new file mode 100644 index 0000000000..cfc3ecd9f4 --- /dev/null +++ b/cypress/e2e/content/latest-patch-shortcode.cy.js @@ -0,0 +1,40 @@ +/// + +/** + * Tests for the latest-patch shortcode with cli=true parameter. + * Verifies CLI version output across InfluxDB products. + */ +describe('latest-patch shortcode CLI version', function () { + it('outputs CLI version in InfluxDB v2 page', function () { + cy.task('getData', 'products').then((products) => { + const expectedCliVersion = products.influxdb.latest_cli.v2; + cy.visit('/influxdb/v2/tools/influx-cli/'); + cy.get('.article--content').should( + 'contain', + `influx CLI v${expectedCliVersion}` + ); + }); + }); + + it('outputs CLI version in InfluxDB Cloud page', function () { + cy.task('getData', 'products').then((products) => { + const expectedCliVersion = products.influxdb.latest_cli.v2; + cy.visit('/influxdb/cloud/tools/influx-cli/'); + cy.get('.article--content').should( + 'contain', + `influx CLI v${expectedCliVersion}` + ); + }); + }); + + it('outputs CLI version in InfluxDB Cloud Serverless page', function () { + cy.task('getData', 'products').then((products) => { + const expectedCliVersion = products.influxdb.latest_cli.v2; + cy.visit('/influxdb3/cloud-serverless/reference/cli/influx/'); + cy.get('.article--content').should( + 'contain', + `influx CLI v${expectedCliVersion}` + ); + }); + }); +}); diff --git a/layouts/shortcodes/latest-patch.html b/layouts/shortcodes/latest-patch.html index df03397a7b..d23045cf45 100644 --- a/layouts/shortcodes/latest-patch.html +++ b/layouts/shortcodes/latest-patch.html @@ -11,8 +11,10 @@ {{- $cliVersions := index .Site.Data.products.influxdb "latest_cli" -}} {{- $isInfluxDB3 := eq $product "influxdb3" -}} {{- if $cli }} - {{- if eq $version "cloud" -}} - {{- .Store.Set "patchVersion" (index $cliVersions $latestVersion) -}} + {{- /* For CLI versions, use influxdb's latest version as the lookup key for cloud products */ -}} + {{- $influxdbLatest := replaceRE `\..*$` "" (index .Site.Data.products.influxdb "latest") -}} + {{- if or (eq $version "cloud") (eq $version "cloud-serverless") -}} + {{- .Store.Set "patchVersion" (index $cliVersions $influxdbLatest) -}} {{- else -}} {{- .Store.Set "patchVersion" (index $cliVersions $version) -}} {{- end -}}