Go extractor does not support build-mode: none, preventing overlay/incremental analysis on PRs
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
调研方向
从 Go extractor 的 build-mode 处理和 issue 中引用的 buildless 选项开始;检查 codeql-extractor.yml 中声明的选项,包括 trap.cache.*。使用 build-mode: none 复现,并将提取行为与现有 workaround 进行比较。当 Go 接受该模式,并且 overlay 或增量提取无需这些环境变量即可工作时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Problem
The Go extractor (CodeQL CLI 2.25.1) does not support build-mode: none:
A fatal error occurred: Go does not support the none build mode.
Please try using one of the following build modes instead: autobuild, manual.
This means Go cannot benefit from overlay/incremental analysis on pull requests. JavaScript gets this automatically — in our monorepo we see Overlay filter removed 4311 out of 4312 files from extraction on JS PRs, reducing a full extraction to just the changed files. Go still does a full extraction of every package on every PR (~2.5 min for autobuild + ~1.5 min for analysis in a large monorepo).
Current workaround
We use legacy env var hacks to skip the actual go build:
env:
CODEQL_EXTRACTOR_GO_FAST_PACKAGE_INFO: y
CODEQL_EXTRACTOR_GO_BUILD_COMMAND: false
This avoids compilation but still runs full type extraction for every Go package on every PR.
Expected behavior
Setting build-mode: none should work for Go, enabling overlay/incremental analysis on PRs (as it already does for JavaScript/TypeScript). The Go extractor already has a buildless/standalone extraction path (DEPRECATED: Use --build-mode none instead appears in the extractor options for the buildless flag), so the extraction capability exists — it just isn't wired up to accept build-mode: none.
Additional context
- We also noticed that Go's extractor does not declare
trap.cache.*options incodeql-extractor.yml, so TRAP caching is also unavailable for Go. - The v3→v4 action upgrade enabled overlay for JS automatically, but there's no path to get the same benefit for Go.
- codeql-action v4.35.1, CodeQL CLI 2.25.1
- 主要语言
- TypeScript
- 星标
- 1.6k
- 派生
- 493
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 44
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/codeql-action 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
github/codeql-action#4052 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
github/codeql-action#4078 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
github/codeql-action#4008 · 9 条评论 ·
-
难度 4/5 3-5 天 新手友好度 52/100
github/codeql-action#3978 · 4 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 48/100
github/codeql-action#3915 · 6 条评论 · 3 个 reaction ·
查看 github/codeql-action 的全部 Issue
相似的 Issue
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
supermomonga/zcode-acp#24 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
growthbook/growthbook#7100 ·
-
triage
难度 1/5 1-3 小时 新手友好度 88/100