migrate-code-scanning-alerts fails with OverflowException: analysis IDs now exceed Int32.MaxValue
还没有人认领这个 Issue。
评估
调研方向
从 src/Octoshift/Models/CodeScanningAnalysis.cs 以及 src/Octoshift/Services/GithubApi.cs 中与解析和 GetSarifReport 相关的引用入手;检查与分析 ID 类型相关的测试。使用大于 2,147,483,647 的 code scanning 分析 ID 重现问题,然后验证迁移能够越过溢出问题,并且相关测试通过。
由索引模型根据 Issue 内容生成。
描述
Summary
gh gei migrate-code-scanning-alerts (v1.35.0, latest) now fails with:
[ERROR] System.OverflowException: Value was either too large or too small for an Int32.
right after Migrating Code Scanning Analyses from '<source>' to '<target>', before any SARIF is downloaded or uploaded.
Cause
Code scanning analysis IDs returned by the REST API now exceed Int32.MaxValue (2,147,483,647). Across many repositories we see IDs above that limit starting around 2026-11-11 (for example 2153368829, 2155212725), while older analyses are below it.
GEI parses analysis IDs as 32-bit integers:
src/Octoshift/Models/CodeScanningAnalysis.cs:public int Id { get; set; }src/Octoshift/Services/GithubApi.cs:Id = (int)codescan["id"],(casting the JSON value overflows)src/Octoshift/Services/GithubApi.cs:GetSarifReport(string org, string repo, int analysisId)
Any repository whose source or target has at least one analysis with an ID above Int32.MaxValue on the default branch fails immediately. Repositories whose analyses all predate the rollover still migrate successfully, so the failure rate grows as repositories are re-scanned.
Steps to reproduce
- Use a source repository with any code scanning analysis created recently (ID > 2147483647).
- Run
gh gei migrate-code-scanning-alerts --source-org <org> --source-repo <repo> --target-org <org> --target-repo <repo>. - GEI exits with status 1 and the
OverflowExceptionabove.
Suggested fix
Use long for code scanning analysis IDs: CodeScanningAnalysis.Id, the (int)codescan["id"] cast in GithubApi, and the analysisId parameter of GetSarifReport (plus related tests). Other REST IDs parsed as int may need the same review.
Environment
- gh-gei v1.35.0 (latest release)
- GitHub Enterprise Cloud (github.com), code scanning migration between organizations
- 主要语言
- C#
- 星标
- 482
- 派生
- 151
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 5
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/gh-gei 的其他 Issue
-
task
难度 1/5 1 小时以内 新手友好度 68/100
-
task
难度 1/5 1 小时以内 新手友好度 65/100
-
Support Fine-grained Personal Access Tokens (PATs) in GEI to enable least-privilege CLI migrations未关闭
难度 5/5 一周以上 新手友好度 25/100
-
bbs2gh: support setting custom property values after repository migration可能已有人在做 @enyil 于 36 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 52/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
area:repo elsa 3 prio low triaged type:bug
难度 2/5 1-3 小时 新手友好度 72/100
elsa-workflows/elsa-core#9258 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
iokode/OpinionatedFramework#140 ·
-
accessibility effort: small enhancement
难度 2/5 1-3 小时 新手友好度 78/100
pedersebastian/CustomBossChallenge#185 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100