fix(deploy): target MIE Container Manager REST API at /api/v1#55
Merged
Conversation
The MIE Container Manager changed its routing: the origin now serves the SPA web UI (GET /sites returns index.html) and /api serves the Swagger UI, while the JSON REST API moved to /api/v1. The deploy script stripped /api to target the bare origin, so every request returned HTML and the first GET /sites aborted with a non-JSON response, failing the backend deploy. Normalize LAUNCHPAD_API_URL down to the manager origin (stripping any /api, /v1, or /api/v1 suffix) and re-append /api/v1, so the value is resilient to whichever form the secret is stored as. Update the non-JSON error hint to reflect the new origin/Swagger/REST layout. Verified: /api/v1/sites returns application/json; all secret forms normalize to https://manager.os.mieweb.org/api/v1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem
The Deploy TWH OS MIEWeb → Deploy twh backend container job started failing on the PR #54 merge to
main(run26887098773, failing after ~7s). The build jobs succeed; the deploy job aborts at its first API call:Root cause
The MIE Container Manager changed its routing (this same script + secret deployed fine on May 22). Current layout:
…/sites…/api/sites…/api/v1/sitesdeploy-mieweb-container.shstripped a trailing/apito target the bare manager origin — which used to serve JSON but now serves the web app — so every request returned HTML andGET /sitesfailed the non-JSON guard.Fix
Normalize
LAUNCHPAD_API_URLdown to the manager origin (stripping any/api,/v1, or/api/v1suffix) and re-append/api/v1. Resilient to whichever form the secret is stored as. Also updated the now-misleading non-JSON error hint.Verification
bash -npasses.origin,/api,/v1,/api/v1, with/without trailing slash) normalize tohttps://manager.os.mieweb.org/api/v1.GET /api/v1/sitesreturnsapplication/json(401 unauthorizedunauthenticated, as expected — the workflow sends the API key).Merging this to
mainre-triggers the deploy workflow. No secret change required.🤖 Generated with Claude Code