migrate-code-scanning-alerts fails with OverflowException: analysis IDs now exceed Int32.MaxValue
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
Direzione di ricerca
Inizia da src/Octoshift/Models/CodeScanningAnalysis.cs e dai riferimenti al parsing e a GetSarifReport in src/Octoshift/Services/GithubApi.cs; controlla i test correlati ai tipi degli ID di analisi. Riproduci il problema usando un ID di analisi di code scanning superiore a 2,147,483,647, quindi verifica che la migrazione superi l’overflow e che i test correlati passino.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- C#
- Stelle
- 482
- Fork
- 151
- Merge medio
- 2g 18h
- PR unite (30g)
- 5
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/gh-gei
-
task
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
task
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
-
Support Fine-grained Personal Access Tokens (PATs) in GEI to enable least-privilege CLI migrationsAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
bbs2gh: support setting custom property values after repository migrationForse già presa @enyil l’ha presa 36 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
Tutte le issue di github/gh-gei
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
JiaFeiMiao-K-Cat/DiscImageStudio#331 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
BeyondDimension/SteamTools#4168 ·
-
good first issue priority: P2 status: ready type: docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
dotnet/SqlClient#5061 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno