Skip to content

Remove redundant PatchDSL and consolidate component-param injection into override_params - #17079

Merged
yuzhichang merged 1 commit into
infiniflow:mainfrom
xugangqiang:refactor/remove-redundant-patchdsl
Jul 20, 2026
Merged

yuzhichang merged 1 commit into
infiniflow:mainfrom
xugangqiang:refactor/remove-redundant-patchdsl

Conversation

@xugangqiang

@xugangqiang xugangqiang commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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.

Change

  • Delete the now-dead PatchDSL function (internal/ingestion/pipeline/pipeline.go); it had a single call site.
  • In runPipelineWithDSL, compile the DSL unchanged and pass the extracted component params to Run as override_params.

Behavioral note (important)

Previously PatchDSL was also the channel that delivered the tenant LLM id into Extractor components: it baked parserConfig — after common.InjectExtractorLLMID(parserConfig, Tenant.LLMID) had injected llm_id — into the DSL. The old Run override_params re-cast Doc.ParserConfig (which intentionally omits llm_id). So removing PatchDSL while keeping that re-cast would have silently dropped LLM id injection. This change passes the local parserConfig (the LLMID-injected copy) to Run, preserving the prior behavior.

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.

Test plan

  • bash build.sh --test ./internal/ingestion/task/... ./internal/ingestion/pipeline/... — both packages pass.
  • gofmt clean; pre-commit hooks pass.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Pipeline execution no longer rewrites incoming DSL JSON with parserConfig. The removed PatchDSL helper is replaced by runtime override_params merging, while execution, error handling, and returned DSL values continue to reference the original input.

Changes

Runtime component parameter overrides

Layer / File(s) Summary
Remove DSL patching helper
internal/ingestion/pipeline/pipeline.go
The exported PatchDSL function and its component parameter merging logic are deleted.
Use runtime overrides during execution
internal/ingestion/task/pipeline_executor.go
runPipelineWithDSL compiles and runs the original DSL, retains unknown-parameter warnings, and uses override_params for component parameter application.

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
Loading

Possibly related PRs

Suggested reviewers: yuzhichang, qinling0210

Poem

I’m a rabbit with a pipeline to tune,
No patched DSL beneath the moon.
Overrides hop through runtime bright,
The original DSL stays in sight.
Unknown params get a warning call—
Clean little hops for one and all! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed Clearly summarizes removal of PatchDSL and consolidation of param injection into override_params.
Description check ✅ Passed Includes the required Summary section plus background, change details, behavioral note, and test plan.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@xugangqiang xugangqiang added the ci Continue Integration label Jul 20, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3da2425 and 3a4a6f3.

📒 Files selected for processing (2)
  • internal/ingestion/pipeline/pipeline.go
  • internal/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]>
@xugangqiang
xugangqiang force-pushed the refactor/remove-redundant-patchdsl branch from 3a4a6f3 to 46cb499 Compare July 20, 2026 03:12
@xugangqiang

Copy link
Copy Markdown
Contributor Author

@yuzhichang @qinling0210 Pls help to review.

@yuzhichang

Copy link
Copy Markdown
Member

LGTM

@yuzhichang
yuzhichang merged commit c396ae9 into infiniflow:main Jul 20, 2026
5 of 6 checks passed
@xugangqiang
xugangqiang deleted the refactor/remove-redundant-patchdsl branch August 7, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants