Repository navigation
fix(parser): use selected tenant SoMark and OpenDataLoader instances - #21112
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Addressed the docstring-coverage warning Independently checked the touched functions and added six owner-function Focused tests, the complete related selection (28 selected packages plus two The original runtime screenshots/video remain explicitly labeled with capture AI-assisted with OpenAI Codex. |
yuzhichang
left a comment
There was a problem hiding this comment.
Thanks for the fix. One fail-closed issue in the explicit model path.
| } else { | ||
| model, err = modelDAO.GetByID(ctx, db, selector) | ||
| if errorsIsRecordNotFound(err) { | ||
| return parser.ParseResult{}, false, nil |
There was a problem hiding this comment.
The comment above maybeDispatchTenantPDFParser says a selected tenant reference never falls back, but a bare selected model ID that no longer exists returns handled=false, so the caller proceeds with the generic PDF parser.
This is reachable: resolvePDFVisionModelID accepts a valid-looking model UUID, and GetByID returning ErrRecordNotFound (deleted/stale model) now silently switches parsers.
Please fail closed here, e.g. return true with a selected PDF model not found error, and add a test covering a valid-looking UUID with no record.
There was a problem hiding this comment.
Fixed in 72ec8472e8. Removed the record-not-found handled=false special case, so missing selected IDs terminate with the existing wrapped tenant-PDF-model lookup error (errors.Is(..., gorm.ErrRecordNotFound) stays true).
Both selector fields are covered by helper and actual Parser Invoke tests with reloaded SQLite canvas params. The old source fails eight cases; its Invoke really reaches generic VLM rendering/resolution/chat. The fix makes no fallback request and leaves persisted/runtime config unchanged. Fresh focused/race runs each pass 88 events; all 30 test-executing related packages pass (5,562 events, five explicit skips). Normal hooks passed. Before/after logs, review and native fixture limits. AI-assisted with OpenAI Codex.
|
LGTM |
|
@ZXLyyds100 pls fix conflicts ,thanks !! |
|
@jay77721 Addressed the conflict request in The sole manual conflict was the Parser guide. It now retains both the complete All seven non-dispatch Go files are byte-identical to the previous tested feature Application/native/race suites were not rerun locally for this documentation |
Summary
Latest delivered head:
73917c62badf86c59fccf4664c9273b9a4696dd4(October 20 conflict resolution and exact-head acceptance below).Current acceptance — October 20, 2026
Addressed the maintainer's conflict request
by merging upstream
f2b9d65ef1abd722c906d5fe6c791e0bd2935ed9without rewritingpublished history. The sole manual conflict was the Parser guide: both complete
MinerU controls and tenant SoMark/OpenDataLoader sections remain, with separate
valid JSON examples and upstream image/PaddleOCR documentation preserved.
The effective PR remains nine files; it contains no workflow/build/dependency
or approval-policy changes relative to the merged upstream.
73917c62badf86c59fccf4664c9273b9a4696dd4:sep-tests #20902
completed successfully. Preflight, Go integration, Infinity and Elasticsearch
jobs all executed successfully. Their actual Go unit, integration and both
backend API test steps were verified, as was the dependency regression guard.
ragflow_native_backendwas skipped without steps, not executed or countedas native/inference coverage. These are workflow job/step results, not a claim
that all repository packages, production inference or race tests ran.
nine applicable normal pre-commit checks passed. Seven non-dispatch Go files
are byte-identical to the previously tested feature head; the merged dispatcher
retains all upstream code plus only the original tenant-dispatch insertion.
Application/native/race suites were not rerun locally for this documentation
conflict. Historical local test counts below retain their original revisions.
This automated result and earlier-head human reviews do not constitute
current-head human/CODEOWNER approval.
remain tied to their stated original revisions and synthetic fixture/native
adaptation boundaries; they were not recaptured or relabeled.
Fixes #21027.
Initial reviewed head:
b1b16e08d57f323162f9d9992fb87c395ae96ad0(superseded by the latest delivered head).Connect saved tenant OCR model references to the existing SoMark and
OpenDataLoader Go PDF parsers. On current main, these references can reach the
generic vision path even though the intended parser already exists.
model@instance@provider, using the samePDF selector precedence as the existing dispatch.
DAOs. Reject foreign tenants, mismatched instances, disabled records and
non-OCR models; never substitute the provider's first instance.
Keep saved parser setup unchanged and do not borrow global credentials
when the selected instance has an intentionally empty optional key.
SoMark/OpenDataLoader do not have generic model drivers on main, so this
does not introduce dummy drivers or a parallel parser protocol.
settings are runtime-only; non-secret SoMark model options can supply
defaults, while explicit non-secret pipeline options take precedence.
No frontend, database schema, migration, dependency, workflow or builtin
template changes. This branch is independent of #21109 and #21111.
Existing SoMark polling/cancellation is unchanged; #21076 covers that separately.
Before / after evidence
The same standalone capture test was compiled against
543e16738b4883fcb7e70520e0b5849e7e18c9b7and this implementation,691a50a5ddfac05e9c5fd66ca422a09d9c3092c9. It invokes the exported productionParser, actual builtin config cleaning and JSON reload, real SQLite DAOs, PDF
dispatch and existing parser code. No internal resolver/renderer/dispatcher/
parser function is replaced.
The OCR responses and tenant rows are explicitly labeled local fixtures.
These screenshots show a test evidence viewer, not RAGFlow product UI.
The viewer reads actual runtime captures rather than generating expected results.
18-second recording
· all eight captures, screenshots, replay source and logs
· runtime comparison.
The four original captures fail without an OCR request. The four fixed captures
call only selected instance B with its fixture credential, preserve returned
structured text, and leave saved configuration unchanged. The recording switches
among those captures; it does not rerun Go on each click. All 216 VP8 frames were
independently decoded, and representative frames visually reviewed.
Media and replay files are on a separate fork-only branch, outside the code PR.
Validation and review
against original source before implementation.
with
-count=1through unchangedbuild.sh.The related run passed 30 packages across
./internal/ingestion/... ./internal/parser/... ./internal/dao/..../internal/common/... ./internal/utility/....rejection, malformed settings, missing endpoint, option precedence, anonymous
key/environment isolation, credential rotation, builtin config retention and
reload, real
Parser.Invoke, selected-service errors without VLM fallback,and the existing SSRF boundary.
runtime and reviewed error/secret/ownership boundaries. Normal commit hooks
and
git diff --checkpassed; hooks did not change the validated source tree.Validation limits: macOS tests used an isolated PCRE2 path-only overlay,
genuine ONNX Runtime 1.29.0/PDF 0.3.73 shared libraries and the real tokenizer
archive. No Go behavior was overlaid, and build/dependency files are unchanged.
At initial implementation time, the repository's unmodified macOS static-link
configuration and hosted Linux CI had not been validated. The October 20
acceptance above records the later exact-head hosted Linux result; the macOS
static-link limit remains. No real OCR/LLM inference, production DB/MinIO or full
ingestion E2E is claimed. SoMark fixtures return
SUCCESSimmediately and do notvalidate asynchronous polling. No frontend source changed.
October 18 review-warning follow-up
Historical October 18 head:
b1b16e08d57f323162f9d9992fb87c395ae96ad0. The follow-up addresses the touched-function doc-comment coverage warning with six owner-function comments (13 added comment lines in three existing PR files). It changes no executable code, test or threshold.Focused tests, the complete related selection (28 selected packages plus two native-smoke packages, 30 total) and selected race scenarios passed again with
-count=1through unchangedbuild.sh. Formatting, diff checks and normal source hooks passed; the hooks preserved the tested tree. Follow-up validation and exact logs.The before/after runtime captures and recording above remain at
691a50a5ddfac05e9c5fd66ca422a09d9c3092c9; they were not recaptured or relabeled for this comment-only change. The original native-link-only adaptation and unverified production scope remain unchanged.On this pushed head, all five Actions jobs are
SKIPPEDby the repository's maintainer-controlledci-label gate, not passing tests. No label or workflow was changed to bypass it. CodeRabbit's review of this exact head now reports 95% doc-comment coverage, all five pre-merge checks passed, and no actionable comments. This is an automated result, not human maintainer approval.Implementation, self-review, verification and evidence preparation were
AI-assisted with OpenAI Codex. Historical local records are not human maintainer
approval or hosted-CI evidence; the current hosted result is reported separately above.
Missing-model review follow-up — October 19, 2026 (historical head)
Head:
72ec8472e8eb5edbee130522aaa48b93b1ac1ce5.Addressed the missing-model review. Removed the three-line record-not-found early return: an explicit missing ID now returns
handled=truethrough the existing wrapped lookup error, preservingerrors.Is(err, gorm.ErrRecordNotFound). Existing models and bare-engine dispatch are unchanged.New regressions cover both selector fields, both provider fixtures and actual Parser Invoke using persisted/reloaded synthetic SQLite canvas parameters. The old production owner fails eight cases (ten parent/subtest fail events); real Invoke previously reached generic VLM rendering/resolution/chat. Fixed behavior sends no fallback HTTP/model request and preserves persisted and runtime setup. Test-only VLM/native sentinels and the local services are synthetic, not real inference. Only two existing PR files changed.
Before/after behavior, exact commands, raw logs and automated review. Normal hooks passed and committed diffs match the frozen tested trees; exact remote heads and PR file lists were verified. Local Go checks use unchanged
build.sh, a PCRE path-only overlay and the disclosed genuine same-version ORT 1.29.0 / PDF_oxide 0.3.73 shared TEST adapter. Production static/server builds, real OCR/models, production services and deployed UI are not validated. Appended nativeTestMainwithout model testdata does not executem.Run; plainokis not native unit/inference coverage. Existing screenshots/recordings retain their original capture provenance; no fresh visual capture is claimed for this follow-up.Historical October 19 hosted checkpoint (not the current result)
Read at
2026-10-19T12:39:11.239Zindependently of local validation:ragflow_tests_infinity:in_progressragflow_go_integration:completed/successragflow_tests_elasticsearch:in_progressragflow_preflight:completed/successPending/skipped checks are not passes. Automated reviews and earlier-head approvals are not current-head human approval. AI-assisted with OpenAI Codex.