fix: build API docs before Hugo in PR preview workflow#6908
Open
fix: build API docs before Hugo in PR preview workflow#6908
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.
- 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>
Copilot
AI
changed the title
[WIP] Fix pr preview for api pages
fix: build API docs before Hugo in PR preview workflow
Mar 8, 2026
jstirnaman
approved these changes
Mar 9, 2026
Contributor
|
This will need updating for compatibility with: |
6 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.
API doc content files (
content/*/api/**/_index.html) are generated byredoc-cliviagenerate-api-docs.shand are gitignored. The PR preview workflow triggered onapi-docs/**changes but never ran the build step, so Hugo had nothing to render for/apipages.Changes
.github/workflows/pr-preview.ymlyarn run build:api-docs) that runs before Hugo whenhas-api-doc-changes == 'true'.github/scripts/detect-preview-pages.jsdetectApiPages()— maps changedapi-docs/{product}/{version}/**files to their preview URLs by parsing each product's.config.ymland extracting API keys:apiDocsfile changes, so PR body URLs are no longer required for API-only PRshas-api-doc-changesoutput consumed by the workflowneeds-author-inputlogic: only fires when no pages were detected by any strategy (content, API auto-detect, or PR body URLs)Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.