Commit Graph

12 Commits (756b20ef3c87f160654e96e296addbd4467ede7d)

Author SHA1 Message Date
Jason Stirnaman e275f33a65 fix(api-docs): use actual spec path in post-processor log labels
Replace invented {productDir}/{apiKey} labels with the real spec
path (e.g., influxdb/v1/influxdb-oss-v1-openapi.yaml instead of
influxdb/v1/v1@1).
2026-03-13 17:41:20 -05:00
Jason Stirnaman 90260d5d24
test(api-docs): align post-process outputs (#6942)
- read assertions from _build artifacts instead of source specs\n- capture issue 6939 plan for follow-up steps\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 17:30:39 -05:00
Jason Stirnaman 2c71b25813 style(api-docs): format generate-openapi-articles.ts line lengths 2026-03-13 12:39:48 -05:00
Jason Stirnaman f1674d0efa refactor(api-docs): write resolved specs to _build/ instead of mutating source
Post-process-specs.ts now writes resolved specs (with info, servers, and
tag overlays applied) to api-docs/_build/ instead of back to source files.
Downstream consumers (Redoc HTML generation, static spec copy) read from
_build/. Source specs in api-docs/ are never mutated by the pipeline.

This makes the pipeline idempotent — running it twice produces identical
output — and keeps source spec diffs free of YAML re-serialization noise.
2026-03-13 12:39:31 -05:00
Jason Stirnaman 62bd023616 fix(api-docs): add x-traitTag support to post-processor and tags.yml
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.
2026-03-11 17:46:32 -05:00
Jason Stirnaman 3f87dc5b61 fix(api-docs): skip clean step in --static-only mode
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.
2026-03-11 17:19:47 -05:00
Jason Stirnaman e2f4d80014 refactor(api-docs): flatten v3 dirs, rewrite build pipeline, add --static-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
2026-03-11 17:02:18 -05:00
Jason Stirnaman 24c1e60f2f refactor(api-docs): unify v2 APIs, remove v1-compat specs, migrate mgmt 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
2026-03-11 11:04:07 -05:00
Jason Stirnaman c7f9353d0a refactor(api-docs): replace tag-only processor with unified post-process-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
2026-03-10 17:23:20 -05:00
Jason Stirnaman abc789013f refactor(api-docs): flatten version subdirectories for v2-compat and 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.
2026-03-10 14:24:49 -05:00
Jason Stirnaman aa863012a5 feat(api-docs): add tag post-processor and per-product tags.yml configs
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.
2026-03-10 14:23:37 -05:00
Jason Stirnaman 914380ea54 feat(api-docs): extract api-docs changes from feat-api-uplift
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
2026-03-09 12:25:00 -05:00