Skip to content

Feat: Support pipeline-related configuration at the document level.#17212

Open
cike8899 wants to merge 2 commits into
infiniflow:mainfrom
cike8899:feat-pipeline-dataset-config
Open

Feat: Support pipeline-related configuration at the document level.#17212
cike8899 wants to merge 2 commits into
infiniflow:mainfrom
cike8899:feat-pipeline-dataset-config

Conversation

@cike8899

Copy link
Copy Markdown
Contributor

Summary

Feat: Support pipeline-related configuration at the document level.

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. 💞 feature Feature request, pull request that fullfill a new feature. labels Jul 22, 2026
@cike8899 cike8899 added ci Continue Integration and removed 💞 feature Feature request, pull request that fullfill a new feature. size:XL This PR changes 500-999 lines, ignoring generated files. labels Jul 22, 2026
@cike8899
cike8899 marked this pull request as draft July 22, 2026 03:14
@cike8899
cike8899 marked this pull request as ready for review July 22, 2026 03:14
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds pipeline operator configuration transforms, a Go-backend document pipeline dialog, backend-specific parser updates, and dedicated form-field components. Dataset settings and parser-change flows are rewired to use the new modules.

Changes

Pipeline parser configuration

Layer / File(s) Summary
Operator transformation foundation
web/src/utils/pipeline-operator.ts, web/src/hooks/use-pipeline-operator.ts, web/src/hooks/parser-config-utils.ts
Adds API/form transformations, DSL node construction, parser-config generation, pipeline node synchronization, active-tab state, and pipeline-config detection.
Document pipeline form and dialog
web/src/components/document-pipeline-dialog/..., web/src/components/builtin-pipeline-form-field.tsx, web/src/components/parse-type-form-field.tsx, web/src/components/pipeline-operator-tabs/..., web/src/components/chunk-method-dialog/index.tsx
Adds validated parser-mode forms, built-in and pipeline selectors, operator tabs, configuration synchronization, and modal submission handling.
Backend-specific parser updates
web/src/hooks/use-document-request.ts, web/src/hooks/use-knowledge-request.ts, web/src/pages/dataset/dataset/dataset-table.tsx, web/src/pages/dataset/dataset/use-change-document-parser.ts
Adds Go-backend pipeline parser mutations, shared parser-config detection, backend-dependent dialog rendering, and combined loading state handling.
Component extraction and wiring
web/src/pages/dataset/dataset-setting/configuration/common-item.tsx, web/src/pages/dataset/dataset-setting/index.tsx, web/src/pages/datasets/dataset-creating-dialog.tsx
Moves parse-type and built-in pipeline fields into dedicated components and updates dataset-setting imports.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DatasetTable
  participant DocumentPipelineDialog
  participant useDocumentPipelineForm
  participant usePipelineOperatorNodes
  participant useSetDocumentPipelineParser
  DatasetTable->>DocumentPipelineDialog: render Go-backend parser dialog
  DocumentPipelineDialog->>useDocumentPipelineForm: initialize and submit form
  useDocumentPipelineForm->>usePipelineOperatorNodes: load pipeline operators
  DocumentPipelineDialog->>useSetDocumentPipelineParser: submit transformed parser data
  useSetDocumentPipelineParser-->>DatasetTable: return update result
Loading

Possibly related PRs

Suggested labels: 💞 feature, 🧰 typescript, size:XXL

Poem

I’m a rabbit with pipelines neat,
Tabs and forms now hop in beat.
DSL nodes line up bright,
Parser configs transform right.
Go backend gets a bun-filled flight!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.75% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description only repeats the title and lacks the background/context required by the template. Expand the Summary with the problem context, what changed, and why document-level pipeline configuration is needed.
✅ Passed checks (3 passed)
Check name Status Explanation
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 The title clearly matches the change: document-level support for pipeline-related configuration.

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.

@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: 3

🧹 Nitpick comments (1)
web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts (1)

41-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse isPipelineParserConfig instead of reimplementing the check.

