Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Go extractor does not support build-mode: none, preventing overlay/incremental analysis on PRs

未关闭
#3,796 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
github-actions, go

调研方向

从 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 in codeql-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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/codeql-action 的其他 Issue

查看 github/codeql-action 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。