Repository navigation
Zeta 后端:spark-ui/spark-history 反代 JSON 响应改写 spark:8082(QA #65 实机验证失败项修复) - #271
Merged
todosdev[bot] merged 1 commit intoNov 30, 2026
Merged
Conversation
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.
Summary
spark:8082;而 executor stdout/stderr 链接的真实载体是 REST JSON(allexecutors → executorLogs),不是 HTML,导致实机 Executors 表格仍指向容器内部不可达主机。rewriteSparkWorkerLinksInJson,在两处 JSON 分支追加对spark:8082Worker UI 链接的改写,落到/spark-worker/...,复用既有rewriteSparkWorkerLink(不改写手法另起一套)。Changes
worker/src/lib/spark-worker-link.ts:新增rewriteSparkWorkerLinksInJson,在 JSON 原始文本上改写四种拼写(裸spark:8082/http:///https://///)的 Worker UI 链接,带端口边界前瞻避免误伤spark:80820等相似 token;不改写非目标字段、不做 JSON 往返(与既有 origin 消毒同构)。worker/src/routes/spark-history.ts/spark-ui.ts:JSON 分支在既有 origin/fullBase 消毒后追加调用rewriteSparkWorkerLinksInJson。worker/src/lib/__tests__/spark-worker-link.test.ts单测;spark-history.test.ts/spark-ui.test.ts各补一条以真实allexecutors → executorLogsJSON 形态为输入的 JSON 分支用例。Testing
cd worker && pnpm type-check通过。npx vitest run src/lib/__tests__/spark-worker-link.test.ts src/routes/__tests__/spark-history.test.ts src/routes/__tests__/spark-ui.test.ts:3 文件 84 用例全绿。workflow_dispatch,ref=tds/conv-01a22b30-ba53-7eda-8091-c60baf6c9f52,HEAD 441d54e)success:https://github.com/WorkerHub/Zeta/actions/runs/46371540449注:本改动仅涉及 Worker 源码与测试,无需要重建的受跟踪生成产物(dist/ 等)。