Repository navigation
区分 GitHub 限流、权限和上游故障的提示 - #9
Open
Robert0622 wants to merge 2 commits into
Open
Robert0622 wants to merge 2 commits into
Robert0622 wants to merge 2 commits into
Conversation
This was referenced Nov 19, 2026
Owner
Author
|
本提交的 13 项独立检查已通过。第 2 次运行中,GitHub 仍未能为 macOS 分配托管 runner,测试步骤数为 0。依赖该任务的 上一个提交的 15 项检查全部通过,包含 macOS 作业。对比两个提交,唯一变化是用再次实测时的真实 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.
Fixes #8
复现与修复
自部署实例拉取 GitHub 工单时,上游返回 403,剩余额度为 0,并明确提示限流。原来的同步日志把所有非成功响应都归为项目 Owner 的凭据或权限问题。这会诱导用户在配额用尽时重新授权,也会掩盖服务端暂时不可用的情况。
GitHub 客户端现在保留 HTTP 状态码并按上游信号生成提示。限流会优先显示
Retry-After的秒数,在主额度用尽且有恢复时间时显示 UTC 时刻。缺少这两项时仍提示稍后重试。只有授权相关错误会提示检查本次调用使用的凭据;找不到资源、输入未通过验证、GitHub 服务故障分别给出相应解释。上游响应正文仅用于识别次级限流,未写入用户日志。GitHub REST API 限流说明验证
两张截图都来自正常连接 GitHub 的部署。第一次上游返回 HTTP 403、剩余额度为 0,旧日志提示检查凭据。部署修复后,等此前 GitHub 指定的恢复时刻过去再发起一次真实读取。GitHub 再次限流,新日志准确显示下一次恢复时刻为 2026-11-19 18:27:22 UTC。恢复有权限的测试账号后同步成功,记录了 23 条工单。右图依时间倒序显示这两条结果。
使用真实 HTTP 客户端配合受控上游,覆盖主限流、两种次级限流、429、无效等待时间、401、普通 403、404、422 和 503。在旧版中有九个提示用例失败,修复后十个均通过。整个 tracker 包通过。
Chromium 打开同步日志 API 并为 JSON 添加缩进。截图只含测试项目的同步状态。
组合复测
还原正常 GitHub 地址并部署四个修复的组合构建后,使用有权限的真实测试账号同步同一仓库。同步成功,按外部编号核对本地记录,结构化计数为 23。
当前提交的 CI
提交
2905a65dee58的 15 项 GitHub 检查全部通过,含 macOS。 查看检查记录