Resolve "[ANMS-UI] Fix broken link to API docs page" - #391
Merged
nick-greenwald merged 30 commits intoAug 24, 2026
Merged
Conversation
BrianSipos
reviewed
Aug 17, 2026
This reverts commit 5a5123b.
Replace FastAPI get_swagger_ui_html/get_redoc_html helpers with custom
HTML that uses fully relative URLs. The FastAPI helpers hardcode
oauth2RedirectUrl as window.location.origin + /docs/oauth2-redirect
which breaks under proxy prefixes like /core/docs.
Changes:
- /docs and /redoc serve directly (200 OK) - no trailing-slash redirects
- Assets use relative paths (../openapi.json, ../release/...) so they
resolve correctly at any base path
- oauth2RedirectUrl uses window.location.pathname so it stays under
the proxy prefix
- Removes dead /docs/{path} and /redoc/{path} catch-all routes
Relative "../" paths break when proxy prefix depth changes. Replace with JS that derives the base from window.location.pathname, so /docs, /core/docs, or any future prefix all resolve assets correctly.
BrianSipos
reviewed
Aug 19, 2026
Same approach as Swagger UI: derive base path from window.location.pathname at runtime instead of static "../" relative URLs, so ReDoc loads correctly under /core/redoc and any other proxy prefix.
ReDoc requires the <redoc> element to exist before the script loads. Render it in the body and set spec-url dynamically, matching the Swagger UI dynamic JS pattern.
CI checkout tests hit /core/docs/ (trailing slash) which returned 307 from FastAPI auto-redirect. Now both /docs and /docs/ (and /redoc and /redoc/) return 200 directly. JS regex updated to handle optional trailing slash.
The /search/{query} route handler used the same function name
paged_registered_agents as the root route handler. When FastAPI
generates the OpenAPI schema, both routes share the same operationId,
causing a schema error that breaks /core/docs/ (500) and cascades to
the Angular UI (/) when the backend is unhealthy.
Rename the search route handler to search_registered_agents.
The test entrypoint only checked if authnz responded with any HTTP code, but authnz starts before upstream backends (anms-core, amp-manager, anms-ui) are ready. When the proxy can't reach backends, it returns 500. This was more visible in Podman CI due to slower container startup and different networking, causing non-deterministic test failures. Now the readiness check also verifies anms-core responds through authnz (/core/docs/) and increases the wait timeout from 30s to 90s.
The Containerfile HEALTHCHECK directives are not picked up by docker compose --wait. Without compose-level healthchecks, --wait considers services up immediately, causing the checkout test to run before backends are ready. Podman rootless CI is slower to start, making this more visible. Add healthchecks with faster intervals (5s) and start_period for anms-core, anms-ui, and amp-manager. Also change anms-core dependency on amp-manager from service_started to service_healthy.
postgres had no compose-level healthcheck, so --wait considered it healthy instantly. Since amp-manager depends on postgres: service_healthy, it would start before DB was accepting connections, fail its own healthcheck, and never become healthy. Because anms-core depends on amp-manager: service_healthy, it never started either. Result: anms-core and amp-manager containers were missing from Podman ps output in CI, causing HTTP 500 on /core/docs/ and /nm/api/agents endpoints.
In Podman rootless, 'localhost' resolves to IPv6 ::1, causing healthchecks to fail when services only bind to IPv4. Replace with 127.0.0.1 in both postgres and redis healthcheck definitions. Also increased postgres retries to 10 and start_period to 15s, and reduced redis interval/timeout to match other services.
Compose healthchecks never pass inside containers in the Podman + docker-compose-plugin CI environment, causing --wait to timeout and blocking service_healthy depends_on. Remove healthchecks from postgres and redis, change their depends_on conditions to service_started. Backend services (anms-core, amp-manager, anms-ui) keep their curl-based healthchecks. The entrypoint handles final readiness.
Amp-manager crashes on startup when postgres is not yet accepting connections. Add bash-based TCP socket wait loop to refdm-proxy CMD so it waits for postgres before starting. Also remove healthchecks from postgres/redis in compose and switch depends_on to service_started, since compose healthchecks never pass inside containers in Podman CI.
… between Docker and Podman
postgres has no compose healthcheck but amp-manager, anms-core, and anms-ui depended on service_healthy, causing Podman to hang forever waiting for a health status that never arrives.
Collaborator
|
If there is some way to coerce podman to properly use health checks that will be significantly better than to build many workarounds. Whatever podman needs can be embedded into scripts and the puppet module. |
Contributor
Author
|
I was not able to get something to work and did spend many CI cycles trying to. To test locally I think I'd need to replicate everything from setting up Podman rootless CI and pulling all the same images that our GitHub Actions use. I just reverted the changes I made. |
BrianSipos
approved these changes
Aug 21, 2026
|
nick-greenwald
deleted the
387-anms-ui-fix-broken-link-to-api-docs-page
branch
August 24, 2026 20:53
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.



Fixes the broken API docs link in the help page by adding the API docs to the proxy urls in the docker compose file. Chose the Swagger UI
/docsas that is what the API docs link pointed to. A/redocpage also exists for the backend with no button to it in the frontend.Closes #387