Repository navigation
fix: store source key only in pipeline_operation_log.source_from - #18239
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change expands pipeline log tests. It covers source normalization and verifies that ChangesPipeline log source normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change is localized to source-key handling and no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 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 |
wangq8
left a comment
There was a problem hiding this comment.
The fix itself is correct — synced documents store source_type as <source>/<connector_id> (internal/service/sync_task_service.go), and strings.Cut(sourceType, "/") correctly recovers the bare source key so the KB logs page can match the datasource icon.
However, this PR currently shows mergeable: CONFLICTING against main. The same fix has already been merged via #18366 (commit 1ef4dddde, "fix: align Go ingestion progress and pipeline selection"), which strips the connector id in recordPipelineLog using strings.SplitN(sourceFrom, "/", 2).
Please rebase onto latest main and confirm whether this PR is still needed. If #18366 already covers the reported bug, this PR can be closed as superseded; otherwise update the change to align with the reloaded doc variable now used in recordPipelineLog.
The added test (TestRecordPipelineLog_SourceFrom) is good, but it will also need updating for the doc reload introduced in #18366.
Synced documents carry source_type as '<source>/<connector_id>' (e.g. 'rss/<connector_id>'). The KB logs page maps source_from to a datasource icon by exact key, so the connector-qualified value fell back to the generic computer-upload icon. Strip the connector id and store the bare source key (e.g. 'rss').
0e99c52 to
7ed91cd
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
recordPipelineLog reloads the persisted document and derives source_from from that row. Seed a connector-qualified source_type in the test DB and assert the log stores the bare source key from the reloaded doc, not the stale task-context snapshot.
|
@wangq8 Thanks for the careful review — addressed each point: 1. Rebase / conflict. The branch is now based on the current 2. Is the PR still needed? Confirmed: the production fix was merged via #18366 — 3. Test updated for the Verification. Net: this PR is now a test-only change that locks in the source_from normalization behavior (connector-id stripping on both the reload path and the no-DB fallback path). If you judge the coverage unnecessary, feel free to close it as superseded by #18366. |
What problem does this PR solve?
KB logs page (Dataset -> Logs) shows a generic computer-upload icon in the Source column for files synced from a datasource (e.g. RSS) instead of the datasource-specific icon.
Root cause: for connector-synced documents,
document.source_typeis stored as<source>/<connector_id>(e.g.rss/<connector_id>). The Go ingestion backend (recordPipelineLogininternal/ingestion/task/pipeline_executor.go) copied this verbatim intopipeline_operation_log.source_from. The frontend (web/src/pages/dataset/dataset-overview/overview-table.tsx) mapssource_fromto a datasource icon by exact key lookup (DataSourceKey.RSS === 'rss'), so the connector-qualified value missed the lookup and fell back to the generic icon.Fix: strip the connector id and store only the bare source key in
source_from(strings.Cut(sourceType, "/")).Verified live: inserted two
pipeline_operation_logrows into a test KB, one withsource_from='rss/<connector_id>'(shows generic computer icon) and one withsource_from='rss'(shows the RSS icon).Type of change