Skip to content

fix: align Yunxiao status names and move project config to repo variables#2166

Open
shinetata wants to merge 2 commits into
MemTensor:mainfrom
shinetata:feat/yunxiao-sync-merge
Open

fix: align Yunxiao status names and move project config to repo variables#2166
shinetata wants to merge 2 commits into
MemTensor:mainfrom
shinetata:feat/yunxiao-sync-merge

Conversation

@shinetata

Copy link
Copy Markdown
Collaborator

Summary

修复已合入 main 的同步脚本无法运行的问题,并完成配置脱敏。

问题

STATUS_LABELS 使用了云效中并不存在的状态名(待响应/处理中/待验证/已关闭/不予处理),导致每次 Issue/PR 事件同步都失败:

PreflightError: 未在云效中找到工作流状态:待响应

改动

  • 状态名对齐云效实际工作流:待处理 / 设计中 / 开发中 / 已完成 / 已取消 / 测试中
  • 状态映射:Issue/PR 新建 → 待处理;PR 合并 → 已完成;关闭且未合并 → 已取消
  • 项目配置(project id / project name / default assignee)改为从仓库 Variables 读取,工作流与脚本中不再出现明文;缺失时显式报错
  • 移除已废弃的 YUNXIAO_DEFAULT_PRIORITY_NAME,优先级名内置为脚本常量

Verification

pytest tests/test_yunxiao_github_sync.py -q   → 7 passed
ruff check / ruff format --check              → clean
workflow YAML 解析                             → OK

PAT 仍仅通过 secrets.YUNXIAO_TOKEN 注入执行步骤,不写入日志。

Made with Proma · GitHub

@Memtensor-AI Memtensor-AI added area:core MOS 编排层 / 框架底座 / 跨模块问题 status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Jul 25, 2026
@Memtensor-AI
Memtensor-AI requested a review from WeiminLee July 25, 2026 08:37
@Memtensor-AI

Memtensor-AI commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

🤖 Open Code Review

Target: PR #2166
Task: d1e61c84a375494e
Base: main
Head: feat/yunxiao-sync-merge

🔍 OpenCodeReview found 3 issue(s) in this PR.


1. .github/workflows/yunxiao-github-sync.yml (L50-L52)

YUNXIAO_DEFAULT_PRIORITY_NAME was present in the removed hardcoded block but is not carried over to the new vars.* references. If the sync script reads this variable at runtime, it will receive an empty string, which may silently fall back to an unintended default or cause an error. Add the missing mapping:

YUNXIAO_DEFAULT_PRIORITY_NAME: ${{ vars.YUNXIAO_DEFAULT_PRIORITY_NAME }}

2. scripts/yunxiao_github_sync.py (L265-L266)

Silently swallowing YunxiaoApiError here means two distinct failure modes are indistinguishable: a transient network error and a 409-style conflict where the label already exists under a different ID. In both cases name_to_id[name] is never populated, so downstream sync_one() silently drops that label from the work-item payload with no diagnostic signal.

Suggestion: at minimum log the error so failures are observable. If the API returns a conflict error that includes the existing label's ID, extract and store it; otherwise re-raise or propagate so the caller can decide whether to retry.

💡 Suggested Change

Before:

        except YunxiaoApiError:
            pass

After:

        except YunxiaoApiError as exc:
            print(f"[warn] label '{name}' 创建失败,跳过: {exc}", file=sys.stderr)

3. scripts/yunxiao_github_sync.py (L18)

REQUIRED_ENV is declared but never referenced anywhere in the module. Each call site invokes _required_env() with a hardcoded string literal instead of iterating this tuple. This is dead code and a maintenance hazard: a developer may update REQUIRED_ENV thinking that is sufficient, while the actual _required_env() call sites remain unchanged (or vice versa).

Either remove REQUIRED_ENV entirely, or replace the three individual _required_env() calls with a loop over it and unpack the results.

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (8/8 executed). memos_github_open_source/smoke: 1/1, memos_python_core/changed-repo-python: 7/7. Duration: 2s

Branch: feat/yunxiao-sync-merge

@Memtensor-AI Memtensor-AI added status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 and removed status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Jul 25, 2026
@shinetata
shinetata force-pushed the feat/yunxiao-sync-merge branch from 846c94b to a2a7d8c Compare July 25, 2026 08:56
@Memtensor-AI Memtensor-AI added status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 and removed status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 labels Jul 25, 2026
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (8/8 executed). memos_github_open_source/smoke: 1/1, memos_python_core/changed-repo-python: 7/7. Duration: 2s

Branch: feat/yunxiao-sync-merge

@Memtensor-AI Memtensor-AI added status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 and removed status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core MOS 编排层 / 框架底座 / 跨模块问题 status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants