Ruby (build-mode=none) default-setup analysis fails with "no source code was seen" on pull_request events, but succeeds on push — traced to --no-calculate-baseline
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- github-actions, ruby, typescript
调研方向
从 tools/autobuild.sh 中的 Ruby build-mode=none 路径和所引用的 index-files.sh 开始,然后比较 push 和 pull_request 运行的数据库初始化日志与提取日志。分别在有 baseline 计算和没有 baseline 计算的情况下复现单文件 Ruby 案例,并确认 pull_request 提取是否会为该文件建立索引并完成数据库最终化。
由索引模型根据 Issue 内容生成。
描述
Summary
On a private monorepo using default setup with ruby enabled (alongside several other languages), the Analyze (ruby) job fails on every pull_request-triggered scan with:
CodeQL could not process any code written in Ruby. For more information, review our troubleshooting guide at
https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build .
##[error]Encountered a fatal error while running "codeql database finalize --finalize-dataset ... /ruby". Exit code was 32
The same commit, scanned via a push event (default-setup scan of the default branch), succeeds and correctly finds/indexes the Ruby source. So this isn't "no Ruby code exists" — it's event-type-dependent behavior for the same tree.
Repro shape
- CodeQL CLI 2.26.2,
codeql-actiondefault (dynamic) setup,build-mode=none(Ruby, since it's interpreted). - Repo has exactly one
.rbfile, and noGemfile/Rakefile/.ruby-version/.gemspecanywhere else in the tree (the one file is a Homebrew Formula, so no surrounding Ruby project scaffolding). - The
.rbfile is present at the head commit in both cases (verified viagit ls-treeagainst the exact SHA each job checked out) — this isn't a stale-branch/missing-file situation.
Root cause (found via job-log diff)
Diffing the two codeql database init invocations for the same language on the two event types:
push (succeeds):
codeql database init ... --calculate-language-specific-baseline --sublanguage-file-coverage --language=ruby --codescanning-config=... --build-mode=none
Extraction then proceeds:
Scanning for files in <source-root>...
<db>: Indexing files in <source-root>...
Running command in <source-root>: [.../ruby/tools/index-files.sh, .../files-to-index<N>.list]
pull_request (fails):
codeql database init ... --no-calculate-baseline --language=ruby --codescanning-config=... --build-mode=none
Extraction stops right after the first line:
Scanning for files in <source-root>...
— no Indexing files in..., no index-files.sh invocation, no file list is ever produced. codeql database finalize then reports zero files and fails.
--no-calculate-baseline vs --calculate-language-specific-baseline --sublanguage-file-coverage is the only difference between the two invocations. Per the codeql-action changelog, skipping file-coverage collection on pull_request events is an intentional, recent (~April 2026) performance change. The CLI version info on the failing run also carries a suppressesMissingFileBaselineWarning feature flag, suggesting file-discovery and baseline/coverage computation are coupled somewhere in this path for at least the Ruby extractor under build-mode=none.
Hypothesis
For the Ruby extractor's build-mode=none autobuild (tools/autobuild.sh), file discovery for indexing appears to be driven by (or gated on) the same computation that produces the file-coverage baseline. When that computation is skipped (now the default on pull_request events), index-files.sh never runs, so the extractor indexes zero files — independent of what's actually in the checkout. This doesn't seem to affect other configured languages in the same repo (Python, JS/TS, Go, Java/Kotlin, Actions) — plausibly because they have real build/trace-based discovery or enough files/pre-existing baseline state that the gap doesn't surface the same way. It seems most likely to bite a language with very few files and build-mode=none.
Ask
- Is file-discovery for
build-mode=nonelanguages supposed to depend on baseline/coverage calculation? If not, this looks like an unintended regression from the file-coverage-on-PR change. - Is there a documented workaround short of disabling the language entirely for default setup (which is what we're doing in the interim)?
Happy to provide additional (sanitized) log excerpts if useful — the repo itself is private, so I can't link the actual run, but the command-line diff above is copied verbatim from both jobs' logs.
- 主要语言
- 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 天 新手友好度 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 ·
-
难度 4/5 3-5 天 新手友好度 45/100
github/codeql-action#3870 · 3 条评论 · 1 个 reaction ·
查看 github/codeql-action 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
copse-dev/agent-pane#2953 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
-
calcite-components needs triage refactor
难度 2/5 1-3 小时 新手友好度 75/100
Esri/calcite-design-system#15203 ·