Repository navigation
build(codeql): exclude office_oxide CGO files so Go analysis completes - #16410
Merged
Merged
Conversation
The CodeQL Go analysis was failing on the entire codebase with:
fatal error: office_oxide.h: No such file or directory
because six ingestion parser files (doc, docx, ppt, pptx, xls, xlsx)
import `github.com/yfedoseev/office_oxide/go`, which is a CGO binding
to a Rust library. The CodeQL runner image doesn't ship the
`office_oxide.h` native header, so the Go AST build aborts before
CodeQL can analyze anything. This meant no Go-language alerts could
be re-evaluated — the most recent CodeQL run fixed 51 alerts (all
Python/JS) but every Go alert stayed open, including ones in files
that had nothing to do with office_oxide.
Add a `.github/codeql/codeql-config.yml` that uses `paths-ignore`
to skip the six parser files. The rest of the Go tree is pure Go
(no CGO) and analyzes cleanly. The parser files are also excluded
from local `go test` / `go build` when the office_oxide C library
isn't installed, so this brings CodeQL in line with the existing
toolchain. Generated / vendored paths are also excluded to avoid
the same class of problem elsewhere.
Fixes the 36 Go-language alerts that were stuck 'open' because the
scan couldn't complete. After this commit, the next CodeQL run on
main will:
1. complete successfully (Go analysis no longer aborts),
2. re-evaluate the alerts in the remaining files,
3. match the existing `// codeql[go/...] suppression comments
added in the previous two PRs (infiniflow#16407, infiniflow#16408),
4. close those alerts.
Python / JS suppression comments from the prior PRs should also
kick in for the matching alerts.
Contributor
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds a CodeQL configuration that excludes selected document parser Go files and generated or vendored paths from analysis. ChangesCodeQL analysis paths
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
yuzhichang
added a commit
that referenced
this pull request
Jun 29, 2026
#16410) ## Problem The CodeQL Go analysis was failing on the entire codebase with: fatal error: office_oxide.h: No such file or directory because six ingestion parser files (`doc`, `docx`, `ppt`, `pptx`, `xls`, `xlsx`) import `github.com/yfedoseev/office_oxide/go`, a CGO binding to a Rust library. The CodeQL runner image doesn't ship the `office_oxide.h` native header, so the Go AST build aborts before CodeQL can analyze anything. This means **no Go-language alerts have been re-evaluated** since the suppression comments were added in #16407 and #16408. The most recent CodeQL run fixed 51 alerts (all Python/JS), but every Go alert stayed open, including ones in files that have nothing to do with office_oxide. ## Fix Add a `.github/codeql/codeql-config.yml` that uses `paths-ignore` to skip the six parser files. The rest of the Go tree is pure Go (no CGO) and analyzes cleanly. The parser files are also excluded from local `go test` / `go build` when the office_oxide C library isn't installed, so this brings CodeQL in line with the existing toolchain. ## Expected outcome After this PR merges, the next CodeQL run on main will: 1. Complete successfully (Go analysis no longer aborts) 2. Re-evaluate the alerts in the remaining files 3. Match the existing `// codeql[go/...] suppression comments` added in #16407 and #16408 4. Close those alerts This should drop the open-alert count from 44 to near zero (the 6 Python clear-text-logging and 1 JS prototype-pollution alerts that were added in #16408 will also be re-evaluated). ## Why not just install office_oxide in the CodeQL runner? - The `office_oxide` Go binding is a 3rd-party module (`github.com/yfedoseev/office_oxide/go`) with CGO that pulls in a Rust crate - The CodeQL runner uses a stock Go toolchain that doesn't include the C library - Installing it would require modifying the GitHub-managed CodeQL workflow, which is owned by GitHub and not easily customizable - The parsers are also unimplemented stubs (each `Parse` function logs the filename and returns `nil` after my earlier clear-text-logging fix), so they have no security-relevant code to scan anyway 🤖 Generated with [Claude Code](https://claude.com/claude-code)
yuzhichang
added a commit
to ondery/ragflow
that referenced
this pull request
Jul 1, 2026
…sion/user + input/output to Langfuse for agent runs Rebuilt on current upstream/main after force-push; cherry-pick of the 7 PR-original commits collapsed into a single net diff to avoid conflicts with intervening commits pulled in by repeated merges of upstream/main. Original PR work (commits dropped during rebuild because their content already lives on upstream/main or was a merge of upstream/main): c7339ae Enhance LLMService with token usage reporting 0266cf0 Implement token usage tracking and Langfuse integration ab2b267 Include session_id in run_kwargs 8bf937c Implement token usage tracking in chat model c955988 Enhance token tracking with context variables and functions 3e88ed5 fix(agent): address CodeRabbit review on token usage tracking 74b8c8c fix(agent): address CodeRabbit follow-up review Forced-upstream duplicates dropped (already merged to main): 70546ea (infiniflow#16396), 5b09910 (infiniflow#16403), 5d7f0fd (infiniflow#16405), 730f33b (infiniflow#16407), a06343e (infiniflow#16408), f90be41 (infiniflow#16410), c4fe68e (infiniflow#16409), d4a0e71 (infiniflow#14773), ef42fd7 (infiniflow#15436), ab1015d (infiniflow#16363), db188cc (infiniflow#15446), 56ece68 (infiniflow#15609), 2589b6e (infiniflow#15644), 74c2944 (infiniflow#15374), 78832ff (infiniflow#14985), bf18b59 (infiniflow#15457), 6c87225 (infiniflow#14890), e16d1a0 (infiniflow#15426), 4712fcb (infiniflow#16169), 0536233 (infiniflow#14589), 08c807a (infiniflow#15145) Plus 18 'Merge branch main into main' commits dropped (polluted topology).
yuzhichang
added a commit
to ondery/ragflow
that referenced
this pull request
Jul 1, 2026
…sion/user + input/output to Langfuse for agent runs Rebuilt on current upstream/main after force-push; cherry-pick of the 7 PR-original commits collapsed into a single net diff to avoid conflicts with intervening commits pulled in by repeated merges of upstream/main. Original PR work (commits dropped during rebuild because their content already lives on upstream/main or was a merge of upstream/main): c7339ae Enhance LLMService with token usage reporting 0266cf0 Implement token usage tracking and Langfuse integration ab2b267 Include session_id in run_kwargs 8bf937c Implement token usage tracking in chat model c955988 Enhance token tracking with context variables and functions 3e88ed5 fix(agent): address CodeRabbit review on token usage tracking 74b8c8c fix(agent): address CodeRabbit follow-up review Forced-upstream duplicates dropped (already merged to main): 70546ea (infiniflow#16396), 5b09910 (infiniflow#16403), 5d7f0fd (infiniflow#16405), 730f33b (infiniflow#16407), a06343e (infiniflow#16408), f90be41 (infiniflow#16410), c4fe68e (infiniflow#16409), d4a0e71 (infiniflow#14773), ef42fd7 (infiniflow#15436), ab1015d (infiniflow#16363), db188cc (infiniflow#15446), 56ece68 (infiniflow#15609), 2589b6e (infiniflow#15644), 74c2944 (infiniflow#15374), 78832ff (infiniflow#14985), bf18b59 (infiniflow#15457), 6c87225 (infiniflow#14890), e16d1a0 (infiniflow#15426), 4712fcb (infiniflow#16169), 0536233 (infiniflow#14589), 08c807a (infiniflow#15145) Plus 18 'Merge branch main into main' commits dropped (polluted topology). Co-authored-by: yzc <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CodeQL Go analysis was failing on the entire codebase with:
fatal error: office_oxide.h: No such file or directory
because six ingestion parser files (
doc,docx,ppt,pptx,xls,xlsx) importgithub.com/yfedoseev/office_oxide/go, a CGO binding to a Rust library. The CodeQL runner image doesn't ship theoffice_oxide.hnative header, so the Go AST build aborts before CodeQL can analyze anything.This means no Go-language alerts have been re-evaluated since the suppression comments were added in #16407 and #16408. The most recent CodeQL run fixed 51 alerts (all Python/JS), but every Go alert stayed open, including ones in files that have nothing to do with office_oxide.
Fix
Add a
.github/codeql/codeql-config.ymlthat usespaths-ignoreto skip the six parser files. The rest of the Go tree is pure Go (no CGO) and analyzes cleanly.The parser files are also excluded from local
go test/go buildwhen the office_oxide C library isn't installed, so this brings CodeQL in line with the existing toolchain.Expected outcome
After this PR merges, the next CodeQL run on main will:
// codeql[go/...] suppression commentsadded in fix(security): address 93 CodeQL code-scanning alerts across 61 files #16407 and fix(codeql): close remaining 44 CodeQL alerts post-merge #16408This should drop the open-alert count from 44 to near zero (the 6 Python clear-text-logging and 1 JS prototype-pollution alerts that were added in #16408 will also be re-evaluated).
Why not just install office_oxide in the CodeQL runner?
office_oxideGo binding is a 3rd-party module (github.com/yfedoseev/office_oxide/go) with CGO that pulls in a Rust crateParsefunction logs the filename and returnsnilafter my earlier clear-text-logging fix), so they have no security-relevant code to scan anyway🤖 Generated with Claude Code