Repository navigation
Remove redundant PatchDSL and consolidate component-param injection into override_params - #17079
Conversation
📝 WalkthroughWalkthroughPipeline execution no longer rewrites incoming DSL JSON with ChangesRuntime component parameter overrides
Estimated code review effort: 3 (Moderate) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant runPipelineWithDSL
participant warnUnknownComponentParams
participant PipelineCompiler
participant pipe.Run
participant ExtractPayload
runPipelineWithDSL->>warnUnknownComponentParams: validate parserConfig component ids
runPipelineWithDSL->>PipelineCompiler: compile original dsl
runPipelineWithDSL->>pipe.Run: execute with override_params
pipe.Run->>ExtractPayload: provide execution result and original dsl
ExtractPayload-->>runPipelineWithDSL: return payload and original dsl
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/ingestion/task/pipeline_executor.go`:
- Around line 348-352: Update the pipe.Run invocation in the task execution flow
to pass the existing parserConfig local variable, preserving its injected LLMID,
instead of re-casting s.taskCtx.Doc.ParserConfig. Remove the surrounding
comment’s migration-history and PatchDSL references, retaining only
current-runtime behavior if a comment is still needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e262b844-90a5-4e76-9063-8a1549b7a48c
📒 Files selected for processing (2)
internal/ingestion/pipeline/pipeline.gointernal/ingestion/task/pipeline_executor.go
💤 Files with no reviewable changes (1)
- internal/ingestion/pipeline/pipeline.go
…nto override_params Pipeline.Run already accepts an `override_params` map (keyed by cpnID, override-wins) that is merged into each component's params at compile time via canvas.WithOverrideParams. PatchDSL performed a byte-for-byte equivalent merge by baking ParserConfig into the DSL text before compilation, so runPipelineWithDSL applied the same Doc.ParserConfig twice with no effect. Delete PatchDSL and compile the DSL unchanged. The extracted component params (including the tenant LLM id injected into Extractor components by common.InjectExtractorLLMID) are passed to Run as override_params; this preserves the prior LLM id injection that PatchDSL used to deliver through the baked DSL. The DSL string returned by runPipelineWithDSL is only consumed by recordPipelineLog (structure storage) and ExtractPayload (which reads the terminal structure, not params), so returning the original DSL is equivalent. Co-Authored-By: Claude <[email protected]>
3a4a6f3 to
46cb499
Compare
|
@yuzhichang @qinling0210 Pls help to review. |
|
LGTM |
Summary
Pipeline.Runalready accepts anoverride_paramsmap (keyed bycpnID, override-wins) that is merged into each component's params at compile time viacanvas.WithOverrideParams.PatchDSLperformed a byte-for-byte equivalent merge by bakingParserConfiginto the DSL text before compilation, sorunPipelineWithDSLapplied the sameDoc.ParserConfigtwice with no effect.Change
PatchDSLfunction (internal/ingestion/pipeline/pipeline.go); it had a single call site.runPipelineWithDSL, compile the DSL unchanged and pass the extracted component params toRunasoverride_params.Behavioral note (important)
Previously
PatchDSLwas also the channel that delivered the tenant LLM id into Extractor components: it bakedparserConfig— aftercommon.InjectExtractorLLMID(parserConfig, Tenant.LLMID)had injectedllm_id— into the DSL. The oldRunoverride_params re-castDoc.ParserConfig(which intentionally omitsllm_id). So removingPatchDSLwhile keeping that re-cast would have silently dropped LLM id injection. This change passes the localparserConfig(the LLMID-injected copy) toRun, preserving the prior behavior.The DSL string returned by
runPipelineWithDSLis only consumed byrecordPipelineLog(structure storage) andExtractPayload(which reads the terminal structure, not params), so returning the original DSL is equivalent.Test plan
bash build.sh --test ./internal/ingestion/task/... ./internal/ingestion/pipeline/...— both packages pass.gofmtclean; pre-commit hooks pass.