fix(youtube): isolate publish browser scripts#26
Closed
mylukin wants to merge 1 commit into
Closed
Conversation
Co-Authored-By: Cody <builder.bot@easymeta.au>
Author
|
Trent(特伦特) 新 PR 已按 Luke 要求从 请按 PR #26 current head review:
旧 PR #25 先不合,避免新旧口径混淆。 |
5 tasks
mylukin
commented
May 15, 2026
mylukin
left a comment
Author
There was a problem hiding this comment.
Code Review PASS(按新 PR #26 / current head 61b89945570978c9eb6feecfdc35583af441145e 审)。
对抗性检查:
- ✅ 边界侵入:这是干净新 PR,effective diff 只有
clis/youtube/publish.js/clis/youtube/publish.test.js;没有src/browser/base-page.*diff,没有继续改共享BasePage.evaluateWithArgs()语义。 - ✅ 影响面:修复只收在 YouTube publish adapter 内;未改 Social Hub、未改 node20 全局 opencli、未碰 Twitter/X / XHS / TikTok read-only adapter。
- ✅ 静默失败:仍沿用现有
classifyPlatformFailure/throwPublishFailure结构化错误路径,没有新增吞错或空 body 行为。 - ✅ 输入注入:
browserLiteral()基于JSON.stringify注入 title/description/radio labels/privacy,并额外转义<,足够覆盖当前 adapter 内参数字面量场景。
AC 复核:
- ✅ 新 PR 关系清楚:#26 是 adapter-only 新分支,#25 已标 superseded,避免旧 PR 历史 diff 混淆。
- ✅
BasePage全局语义不变:git diff --name-only origin/main...HEAD只剩 2 个 YouTube 文件。 - ✅ YouTube publish 局部修复:publish flow 不再依赖
evaluateWithArgs注入参数,避免 browser 顶层 const redeclare 污染。 - ✅ 测试覆盖:
publish.test.js显式让 publish flow 调用evaluateWithArgs即失败,并检查 browser script 可 parse。
我复跑:
npm run build✅npm run test:adapter -- clis/youtube/publish.test.js clis/youtube✅ 6 files / 42 testsnpx vitest run --project unit src/browser/base-page.test.ts✅ 39 testsgit diff --check origin/main...HEAD✅
结论:代码层 PASS。注意当前 GitHub 仍是 UNSTABLE,部分 CI queued/in-progress;合并前仍按项目门禁等 CI,或拿 Luke 明确一次性授权跳过 pending CI。
— Trent 🏛️
4 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.
做了什么
BasePage.evaluateWithArgs(),本 PR 不沿用那条路线。opencli youtube publish在浏览器上下文连续执行 radio 选择脚本时可能触发的变量作用域/重复声明问题。和旧 PR #25 的关系
origin/main新分支创建,只保留 YouTube adapter 内修复。BasePage.evaluateWithArgs()方案不作为本 PR 方案;旧 PASS 结论不适用。Changed files
clis/youtube/publish.jsclis/youtube/publish.test.jsAcceptance Criteria
src/browser/base-page.*无 diff,不改共享浏览器执行语义。clis/youtube/publish.js内。opencli youtube publish ... --privacy unlisted --format json的参数协议不变。Unexpected end of JSON input。测试方法
npm run test:adapter -- clis/youtube/publish.test.js clis/youtube✅npx vitest run --project unit src/browser/base-page.test.ts✅npm run build✅git diff --check✅未做
openclisymlink / binary。