refactor(api-docs): unified post-processor, directory flatten, CI build step#6939
Open
jstirnaman wants to merge 71 commits intofeat-api-upliftfrom
Open
refactor(api-docs): unified post-processor, directory flatten, CI build step#6939jstirnaman wants to merge 71 commits intofeat-api-upliftfrom
jstirnaman wants to merge 71 commits intofeat-api-upliftfrom
Conversation
Rename Core and Enterprise OpenAPI spec files from ref.yml to descriptive names (influxdb3-core-openapi.yaml, influxdb3-enterprise-openapi.yaml). Copy specs to static/openapi/ and add download links in the API description.
Rename Core and Enterprise OpenAPI spec files from ref.yml to descriptive names (influxdb3-core-openapi.yaml, influxdb3-enterprise-openapi.yaml). Copy specs to static/openapi/ and add download links in the API description.
- Add detectApiPages() to detect-preview-pages.js to auto-map changed api-docs/ files to their content URL paths via .config.yml - Add has-api-doc-changes output to detect-preview-pages.js - Fix needs-author-input logic to not request input when API pages are already auto-detected - Add Build API docs step to pr-preview.yml that runs yarn run build:api-docs before the Hugo build when api-doc changes detected Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>
Extract all api-docs/ changes from feat-api-uplift into a standalone branch for independent testing and merging to master. Changes include: - Updated generation scripts (generate-openapi-articles.ts, openapi-paths-to-hugo-data/index.ts) for Hugo-native templates - Removed dead x-tagGroups infrastructure (decorator, config files) - Updated Core and Enterprise specs with tag descriptions, x-related links, and Cache Data tag split - Added v1 product configs and specs (OSS v1, Enterprise v1) - Updated getswagger.sh for renamed spec files - Updated generate-api-docs.sh with clean regeneration support
…ew (#6890) * feat: add doc review pipeline implementation plan Detailed plan for two interconnected systems: 1. Label system overhaul (22 automation-driven labels replacing 30+ inconsistent ones) 2. Doc review workflow (Claude visual review + Copilot structural review with screenshots) This is a plan document only — no implementation changes. https://claude.ai/code/session_01D5rLaHdQv9iBL55UEsdQFt * fix: split product:v3 into v3-monolith and v3-distributed labels - product:v3-monolith: Core, Enterprise (single-node / clusterable) - product:v3-distributed: Cloud Serverless, Cloud Dedicated, Clustered - Updated auto-label path mappings to match content directory structure - Updated migration mapping and label count (22 → 23) https://claude.ai/code/session_01D5rLaHdQv9iBL55UEsdQFt * feat: define agent instruction file architecture in Phase 3 - One CLAUDE.md (pointer) → role-specific files in .claude/agents/ - doc-triage-agent.md: label taxonomy, path mapping, priority rules - doc-review-agent.md: review scope, severity classification, output format - Prompt file (.github/prompts/) references agent file, stays workflow-specific - Updated file summary and implementation order https://claude.ai/code/session_01D5rLaHdQv9iBL55UEsdQFt * feat: move visual/screenshot review from Claude to Copilot Claude now handles diff-only Markdown review (frontmatter, shortcodes, style, terminology). Copilot handles visual review by analyzing screenshots posted as images in PR comments. Key changes: - Job 3 (Claude) runs in parallel with Jobs 1→2→4 (diff-only, no screenshots) - Job 4 (Copilot) analyzes screenshots via @copilot PR comment mentions - Two prompt files: doc-review.md (Claude), copilot-visual-review.md (Copilot) - doc-review-agent.md scoped to diff-only (no screenshot analysis) - Q1 resolved: screenshots delivered to Copilot via PR comment images - Reduced Claude API cost (no image processing) - Added Copilot failure handling (fallback to human review of artifacts) https://claude.ai/code/session_01D5rLaHdQv9iBL55UEsdQFt * chore: resolve all open questions in doc review pipeline plan Convert Q2–Q5 from open recommendations to resolved decisions: - Q2: Advisory only (no required status checks) until false-positive rate confirmed - Q3: Playwright for CI screenshots, Puppeteer for local debugging - Q4: Poll preview URL with 15s interval and 10-min timeout - Q5: Cost acceptable with existing mitigations (path filters, skip-review, concurrency) Rename section from "Open Questions" to "Decisions (Resolved)". https://claude.ai/code/session_01D5rLaHdQv9iBL55UEsdQFt * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix label naming inconsistency and document workflow migration requirements (#6893) * Initial plan * fix: resolve label naming inconsistency and document workflow updates - Rename review:approved to approval:codeowner to avoid confusion with review/* labels - Add note explaining the distinct prefix to prevent implementor confusion - Document required workflow updates for sync-plugin-docs label migration - Specify exact files and line numbers that need updating Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> * feat(ci): add doc review pipeline and deduplicate instruction files Add Phase 2-3 pipeline components: doc-review workflow (3-job architecture), Claude/Copilot review prompts, URL resolver script, triage and review agents, and label guide. Deduplicate AGENTS.md (254→96 lines) by removing content available in referenced docs. Remove duplicate sections from copilot-instructions.md (264→221 lines). AGENTS.md now contains only high-signal guidelines loaded every session: commands, constraints, style rules, product paths, and reference pointers. * task: updated PR pipeline plan * task: remove old cli plan * task: products file now contains content path mappings and (GitHub) label groups for each product. Product group labels will be used to assign reviewers and help with content checks. * feat(ci): add auto-label workflow for PR product detection Add auto-label workflow that applies product and source labels to PRs based on changed file paths, using data/products.yml as the source of truth. Add workflow-utils.js shared helper for product path matching. * refactor(ci): extract shared label and review format definitions Consolidate duplicated label definitions and review comment format into shared source-of-truth files to prevent context drift. New files: - data/labels.yml: source, waiting, workflow, review, and product:shared label definitions (names, colors, descriptions) - .github/templates/review-comment.md: severity levels, comment structure, result rules, and result-to-label mapping Updated consumers to reference shared files instead of inline copies: - .claude/agents/doc-review-agent.md - .claude/agents/doc-triage-agent.md - .github/prompts/copilot-visual-review.md - .github/LABEL_GUIDE.md Workflow fixes: - Pin all GitHub Actions to SHA hashes - Fix fromJson() for url-count comparison in doc-review.yml - Fix fallback handler to remove all review:* labels before re-adding * refactor(ci): replace Claude review with Copilot native code review - Remove claude-code-action job, use `copilot-reviews` reviewer instead - Extract review criteria to .github/instructions/content-review.instructions.md - Simplify copilot-instructions.md by removing duplicated content - Harden auto-label workflow (scoped permissions, pagination, concurrency) - Upsert visual review comments instead of creating duplicates - Delete unused .github/prompts/doc-review.md * Update .github/workflows/doc-review.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/DOC-REVIEW-PIPELINE-PLAN.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * task: update review pipeline plan * task: add label-migration scripts. These are one-use scripts that we'll remove after the label migration * Update .github/workflows/doc-review.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/doc-review.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/auto-label.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * style: remove unnecessary escape in regex character class * feat(ci): add workflow_dispatch to auto-label and doc-review workflows - Add workflow_dispatch with pr_number input to both workflows for manual testing and on-demand re-runs - Migrate sync-plugin-docs label references to source:sync - Add area:agents, area:ci, area:links, release:*, good-first-issue, source:feedback, waiting:pr to labels.yml - Update products.yml: influxdb_cloud label_group v2 -> v2-cloud - Track label renames and deletions in LABEL_GUIDE.md * fix(ci): replace npm ci with targeted js-yaml install in auto-label npm ci fails in sparse checkout because package-lock.json is not included. The workflow only needs js-yaml for YAML parsing. * fix(ci): add --legacy-peer-deps to auto-label npm install * task: updated labels for migration * docs: update pipeline plan with test results and completion status * test: reapply reverted serve.md changes for e2e pipeline test Reverse the revert from 2f8efd6 to provide content changes that exercise the auto-label and doc-review workflows end-to-end. * fix(ci): fix preview URL polling in doc-review visual review curl --head outputs response headers before the status code from -w, so STATUS contained "HTTP/2 200 ...200" instead of just "200". Drop --head and add -o /dev/null to capture only the status code. * fix: correct broken fragment links in InfluxDB 3 serve.md files (#6910) * Initial plan * fix: correct broken links in serve.md files for enterprise config-options Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> * Update content/influxdb3/enterprise/reference/cli/influxdb3/serve.md --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Remove the x-tagGroups vendor extension from 8 remaining OpenAPI spec files. This Redocly extension was used for navigation grouping in the old RapiDoc layout but is ignored by the Hugo-native API templates, which generate pages from operation tags[] arrays.
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.3.1 to 3.3.2. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](cure53/DOMPurify@3.3.1...3.3.2) --- updated-dependencies: - dependency-name: dompurify dependency-version: 3.3.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
* Updating changelog * Updating plugin list * Updating product version * Updating plugins --------- Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
* chore: update to 3.8.4 * chore: lint * Apply suggestions from code review * Update content/shared/v3-core-enterprise-release-notes/_index.md --------- Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
…6919) * Initial plan * chore: add preview deployment validation Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
- Update tar resolution 7.5.7 → 7.5.11 (CVE-2026-26960, CVE-2026-29786) - Remove unused copilot optional dependency (CVE-2026-29783)
…flow (#6918) * Initial plan * fix: use correct API to request Copilot code review in doc-review workflow Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
…#6917) * Initial plan * fix(vale): add missing Google.Units=NO to product-specific .vale.ini files Duration literals like 7d, 24h, 30d were being flagged as errors when running Vale with product-specific configs because those configs were missing Google.Units = NO. Also adds Vale.Terms = NO, write-good.TooWordy = NO, and TokenIgnores to match the root .vale.ini. Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com> Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
* chore: add hosted influxdb-docs MCP server to .mcp.json Add the hosted InfluxDB documentation search MCP server (influxdb-docs.mcp.kapa.ai) as the primary MCP server using SSE transport. Keep the local server with a note that it uses deprecated endpoints. https://claude.ai/code/session_01SURpmrJ2sxzBtp4euiAxpc * chore: add API key auth option for hosted influxdb-docs MCP server Make the API key-authenticated server the primary entry (influxdb-docs) using Bearer token from DOCS_KAPA_API_KEY env var. Keep the OAuth fallback as influxdb-docs-oauth for users without an API key. https://claude.ai/code/session_01SURpmrJ2sxzBtp4euiAxpc * chore: rename env vars to INFLUXDATA_DOCS_ namespace Rename DOCS_KAPA_API_KEY, DOCS_API_KEY_FILE, DOCS_MODE, and MCP_LOG_LEVEL to use the INFLUXDATA_DOCS_ prefix for consistency. https://claude.ai/code/session_01SURpmrJ2sxzBtp4euiAxpc * docs: add MCP server setup docs for contributors and AI agents Update CLAUDE.md, AGENTS.md, and content-editing SKILL.md with concise documentation for the hosted influxdb-docs MCP server, covering both API key and OAuth authentication options. https://claude.ai/code/session_01SURpmrJ2sxzBtp4euiAxpc * fix: remove cross-agent references from .claude files and AGENTS.md Keep .claude/ files focused on Claude Code. Link AGENTS.md to the published MCP server docs page instead of mentioning tool-specific setup. https://claude.ai/code/session_01SURpmrJ2sxzBtp4euiAxpc --------- Co-authored-by: Claude <noreply@anthropic.com>
Add apply-tag-config.ts that reads colocated tags.yml files and patches OpenAPI spec tags in place (descriptions, x-related links, renames). Runs between getswagger.sh and generate-openapi-articles.ts in the build pipeline. Create tags.yml for all 11 product specs: - Core, Enterprise: extracted from existing spec tag metadata - v2-compat, v2, v1: new descriptions and x-related links Include test suite (16 assertions) covering description setting, tag rename propagation, x-related links, stale/uncovered tag warnings, silent skip when no config, and malformed YAML failure.
…v1 products Drop redundant version subdirectories and use self-documenting filenames for 5 products: v2-compat influxdb3: cloud-dedicated/v2/ref.yml → cloud-dedicated/influxdb3-cloud-dedicated-openapi.yaml cloud-serverless/v2/ref.yml → cloud-serverless/influxdb3-cloud-serverless-openapi.yaml clustered/v2/ref.yml → clustered/influxdb3-clustered-openapi.yaml v1: influxdb/v1/v1/ref.yml → influxdb/v1/influxdb-oss-v1-openapi.yaml enterprise_influxdb/v1/v1/ref.yml → enterprise_influxdb/v1/influxdb-enterprise-v1-openapi.yaml Update .config.yml, getswagger.sh, and generate-openapi-articles.ts to reference new paths.
Update the date for InfluxDB Docker latest tag change.
…erprise Strip title, version, description, license, and contact from Core and Enterprise info.yml overlays so the values from docs-tooling generated specs are preserved. Keep only x-influxdata-* fields used for Hugo page metadata. Fix set-info.cjs decorator to not blank version or summary when the overlay omits them — the old else branches would clear spec values that should pass through.
…ess-specs Extends the tag post-processor into a unified spec post-processor that also applies info.yml and servers.yml content overlays. This replaces two Redocly decorators (set-info, set-servers) with a single TypeScript script, moving toward removing the Redocly dependency. - Rename apply-tag-config.ts → post-process-specs.ts - Add info overlay support (merges fields from content/info.yml) - Add servers overlay support (replaces spec.servers from content/servers.yml) - Use same discovery convention as Redocly docs-content.cjs (API-specific first, product-level fallback) - Load spec once, apply all transforms, write once if modified - Skip Redocly postProcess for management specs in getswagger.sh (prevents unwanted $ref chain collapsing) - Restore management@0 API entries in cloud-dedicated and clustered configs - 13 tests, 41 assertions, all passing
…mt links Flatten Cloud v2 and OSS v2 spec directories to product root with self-documenting filenames, matching the pattern used for influxdb3 products. Remove all 5 v1-compatibility directories — those endpoints are already included in the main spec (tagged as v1/v2 Compatibility). Old v1-compat URLs are preserved as Hugo aliases for redirects. Also includes: - Migrate inline markdown links from management API spec descriptions into tags.yml x-related fields (Cloud Dedicated + Clustered) - Wire post-process-specs.ts into generate-api-docs.sh build pipeline - Fix doubled static/openapi download filenames - Update project plan with design decisions
- Upgrade glob from ^10.3.10 to ^13.0.6 to resolve dependency vulnerability warnings. API is unchanged, no code changes needed. - Add dompurify >=3.3.2 to resolutions to prevent regression. The prior lockfile-only fix (8dd60bf) regressed when yarn add regenerated the lockfile.
…atic-only mode - Flatten Core/Enterprise v3/ subdirectories to product root - Rewrite generate-api-docs.sh as clean 3-step pipeline: post-process-specs → Redoc HTML → static spec downloads - Add --static-only flag to generate-openapi-articles.ts - Remove circular getswagger.sh call from generate-openapi-articles.ts - Remove dead execCommand function and --skip-fetch flag - Apply post-processed tag enrichments to all spec files
The clean step was deleting committed content directories (e.g., enterprise_influxdb/v1/api/) when running in --static-only mode. Static-only should only copy specs to static/openapi/, not touch content directories.
The find command in generate-api-docs.sh matched the Redocly root config (api-docs/.config.yml) which has no apis key, causing yq to fail with "cannot get keys of \!\!null".
Add x-traitTag to TagConfig interface so the post-processor propagates it from tags.yml into specs. Mark all supplementary documentation tags (Authentication, Quick start, Headers, Usage, etc.) with x-traitTag: true so Redoc renders them as documentation sections with descriptions rather than empty operation groups. Also exclude root .config.yml from the Redoc HTML generation find command.
…ion tags Add ReDoc-Inject: <security-definitions> directive and scheme links to the Authentication tag description in all 9 tags.yml files. This renders the security scheme definitions inline in the Redoc HTML, matching the pre-uplift behavior. Each product lists its actual security schemes with anchor links to the scheme definitions section.
) * Revert "InfluxDB 1.12.3 release (#6872)" This reverts commit 14e021a. * fix(v1): split v1.12.3 release — publish OSS, defer Enterprise pending GA Revert the combined InfluxDB 1.12.3 release commit and re-add only OSS v1.12.3 documentation. Enterprise v1.12.3 docs will be published in a separate PR once the release artifact is GA in the portal. Also adds FUTURE/PAST LIMIT ordering caution for users on versions prior to v1.12.3 (from copilot/restore-ordering-warning-influxql). * chore: document separate OSS/Enterprise PR workflow for v1 releases Update the influxdb1-tech-writer agent, v1 release PR template, and prepare-release-notes command to enforce the practice of always creating separate PRs for OSS v1 and Enterprise v1 releases. Enterprise must wait for GA in the portal before merging. * fix(enterprise): restore FUTURE/PAST LIMIT grammar productions in InfluxQL spec The revert of the combined v1.12.3 commit removed grammar production definitions (retention_future_limit, retention_past_limit) that document existing InfluxQL syntax, not v1.12.3-specific features. Restore them so the grammar is complete. * Revert "fix(enterprise): restore FUTURE/PAST LIMIT grammar productions in InfluxQL spec" This reverts commit c497f13. * fix(v1): remove incorrect FUTURE/PAST LIMIT ordering caution from OSS spec The caution stated that prior to v1.12.3, PAST LIMIT must appear before FUTURE LIMIT. This is incorrect — the correct syntax has always been FUTURE LIMIT before PAST LIMIT. The v1.12.3 fix addresses Enterprise meta-node recording of limits, not parser syntax order.
…ags.yml The original v3 specs had multi-paragraph descriptions for trait tags (Quick start, Headers and parameters, Migrate) and operation tags (Cache, Processing engine, Write data) with tables, code blocks, and structured content. The tags.yml files replaced these with one-liner summaries, which post-process-specs.ts then applied over the rich spec descriptions. Restore all descriptions to match the original spec content.
…d Supported operations Replace truncated "Overview of..." one-liners in tags.yml with proper descriptions: - API compatibility (Cloud Dedicated, Cloud Serverless, Clustered): restore multi-paragraph descriptions from origin/master specs covering write endpoints, query protocols, and v1/v2 compatibility. Move external doc links to x-related. - Supported operations (Cloud v2, OSS v2, Cloud Serverless): replace with reference-style descriptions and HTTP method convention table.
Hugo-native templates for API reference documentation. Operations render as server-side HTML instead of client-side Redoc, providing faster page loads, full SEO indexability, and consistent styling. Architecture: - Tag-based navigation: operations grouped by OpenAPI tag, accessed via tag pages only (no individual operation URLs) - Generation script auto-discovers products from .config.yml files, deriving Hugo paths and menu keys from directory structure - Per-tag JSON/YAML chunks for fast Hugo template rendering - Inline curl examples generated from OpenAPI specs at build time Templates (layouts/api/, layouts/partials/api/): - tag-renderer.html: renders all operations for a tag - operation.html: individual operation with parameters, request body, responses, and schema rendering - code-sample.html: curl examples with Ask AI integration - section-children.html: tag listing on section index pages - all-endpoints-list.html: all operations sorted by path Generation (api-docs/scripts/generate-openapi-articles.ts): - Auto-discovery from .config.yml replaces hardcoded productConfigs - Each API section generates independently (no cross-spec merging) - Frontmatter-driven template data (specDownloadPath, articleDataKey) - Link transformation: /influxdb/version/ placeholders resolved to product-specific paths Removed: - Redoc renderer, JavaScript components, and CSS - Shadow DOM test infrastructure (~160 lines) - Operation page generation (dead generatePathPages function) - mergeArticleData() and slugifyDisplayName() Styles (assets/styles/layouts/_api-*.scss): - 3-column layout: sidebar, content, sticky TOC - Theme-aware code blocks for curl examples - Method badges (GET/POST/PUT/DELETE) with color coding - Collapsible schema sections with depth tracking Tests (cypress/e2e/content/api-reference.cy.js): - Tag page rendering with operation structure - Download button verification per section - All-endpoints page with operation cards - Related links from x-related OpenAPI extension - Code sample and Ask AI link validation
Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>
…pages Broadens the content HTML ignore pattern from `/content/influxdb*/**/api/**/*.html` to `/content/**/api/**/*.html` to cover `enterprise_influxdb/`, and adds `/static/openapi/` for generated spec download files.
…6952) The InfluxDB documentation MCP server (hosted by Kapa) now supports authentication via both Google and GitHub accounts. Update all references to reflect both providers and document GitHub's scope behavior (no scopes requested, public profile only). https://claude.ai/code/session_01X29cSTjYM6CQrxRJT62tG6 Co-authored-by: Claude <noreply@anthropic.com>
# Conflicts: # .gitignore
Remove fingerprint interception workaround and fake GTM stubs. Replace back-link navigation test with sidebar link assertion.
Remove generated cloud-serverless, cloud-dedicated, and clustered API content from git tracking. Add management-api pattern to .gitignore.
Contributor
Author
Code reviewFound 2 issues:
Lines 475 to 483 in 6bb7d25
docs-v2/api-docs/scripts/post-process-specs.ts Lines 295 to 301 in 6bb7d25 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
The API reference tests require generated content pages that are gitignored. Add a before() hook that detects missing content and runs the generation pipeline, then waits for Hugo to rebuild.
…solutify download links - Rewrite info.yml description to list supported endpoints (write, query, authorizations, buckets, orgs) and disclaim unsupported Cloud (TSM) endpoints - Comment out unsupported Cloud (TSM) paths in spec, keeping 29 supported paths - Convert orphaned Cloud (TSM) tags to x-traitTag with disclaimer - Strip all Redoc-specific anchor links (#operation/, #tag/, #section/) from spec descriptions and tags.yml — these break in the Hugo-native layout - Fix product name: "InfluxDB 3 Serverless" → "InfluxDB Cloud Serverless" - Add absolutifyLinks() to generate-openapi-articles.ts so static/openapi downloads contain full URLs (https://docs.influxdata.com/...) while Hugo pages keep relative paths
The regex that stripped Redoc anchor links didn't account for nested parentheses in tag names like Authorizations-(API-tokens)), leaving orphaned closing parens in descriptions and tag references.
Contributor
Author
Code review (commit 9a385c6)Found 1 issue (fixed in 2e9ac17):
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
# Conflicts: # api-docs/scripts/generate-openapi-articles.ts
jstirnaman
commented
Mar 16, 2026
…nk pipeline
- Add standard OpenAPI `externalDocs` field to all tags.yml files that
have `x-related` entries (uses first link as the primary doc link)
- Convert `externalDocs` to `{title, href}` objects in related links
instead of bare URL strings
- Strip `https://docs.influxdata.com` from description/summary fields
in `transformDocLinks()` so Hugo pages use relative paths
- Fix article generation reading from absolutified download spec instead
of the Hugo spec with relative links (new `hugoSpecPath` output)
- Add `externalDocs.url` support to `absolutifyLinks()` for downloads
Extract fetchAndProcess and fetchManagementSpec helpers to deduplicate nine near-identical update functions. Cache granite clone across calls to avoid redundant fetches. Replace if/elif dispatch with case, fix quoting, remove dead code (versionDirs, npx --version), update help text, and use subshells for cd safety. Passes shellcheck with zero warnings.
- Move Hugo spec (relative links) to _build/ instead of static/ with -hugo- suffix, preserving original basenames for tag spec filenames - Add articleDataKey, articleSection, and specDownloadPath to generated section and tag page frontmatter for sidebar nav and download button - Fix sidebar link test to use #nav-tree instead of .sidebar (avoids matching the hamburger toggle link)
Replace skipParentMenu with menuParentName to control sidebar placement. All products now generate menu entries: - v1 and Enterprise v1: parent "Tools" - All others: parent "Reference"
Replace faint link with a small bordered button that has good contrast in both light and dark modes.
These v2/cloud tags pages use an old layout that causes Hugo to panic during live rebuilds when generated API content is present.
3 tasks
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.
Summary
Restructures the
api-docs/directory and build pipeline to support Hugo-native API reference pages. Replaces Redocly-specific infrastructure with a standalone TypeScript post-processor, flattens all version subdirectories, and adds per-product tag configurations.set-info,set-servers, andset-tag-groupsdecorators with a unified TypeScript post-processor (post-process-specs.ts)influxdb3/core/v3/→influxdb3/core/) — every product stores its spec at the product rootv1-compatibility/directories (5 products) — endpoints already exist in main specstags.ymlconfigs with descriptions,x-traitTagsupport, andx-relatedlinks for all 11 products_build/(gitignored) instead of mutating source files — pipeline is idempotent--static-onlymode for generating download files without Redoc HTMLtags.ymlx-relatedBuild pipeline
Source specs in
api-docs/are never mutated during generation.Directory layout (after)
Verification
npx tsc --project api-docs/scripts/tsconfig.jsonnode api-docs/scripts/dist/post-process-specs.js_build/node api-docs/scripts/dist/generate-openapi-articles.js --static-onlystatic/openapi/node api-docs/scripts/dist/test-post-process-specs.jsgrep -r 'x-tagGroups' api-docs/ --include='*.yml' --include='*.yaml'find api-docs -name 'v1-compatibility' -type dfind api-docs -maxdepth 4 -name 'v2' -o -name 'v3' | grep -v node_modulesKey changes
New files
api-docs/scripts/post-process-specs.ts— unified spec post-processor (info, servers, tags)api-docs/scripts/test-post-process-specs.ts— 13 tests, 41 assertionstags.ymlfiles — per-product tag configs with descriptions andx-relatedlinksRemoved
x-tagGroupsvendor extension from all specs (dead — Hugo-native layout ignores it)set-tag-groups.cjsdecorator and 10tag-groups.ymlconfig filesv1-compatibility/directoriesv2/,v3/,v1/v1/)CI changes
.circleci/config.yml— TypeScript build step before API doc generation.github/workflows/pr-preview.yml— TypeScript build step, commit status signaling for preview coordination.github/workflows/doc-review.yml— updated for api-docs-only PRs.github/scripts/detect-preview-pages.js— handles API-only PRsTest plan
npx tsc --project api-docs/scripts/tsconfig.jsoncompiles without errorsnode api-docs/scripts/dist/post-process-specs.jsprocesses all 11 specsnode api-docs/scripts/dist/generate-openapi-articles.js --static-onlyproduces 22 download filescd api-docs && bash generate-api-docs.shgenerates Redoc HTML for all productsnpx hugo --quietbuilds without template errors