Skip to content

[Bug] GitHub 工具多个功能存在 JSON 解析、参数和列表数据为空的问题 #1

Description

@heikeyangle-code

环境

  • 使用 RikkaHub 内置的 GitHub 工具进行功能测试
  • 测试账号:heikeyangle-code
  • 测试仓库:rikkahub-plus-fresh

问题列表

一、JSON 序列化 Bug(3个)

1. search_code — JsonObject is not a JsonPrimitive

  • 调用 search_code 搜索代码时抛出异常
  • 原因:搜索结果的某些字段是嵌套 JSON 对象,但代码中直接当作 JsonPrimitive 解析
  • 堆栈:kotlinx.serialization.json.JsonElementKt.getJsonPrimitive

2. get_commit — 同上

  • 调用 get_commit(sha=master) 时抛出同样的异常
  • commit 对象中的复杂字段解析失败

3. list_collaborators — 'all' is not valid

  • 调用时固定传参 permission=all,但 GitHub API 不接受该值
  • 支持的值为:pull, triage, push, maintain, admin
  • 应默认不传 permission 参数,或者传 pull

二、参数/逻辑 Bug(2个)

4. search_commits — 缺少搜索关键词报错

  • 仅使用 qualifier 搜索(如 repo:owner/name)会直接返回 422 错误
  • GitHub API 要求必须提供搜索文本关键词

5. trending — 始终返回 total=0

  • 无论是否指定 languagesince 参数,结果始终为 {"total":0,"results":[]}

三、列表数据为空(4个)

6. list_commits — 返回空列表

  • 仓库实际有大量代码(~90MB),但提交历史完全读不到

7. list_branches — 返回空列表

  • 无法获取任何分支信息

8. list_files — 返回空列表

  • 默认使用 main 作为分支名请求(但仓库默认分支是 master
  • 即使指定 branch=master 仍然返回空
  • read_filefile_meta 可以正常读取文件内容

9. ci_status — total 正常但 results 为空

  • 能正确统计运行次数(total=492),但 results 数组为空
  • 导致无法获取具体的 run_id、状态、时间等信息
  • 进而导致所有 CI 相关功能无法使用(ci_log, ci_jobs, ci_artifacts, ci_cancel, rerun_workflow 等都需要 run_id)

预期行为

以上功能应能正确返回数据,而非抛出异常或返回空列表。

截图/日志

(如有需要可补充具体堆栈信息)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions