Commit Graph

26 Commits (create-your-own-docs-tutorial)

Author SHA1 Message Date
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