-  const hasPipelineKeys = Object.keys(parserConfig).some((key) =>
-    key.includes(':'),
-  );
-  if (!hasPipelineKeys) {
+  if (!isPipelineParserConfig(parserConfig)) {
     return parserConfig;
   }

As per coding guidelines, "search for duplicate or similar hooks and functions and reuse them instead of reimplementing the behavior inline."

🤖 Prompt for 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.

In `@web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts`
around lines 41 - 46, Update the parser configuration check in the surrounding
form logic to call the existing isPipelineParserConfig helper instead of
manually checking Object.keys(parserConfig) for colon-containing keys. Preserve
the current early return behavior when the configuration is not a pipeline
parser configuration.

Source: Coding guidelines

🤖 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 `@web/src/hooks/use-document-request.ts`:
- Around line 555-557: Replace the inline queryKey array in the document-list
invalidation with a same-file DocumentKeys factory defined using as const. Reuse
the factory for this invalidation and the existing document-list invalidation,
ensuring both calls reference the shared key without raw React Query queryKey
arrays.
- Around line 508-514: Update the documentation comment describing the
Go-backend variant of useSetDocumentParser by removing the deferred-retirement
sentence about dropping the hook after the Python backend is retired, while
retaining the current endpoint contract and parallelism details.

In `@web/src/utils/pipeline-operator.ts`:
- Around line 308-342: Add a visited-node set to buildPipelineOperatorNodes and,
while following sourceToTarget from FileNodeId, stop traversal when the current
ID has already been visited. Preserve the existing ordered node collection and
mapping behavior for acyclic chains.

---

Nitpick comments:
In `@web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts`:
- Around line 41-46: Update the parser configuration check in the surrounding
form logic to call the existing isPipelineParserConfig helper instead of
manually checking Object.keys(parserConfig) for colon-containing keys. Preserve
the current early return behavior when the configuration is not a pipeline
parser configuration.
🪄 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: 7382cf29-372d-4df6-97b5-b7af66da6ffb

📥 Commits

Reviewing files that changed from the base of the PR and between b175ed5 and b6ea5ba.

📒 Files selected for processing (19)
  • web/src/components/builtin-pipeline-form-field.tsx
  • web/src/components/chunk-method-dialog/index.tsx
  • web/src/components/document-pipeline-dialog/index.tsx
  • web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts
  • web/src/components/parse-type-form-field.tsx
  • web/src/components/pipeline-operator-tabs/index.tsx
  • web/src/components/pipeline-operator-tabs/pipeline-operator-form.tsx
  • web/src/hooks/parser-config-utils.ts
  • web/src/hooks/use-document-request.ts
  • web/src/hooks/use-knowledge-request.ts
  • web/src/hooks/use-pipeline-operator.ts
  • web/src/pages/dataset/dataset-setting/configuration/common-item.tsx
  • web/src/pages/dataset/dataset-setting/index.tsx
  • web/src/pages/dataset/dataset/dataset-table.tsx
  • web/src/pages/dataset/dataset/use-change-document-parser.ts
  • web/src/pages/dataset/setting/hooks.ts
  • web/src/pages/dataset/setting/index.tsx
  • web/src/pages/datasets/dataset-creating-dialog.tsx
  • web/src/utils/pipeline-operator.ts
💤 Files with no reviewable changes (1)
  • web/src/pages/dataset/dataset-setting/configuration/common-item.tsx

@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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 3

🧹 Nitpick comments (1)
web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts (1)

41-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse isPipelineParserConfig instead of reimplementing the check.

-  const hasPipelineKeys = Object.keys(parserConfig).some((key) =>
-    key.includes(':'),
-  );
-  if (!hasPipelineKeys) {
+  if (!isPipelineParserConfig(parserConfig)) {
     return parserConfig;
   }

As per coding guidelines, "search for duplicate or similar hooks and functions and reuse them instead of reimplementing the behavior inline."

🤖 Prompt for 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.

In `@web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts`
around lines 41 - 46, Update the parser configuration check in the surrounding
form logic to call the existing isPipelineParserConfig helper instead of
manually checking Object.keys(parserConfig) for colon-containing keys. Preserve
the current early return behavior when the configuration is not a pipeline
parser configuration.

Source: Coding guidelines

🤖 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 `@web/src/hooks/use-document-request.ts`:
- Around line 555-557: Replace the inline queryKey array in the document-list
invalidation with a same-file DocumentKeys factory defined using as const. Reuse
the factory for this invalidation and the existing document-list invalidation,
ensuring both calls reference the shared key without raw React Query queryKey
arrays.
- Around line 508-514: Update the documentation comment describing the
Go-backend variant of useSetDocumentParser by removing the deferred-retirement
sentence about dropping the hook after the Python backend is retired, while
retaining the current endpoint contract and parallelism details.

In `@web/src/utils/pipeline-operator.ts`:
- Around line 308-342: Add a visited-node set to buildPipelineOperatorNodes and,
while following sourceToTarget from FileNodeId, stop traversal when the current
ID has already been visited. Preserve the existing ordered node collection and
mapping behavior for acyclic chains.

---

Nitpick comments:
In `@web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts`:
- Around line 41-46: Update the parser configuration check in the surrounding
form logic to call the existing isPipelineParserConfig helper instead of
manually checking Object.keys(parserConfig) for colon-containing keys. Preserve
the current early return behavior when the configuration is not a pipeline
parser configuration.
🪄 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: 7382cf29-372d-4df6-97b5-b7af66da6ffb

📥 Commits

Reviewing files that changed from the base of the PR and between b175ed5 and b6ea5ba.

📒 Files selected for processing (19)
  • web/src/components/builtin-pipeline-form-field.tsx
  • web/src/components/chunk-method-dialog/index.tsx
  • web/src/components/document-pipeline-dialog/index.tsx
  • web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts
  • web/src/components/parse-type-form-field.tsx
  • web/src/components/pipeline-operator-tabs/index.tsx
  • web/src/components/pipeline-operator-tabs/pipeline-operator-form.tsx
  • web/src/hooks/parser-config-utils.ts
  • web/src/hooks/use-document-request.ts
  • web/src/hooks/use-knowledge-request.ts
  • web/src/hooks/use-pipeline-operator.ts
  • web/src/pages/dataset/dataset-setting/configuration/common-item.tsx
  • web/src/pages/dataset/dataset-setting/index.tsx
  • web/src/pages/dataset/dataset/dataset-table.tsx
  • web/src/pages/dataset/dataset/use-change-document-parser.ts
  • web/src/pages/dataset/setting/hooks.ts
  • web/src/pages/dataset/setting/index.tsx
  • web/src/pages/datasets/dataset-creating-dialog.tsx
  • web/src/utils/pipeline-operator.ts
💤 Files with no reviewable changes (1)
  • web/src/pages/dataset/dataset-setting/configuration/common-item.tsx
🛑 Comments failed to post (3)
web/src/hooks/use-document-request.ts (2)

508-514: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the deferred-retirement note.

Keep the comment focused on the current Go endpoint contract; “can be dropped once the Python backend is retired” is a stale migration note.

As per coding guidelines, “Remove … ‘move later’ notes.”

🤖 Prompt for 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.

In `@web/src/hooks/use-document-request.ts` around lines 508 - 514, Update the
documentation comment describing the Go-backend variant of useSetDocumentParser
by removing the deferred-retirement sentence about dropping the hook after the
Python backend is retired, while retaining the current endpoint contract and
parallelism details.

Source: Coding guidelines


555-557: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use a DocumentKeys factory for invalidation.

This adds another inline React Query key. Define a same-file DocumentKeys factory with as const and use it here and in the existing document-list invalidation.

As per coding guidelines, “Never write raw React Query queryKey arrays inline.”

🤖 Prompt for 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.

In `@web/src/hooks/use-document-request.ts` around lines 555 - 557, Replace the
inline queryKey array in the document-list invalidation with a same-file
DocumentKeys factory defined using as const. Reuse the factory for this
invalidation and the existing document-list invalidation, ensuring both calls
reference the shared key without raw React Query queryKey arrays.

Source: Coding guidelines

web/src/utils/pipeline-operator.ts (1)

308-342: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

No cycle guard when following the DSL edge chain.

while (currentId) { ...; currentId = sourceToTarget.get(currentId); } will loop forever if dsl.graph.edges ever contains a cycle back to an already-visited node, hanging the tab. Add a visited-set guard.

🔒️ Proposed fix
   const orderedIds: string[] = [];
+  const visited = new Set<string>();
   let currentId: string | undefined = FileNodeId;
-  while (currentId) {
+  while (currentId && !visited.has(currentId)) {
+    visited.add(currentId);
     orderedIds.push(currentId);
     currentId = sourceToTarget.get(currentId);
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

export function buildPipelineOperatorNodes(
  dsl?: DSL,
  pipelineParserConfig: Record<string, any> = {},
): RAGFlowNodeType[] {
  if (!dsl?.graph?.nodes || !dsl?.graph?.edges) {
    return [];
  }

  // Build source → target map from edges (pipeline is linear)
  const sourceToTarget = new Map<string, string>();
  for (const edge of dsl.graph.edges) {
    sourceToTarget.set(edge.source, edge.target);
  }

  // Follow the chain starting from File, collecting node IDs in order
  const orderedIds: string[] = [];
  const visited = new Set<string>();
  let currentId: string | undefined = FileNodeId;
  while (currentId && !visited.has(currentId)) {
    visited.add(currentId);
    orderedIds.push(currentId);
    currentId = sourceToTarget.get(currentId);
  }

  // Build a lookup from node ID → node
  const nodeById = new Map<string, RAGFlowNodeType>();
  for (const node of dsl.graph.nodes) {
    nodeById.set(node.id, node);
  }

  // Map ordered IDs to nodes, excluding File
  return orderedIds
    .filter((id) => id !== FileNodeId)
    .map((id) => nodeById.get(id))
    .filter((node): node is RAGFlowNodeType => node !== undefined)
    .map((node) => buildOperatorNode(node, pipelineParserConfig));
}
🤖 Prompt for 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.

In `@web/src/utils/pipeline-operator.ts` around lines 308 - 342, Add a
visited-node set to buildPipelineOperatorNodes and, while following
sourceToTarget from FileNodeId, stop traversal when the current ID has already
been visited. Preserve the existing ordered node collection and mapping behavior
for acyclic chains.

@cike8899
cike8899 marked this pull request as draft July 22, 2026 03:45
@cike8899
cike8899 marked this pull request as ready for review July 22, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant