Repository navigation
Conversation
Signed-off-by: Dmitry Dorofeev <dima@yasp.com>
Signed-off-by: Dmitry Dorofeev <dima@yasp.com>
Signed-off-by: Dmitry Dorofeev <dima@yasp.com>
Signed-off-by: Dmitry Dorofeev <dima@yasp.com>
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.
Adds an optional documentation data bundle served from memory. The existing Documentation globe icon opens local documentation inside the gateway UI, keeping the gateway navigation visible. If no bundle is loaded, the icon continues to open the public documentation website.
Implementation
config.documentationBundleand documents it in the generated schema. The management service loads the file once at startup into a sharedBytesbuffer and indexes its assets. Relative paths resolve against the process working directory. An unset or missing file leaves local documentation disabled and uses the public link; an existing unreadable or invalid bundle fails startup.AGWDOCS1, a little-endian manifest length, a JSON manifest, and concatenated asset payloads. The manifest records the documentation version, landing page, MIME types, encodings, offsets, lengths, original lengths, and SHA-256 checksums. This is a data archive, with no native-library ABI or loader hooks.tools/build-docs-bundle.pyuses only the Python 3.9+ standard library. It sorts assets, gzips each file when that reduces its size, records checksums, rejects symlinks and unsupported paths, and publishes a complete pack by atomic rename. The builder packages an already generated website; it does not invoke Hugo or rewrite URLs. No new Rust dependencies are introduced./ui/docs/supports GET/HEAD, directory redirects, content negotiation, representation-specific ETags and conditional requests,Vary: Accept-Encoding, andCache-Control: private, no-cache. Gzip responses use shared byte slices; identity responses decompress as a stream. Missing assets return 404 rather than the UI SPA fallback. Range requests receive the complete representation./api/runtimeexposesui.documentationPathonly when a bundle was loaded. The existing footer globe icon opens/ui/documentation, which displays the local site in a frame within the normal application shell. Sidebar navigation and the header remain available while browsing documentation. The public link remains the fallback while runtime information is pending or unavailable. The routes use the existing UI base-path and authentication handling; the admin listener retains its existing access rules.architecture/documentation-bundles.md, links it fromDEVELOPMENT.md, includes a small generated fixture, and adds Python builder tests to Linux CI alongside Rust reader/HTTP tests and browser coverage.Build and configuration
Generate the static website for
/ui/docs/, including navigation, search indexes, styles, and scripts. With a YAML setting such asui.basePath: /gateway, the site's prefix must instead be/gateway/ui/docs/. Theme-specific URL assumptions must also be handled by the website build.Replace the pack atomically and restart the gateway to update the documentation. Existing processes retain their in-memory copy; replicas can receive the new file before a rolling restart. There is no file watcher or configuration-reload trigger for reloading the pack.
The pack contains trusted HTML and JavaScript served on the UI origin. Checksums detect corruption, not publisher identity. Production website content is distributed separately from the gateway source; the committed pack is a 1,005-byte test fixture.
Validation
Local checks on the UI/runtime implementation at
3866ec2f:refreshes a reopened policy diff, at its 30-second test deadline). That existing policy-editor test then passed in 6.1 seconds when rerun alone with one worker, without code changes. All documentation tests passed in the full run, including local/public link selection, embedded navigation, refresh, and returning to gateway pages.Earlier implementation checks:
2d59ea65passed the full Rust suite: 3,690 passed, 6 ignored, plus Clippy with warnings denied. The subsequent feature commit changes the UI, documentation/schema wording, and the missing-file warning text; it does not change the reader or HTTP behavior.These are local results; GitHub CI status is reported separately by the PR checks.
CI follow-up
b9b0b692pins the documentation fixture source to LF and marks.packfiles as binary. Windows checks out ordinary text as CRLF, which made two Rust tests compare the unchanged LF bundle payload against CRLF source files. The correction keeps the byte-exact assertions and serving behavior unchanged. All five Rust documentation tests passed locally on the corrected source. A disposable checkout withcore.autocrlf=truereproduced the mismatch before the attributes change and passed both Python fixture tests afterward.01748939lets forks run Linux jobs on GitHub-hosted Ubuntu runners. The Luxms fork has no Blacksmith runners, so those jobs previously stayed queued. Linux dependency setup now checks the runner OS; forks use the standard Go cache instead of Blacksmith's disk cache. Upstream's Blacksmith runner and cache selection is preserved. Workflow validation withtools/actionlintpassed.01748939passed lint, unit tests, and all 68 Playwright tests; the Linux Python builder step also passed. The new full CI run is available here; its status is pending and must be checked separately.Dranik integration and companion website change
The feature is already merged into the Luxms
dranikbranch at eddec2a9, including the fixture and CI fixes. The source branchfeat/docs-data-bundleis retained. This PR targets Luxms'smainfor review of the reusable feature; the upstream repository is not modified.The documentation theme's embedded-sidebar breakpoint adjustment is maintained in the separate website fork: luxms/ag-website e77ba1116. It keeps the documentation's own navigation visible alongside the gateway sidebar in narrower desktop frames, while preserving standalone layout behavior. That website change is delivered through the data bundle.