Commit Graph

31 Commits (feat-api-uplift)

Author SHA1 Message Date
Jason Stirnaman 54cc064063
feat(ci): add ShellCheck linter to Lefthook pre-commit hooks (#6891)
* feat(ci): add ShellCheck linter to Lefthook pre-commit hooks

Add shell script linting via ShellCheck to catch common bugs (unquoted
variables, missing error handling, POSIX portability issues) before commit.

- Create `.shellcheckrc` with project-wide defaults (disable SC1091, SC2154)
- Create `.ci/shellcheck/shellcheck.sh` wrapper (local binary → Docker fallback)
- Add `shellcheck` pre-commit hook in `lefthook.yml` with glob/exclude patterns

Lints 23 infrastructure scripts (test, CI, deploy, helpers) while excluding
36 documentation example scripts in `shared/text/` and `layouts/shortcodes/`.

https://claude.ai/code/session_01X2gknrNvC5GGNExHU93FG6

* Update .shellcheckrc

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(ci): derive shellcheck minimum version from pinned version

Single source of truth — the minimum local version is now parsed from
SHELLCHECK_VERSION instead of being maintained as separate constants.
This prevents drift between the Docker image version and the local
binary requirement.

https://claude.ai/code/session_01X2gknrNvC5GGNExHU93FG6

* fix(ci): remove unused external-sources from .shellcheckrc

external-sources=true only takes effect with the -x flag, which the
wrapper doesn't pass. Source-following isn't needed for pre-commit
linting of individual files, and SC1091 is already disabled.

https://claude.ai/code/session_01X2gknrNvC5GGNExHU93FG6

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-28 12:39:59 -06:00
Jason Stirnaman 8035366677
refactor: replace URL-parsing in shortcodes with cascade product data (#6883)
* chore: add .worktrees to gitignore

* refactor: replace URL-parsing in shortcodes with cascade product data

Replace duplicated URL-parsing logic across 28 shortcodes with Hugo's
cascade frontmatter. Each product section's _index.md now cascades
`product` (data key) and `version` (URL segment) to all descendants.

Key changes:
- Add cascade frontmatter to 15 product _index.md files
- Create layouts/partials/product/get-data.html shared partial
- Refactor 28 shortcodes to use the partial instead of parsing URLs
- Add version_label, limits, and distributed_architecture metadata
  to data/products.yml to eliminate hardcoded dicts in shortcodes
- Fix lefthook lint-markdown-instructions glob format (YAML array)
- Fix pre-existing Vale exclamation point errors in cloud and v2

* fix: prevent remark-lint from escaping Hugo template syntax in shortcodes

Lefthook's glob option only triggers whether a command runs — it does
not filter {staged_files}. This caused remark-lint to process .md
shortcode files in layouts/, escaping underscores, brackets, and
parentheses that are valid Hugo template syntax.

Add layouts/ exclusion to the existing content/ filter in the
lint-markdown-instructions run command. Also fix the 3 shortcode files
that were damaged by remark-lint in the previous commit.

* test: add E2E tests for cascade product shortcodes

Add Cypress tests validating all refactored shortcodes across 14
product/version combos (82 tests). Test expectations are derived
from products.yml at runtime via cy.task('getData').

Fix the product links test to iterate actual home page links
instead of all products.yml entries.

Create _test/shortcodes.md pages in each product section
exercising product-name, product-key, current-version,
influxdb/host, and InfluxDB3-specific shortcodes.

* test: expand E2E coverage to 27 of 28 cascade shortcodes

Add shortcode invocations to all 14 test pages and corresponding
Cypress assertions for version lookups, namespace URLs, product
name text, placeholder_host, version visibility, CTA links, and
site-level data.

Add shortcodes-real-pages.cy.js for 6 shortcodes that require real
page context (cli/mapped, children, flux/list-all-functions,
telegraf/plugins, html-diagram/sso-auth-flow, cli/influxd-flags).

Suppress Vale on test pages — they contain only shortcode syntax,
not prose.

163 tests total, all passing.

* refactor(test): rename _test dirs to __tests__ and add noindex

Rename test page directories from _test to __tests__ to align with
JS testing conventions. Add noindex: true to all 14 test page
frontmatter to prevent search engine indexing in production.
Update Cypress URL pattern to match new paths.
2026-02-27 09:46:57 -06:00
Jason Stirnaman c97428b600
fix(influxdb3): correct Quix Streams guide for Cloud Dedicated (#6828)
* chore(deps): update yarn dependencies

Run yarn to update lockfile with latest compatible versions.

* fix(influxdb3): correct Quix Streams guide for Cloud Dedicated

Extract downsample-quix content to shared file and fix product-specific
terminology, links, and prerequisites for Cloud Dedicated and Clustered.

- Use "database" terminology for Cloud Dedicated/Clustered
- Remove Docker from prerequisites (not used in guide)
- Add alt_links for cross-product navigation
- Fix broken TOC anchor links
- Add links to admin pages for tokens and databases
- Remove incorrect /reference/regions link for Cloud Dedicated
- Add lint rules for deprecated code-placeholders and py fence

Closes #6825

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(influxdb3): fix broken code blocks in Quix Streams guide

Code blocks inside show-in shortcodes were missing closing fences,
causing the markdown to render incorrectly. Added proper fence
boundaries and placeholder key documentation for each code section.

Also adds TODO to content-editing skill about improving automation
for code-placeholder-key workflow.

* Docs v2 docs v2 pr6828 (#6829)

* fix(influxdb): Rename to match other pages. Remove alt_links

* chore(deps): bump ESLint to 10.0.0

* Update content/shared/v3-process-data/downsample/quix.md

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-17 15:23:16 -06:00
Jason Stirnaman 0fcf2bdd31
Note excluded internal-use options (#6571)
* chore: Standard exclude comment format to denote flags, options, etc. that shouldn't be promoted in docs

* chore: exclude internal flags

* chore: Add docs:exclude comments for internal CLI flags, fix linting

- Note internal options that should be ignored by `docs audit` and authors.
- Remove character escaping from GitHub callouts and placeholders

Lint config changes:
- Add explicit exclude for content/**/*.md in lint-markdown-instructions
- Exclude all markdown files from Prettier formatting

Fixes issue where remark-lint was auto-formatting content files and
escaping special characters like [!Note] callouts and underscores.

* fix: cleanup escaping
2025-11-25 16:58:29 -06:00
Jason Stirnaman efd288fdb8
fix(lint): disable remark formatting for content files to preserve GitHub Alerts (#6502)
Remark-stringify escapes square brackets in GitHub Alerts syntax
(> [!Note] becomes > \[!Note]), breaking alert rendering.

Changes:
- Remove lint-markdown-content pre-commit hook from lefthook.yml
- Configure remark-lint-no-undefined-references to allow GitHub Alerts
- Add remark-lint-no-undefined-references dependency
- Unescaped GitHub Alerts in content/create.md

Content files now preserve GitHub Alerts syntax while instruction files
continue to use remark auto-formatting (they don't contain alerts).
Vale provides adequate style linting for content files.

Closes #6501
See: https://github.com/remarkjs/remark-gfm/issues/53
2025-10-31 14:07:01 -05:00
Jason Stirnaman 624c6ad0d8
Jts contrib and linting fixes (#6494)
* feat(ci): improve linting configuration for instruction files

- Add GitHub-flavored Markdown support with remark-gfm
- Create generic Vale config (.vale-instructions.ini) for instruction files
- Use pattern-based file inclusion instead of explicit file lists
- Mount repository to /workdir in remark-lint container to preserve node_modules

Changes:
- Add remark-gfm to .ci/remark-lint/package.json
- Create .remarkrc.yaml at repository root for instruction files
- Update content/.remarkrc.yaml to include remark-gfm
- Create .vale-instructions.ini for generic writing rules
- Update compose.yaml: mount repo to /workdir (preserves /app/node_modules)
- Update lefthook.yml: use glob patterns for uppercase .md files and .github/**/*.md
- Update DOCS-CONTRIBUTING.md: remove empty CONTRIBUTING.md directory reference

Benefits:
- Automatic inclusion of new instruction files without config updates
- Pattern matching for uppercase .md files (DOCS-*.md, CLAUDE.md, etc.)
- Coverage for .github/, .claude/, api-docs/ directories
- GFM features: tables, task lists, strikethrough, autolinks, footnotes
- Separate linting rules for instruction files vs product documentation

feat(lint): separate remark-lint auto-fix for instructions vs report-only for content

- Split lint-markdown into two hooks:
  - lint-markdown-instructions: Auto-fixes README, DOCS-*.md, .github/**, .claude/**
  - lint-markdown-content: Reports issues in content/**, api-docs/** without modifying
- Changed remark-lint volume mount from read_only: true to read_only: false
- Instruction files now behave like Prettier (auto-fix + stage)
- Content files report errors and block commits until manually fixed

* chore(instructions): Add content/shared details, husky/lefthook updates
2025-10-27 20:24:25 -05:00
Jason Stirnaman 3a857320e8 chore(instructions): restructure agent instructions build process
Remove contributing.instructions.md build logic and simplify to only
build platform reference from products.yml. Update lefthook to only
trigger on products.yml changes instead of CONTRIBUTING.md.
2025-10-08 16:15:30 -05:00
Jason Stirnaman e93e78be0a feat(influxdb): Version detector shortcode triggers a modal
Creates an interactive InfluxDB version detector component in TypeScript and a shortcode that generates a button to trigger
the version detector modal.
The shortcode takes a parameter that displays a predefined set of links for results.
- Support URL pattern matching and ping header analysis
- Add questionnaire-based product identification logic
- Adds the shortcode in a note in /influxdb3/core/visualize-data/grafana/
- Set up TypeScript configuration for the project
  - Configure automatic TypeScript compilation in pre-commit hooks
- Add to Grafana documentation pages
- Remove last remnants of old Cypress link checker
- Add Cypress tests, but many are still broken

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

Update layouts/shortcodes/influxdb-version-detector.html

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

Update assets/js/influxdb-version-detector.ts

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

Update assets/styles/components/_influxdb-version-detector.scss

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

Fixes:
- Fix Hugo template to include product names in detector config
- Change elimination scores from -100 to -1000 for proper filtering
- Add scoring logic for generic "InfluxDB" product (OSS v2.x)
- Exclude generic "InfluxDB" from results (too vague)
- Add comprehensive test scenario checklist to Cypress tests
- Free license now correctly excludes Enterprise, Clustered, Dedicated
- Self-hosted now correctly excludes all Cloud products
- SQL language now correctly excludes v1 and v2 products
- Results now show only specific products (OSS 1.x, OSS 2.x, etc.)
Changes:
- When users answer "I'm not sure" to all questions, show a helpful
message directing them to the reference table instead of showing
a weak ranking with low confidence.
- Detect when all questionnaire answers are "unknown"
- Display custom message explaining lack of information
- Auto-expand reference table for easy product identification
- Hide ranked results when insufficient information provided
- Make product names clickable in the quick reference table to allow
users to quickly navigate to product documentation after identifying
their InfluxDB version.
2025-09-30 19:01:21 -05:00
Jason Stirnaman a8578bb0af chore(ci): Removes old Cypress link checker test code 2025-08-18 10:51:57 -05:00
Jason Stirnaman 6a4e8827eb feat(testing): add link validation automation and improvements
- Add GitHub Actions for automated link validation on PRs
- Implement incremental validation with caching (30-day TTL, configurable)
- Add matrix generator for parallel validation strategy
- Create comprehensive TESTING.md documentation
- Add cache manager with configurable TTL via env var or CLI
- Implement smart link extraction and validation
- Add PR comment generator for broken link reports
- Update Cypress tests to use incremental validation
- Consolidate testing docs from CONTRIBUTING.md to TESTING.md

Key improvements:
- Cache-aware validation only checks changed content
- Parallel execution for large changesets
- Detailed PR comments with broken link reports
- Support for LINK_CACHE_TTL_DAYS env var
- Local testing with yarn test:links
- Reduced false positives through intelligent caching
2025-07-28 16:24:24 -05:00
Jason Stirnaman d98a77fa66
Merge branch 'master' into fix-agent-instructions 2025-07-09 16:47:38 -05:00
Jason Stirnaman fb743d70e3 chore(qol): Restructure CONTRIBUTING.md and improve agent instructions:
- control what content gets processed by adding the
  appropriate tags in CONTRIBUTING.md--for example:\

  - <!-- agent:instruct: essential --> - Keep all content
  - <!-- agent:instruct: condense --> - Summarize to key points
  - <!-- agent:instruct: remove --> - Skip entirely

- rename and move script to helper-scripts
2025-07-09 15:39:51 -05:00
Jason Stirnaman cf092cfb17 fix(test): revert to staged_files 2025-07-09 09:03:45 -05:00
Jason Stirnaman 28b2241248
Merge branch 'master' into jts-qol-influxdb3-release-helper-scripts 2025-07-07 16:06:31 -05:00
Jason Stirnaman 1d67b79f03
Merge branch 'master' into fix-lefthook-patterns 2025-07-07 16:04:57 -05:00
Jason Stirnaman eb83cc7767 fix(ci): run the shortcode
examples test against the example.md file whenever relevant
  files (assets, layouts, or the example file itself) are staged
2025-07-07 12:13:36 -05:00
Jason Stirnaman 9b4aac82aa fix(ci): Lefthook e2e-links command should only look for files in staged_files 2025-07-07 12:13:36 -05:00
Jason Stirnaman 9e956dd00e fix(lefthook): glob syntax 2025-06-17 16:54:44 -05:00
Jason Stirnaman 3609fc9c92 chore(ci): Fail the commit if a module imports or uses debug helpers 2025-06-09 17:12:40 -05:00
Jason Stirnaman 5e4dd46778
Update lefthook.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-06 17:26:11 -05:00
Jason Stirnaman ad8fbc37dc fix(lefthook): Incorrect glob patterns. Add linting for influxdb3/explorer 2025-06-04 17:40:53 -05:00
Jason Stirnaman badc27190e chore(ci): Lefthook: pass push files to test commands 2025-05-28 22:43:13 -05:00
Jason Stirnaman 5da0442727 chore(qol): Build custom CoPilot instructions from CONTRIBUTING.md:
- Add a script and pre-commit command to generate a CoPilot instructions file  from CONTRIBUTING.md guidelines.
- Add custom instructions for CoPilot to help with influxdb3 placeholders
2025-05-27 10:33:12 -05:00
Jason Stirnaman 4cfff239f3 End-to-end testing, CI script, and JavaScript QoL improvements:
- **Environment variable formatting** - Updated environment variable configuration from array format to object format to comply with Lefthook schema validation requirements.
- **Unified link testing** - Consolidated multiple product-specific link testing commands into a single `e2e-links` command that processes all staged Markdown and HTML files across content directories.
- **Package script integration** - Modified commands to use centralized yarn scripts instead of direct execution, improving maintainability and consistency.
- **Source information extraction** - Enhanced to correctly extract and report source information from frontmatter.
- **URL and source mapping** - Improved handling of URL to source path mapping for better reporting.
- **Ignored anchor links configuration** - Added proper exclusion of behavior-triggering anchor links (like tab navigation) to prevent false positives.
- **Request options correction** - Fixed Cypress request options to ensure `failOnStatusCode` is properly set when `retryOnStatusCodeFailure` is enabled.
- **Improved error reporting** - Enhanced error reporting with more context about broken links.
- **New test scripts added** - Added centralized testing scripts for link checking and codeblock validation.
- **Product-specific test commands** - Added commands for each product version (InfluxDB v2, v3 Core, Enterprise, Cloud, etc.).
- **API docs testing** - Added specialized commands for testing API documentation links.
- **Comprehensive test runners** - Added commands to run all tests of a specific type (`test:links:all`, `test:codeblocks:all`).
- Fix Docker build command and update CONTRIBUTING.

chore(js): JavaScript QoL improvements:

- Refactor main.js with a componentRegistry object and clear initialization of components and globals
- Add a standard index.js with all necessary exports.
- Update javascript.html to use the index.js
- Remove jQuery script tag from header javascript.html (remains in footer)
- Update package file to improve module discovery.
- Improve Hugo and ESLint config for module discovery and ES6 syntax
2025-05-19 09:50:33 -05:00
Jason Stirnaman 9755033970 chore(ci): closes #5887 Improve and automate pre-commit link-checking 2025-03-13 14:24:36 -05:00
Jason Stirnaman 73e25245af chore(oss): Update install instructions, mostly for Linux
- Updates Linux install instructions to reflect updates in the Downloads page.
- Uses curl, instead of wget, for examples.
- Reorg of download verification: moves expandable details before instructions, to encourage using verification.
  Includes verification in instructions.
- All tests pass if not explicitly skipped (for Docker and different architectures).
- Run `docker compose build` to update the Go version and other dependencies used by the
  test image.
2024-08-30 16:21:23 -05:00
Jason Stirnaman df39d7cd86 chore(telegraf): Update and improve Telegraf install instructions
- Updates Telegraf install instructions, adds more info to promote verifying downloads.
- Adds setup for tests.
- Makes tests pass in install and configuration docs.
- Adds Vale.sh exception to allow duration values inside code blocks.
- Adds Dockerfiles for convenience to test install procedures in CentOS and Ubuntu.
- Clarifies and fixes config file handling and specifying input and output plugins.
2024-08-26 16:32:16 -05:00
Jason Stirnaman 10b2b1e7dd chore(ci): Ignore duration literals inside code blocks when linting time units, fix lefthook tag delimiters. 2024-08-21 11:51:01 -05:00
Jason Stirnaman 11bc7d5168 fix(v2): http-write-timeout
- Fix the http-write-timeout definition, which should be similar to https://pkg.go.dev/net/http#Server.WriteTimeout
- Add a Vale spelling config for v2 server options
- Add influxdb to the test container packages (for testing service influxdb...)
- Add Dockerfile config and test setup for testing some InfluxDB startup config options (using influxd)
2024-07-30 18:18:26 -05:00
Jason Stirnaman 94348a8739 fix(ci): Lefthook config typo. Update management token variable name in env.test.example 2024-07-23 15:34:42 -05:00
Jason Stirnaman 37a7a7c6e7 chore(ci): Improve pre-commit hook, test harness, and linter
- Pre-commit hook:
       - Redo test harness so commands can run in parallel
       - Cleanup Vale command args
       - Replace lint-staged and husky with Lefthook.
    - Pre-push hook:
       - Scan for package vulnerabilities
    - Tests
      - Run tests on demand, in parallel, or debugged using docker compose up, run, exec, etc.
      - Each test container (service) runs the prepare-content script before running tests.
      - Return to using Python instead of Docker to provide environment variables so they don't get exposed in Docker inspect.
      - Bind mount influxctl config.toml and .env.test files
      - Bind mount scripts for faster builds while iterating on test scripts.
    - Vale:
      - Override Acronyms style def--ignore acronym if it's linked.
2024-07-23 15:08:28 -05:00