Skip to content

dataflow UI changes#1908

Open
KangJingA wants to merge 11 commits intodevelopfrom
KangJingA/dataflow-ui-changes
Open

dataflow UI changes#1908
KangJingA wants to merge 11 commits intodevelopfrom
KangJingA/dataflow-ui-changes

Conversation

@KangJingA
Copy link
Collaborator

Merge Checklist

Please cross check this list if additions / modifications needs to be done on top of your core changes and tick them off. Reviewer can as well glance through and help the developer if something is missed out.

  • Automated Tests (Jasmine integration tests, Unit tests, and/or Performance tests)
  • Updated Manual tests / Demo Config
  • Documentation (Application guide, Admin guide, Markdown, Readme and/or Wiki)
  • Verified that local development environment is working with latest changes (integrated with latest develop branch)
  • following best practices in code review doc

@KangJingA
Copy link
Collaborator Author

changes:

  • white rabbit fix: send node_id to white rabbit flow
  • rabbit in a hat flow: fixed wrong path
  • add dropdown to select database code for dbreader and dbwriter nodes - to be discussed (white rabbit node)
  • fix formatting

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Flow and Mapping UIs plus White Rabbit backend/flow integration to use node_id + server-side file handling (instead of client-side CSV compression), and adds Trex DB discovery for DB reader/writer nodes.

Changes:

  • Switch White Rabbit “scan files” requests to send { node_id, files, settings } (removing client-side gzip/base64 compression and server-side decompression middleware).
  • Add Trex /db/ RTK Query slice and use it to populate DB selection dropdowns in DB reader/writer drawers.
  • Fix White Rabbit ETL report generation to run rabbitInAHat with the correct working directory and serialize request data via model_dump().

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ui/apps/mapping/src/components/ScanDataDialog/ScanDataDialog.tsx Reorders CSV upload/scan and updates scan payload to send node_id + filenames.
ui/apps/mapping/src/axios/white-rabbit.ts Updates scan/ETL API payload shapes and adds node_id to ETL requests.
ui/apps/mapping/src/Field/FieldMapLayout.tsx Passes nodeId when requesting ETL report generation.
ui/apps/flow/webpack.config.js Proxies /trex to local backend for dev.
ui/apps/flow/src/store/store.ts Registers dbApiSlice reducer + middleware.
ui/apps/flow/src/features/flow/slices/index.ts Re-exports db-slice.
ui/apps/flow/src/features/flow/slices/db-slice.ts Adds Trex DB list query endpoint/hook.
ui/apps/flow/src/features/flow/slices/dataflow-slice.ts Updates scan report requests to send filenames + node_id (no compression).
ui/apps/flow/src/features/flow/containers/Node/NodeTypes/SelectNodeTypes/SelectNodeTypesDialog.tsx Minor formatting (trailing commas).
ui/apps/flow/src/features/flow/containers/Node/NodeTypes/DbWriterNode/DbWriterDrawer.tsx Uses Trex DB list to render DB dropdown.
ui/apps/flow/src/features/flow/containers/Node/NodeTypes/DbReaderNode/DbReaderDrawer.tsx Uses Trex DB list to render DB dropdown.
ui/apps/flow/src/components/Dialog/ScanDataDialog/ScanDataDialog.tsx Uploads node CSVs then scans selected filenames via updated scan payload.
functions/jobplugins/src/controllers/WhiteRabbitController.ts Removes request decompression middleware for SCAN_REPORT_FILES.
flows/data_transformation/white_rabbit_plugin/types.py Allows extra fields on request data model.
flows/data_transformation/white_rabbit_plugin/tasks.py Runs rabbitInAHat with correct working_dir; adjusts output path check.
flows/data_transformation/white_rabbit_plugin/flow.py Serializes options.data via model_dump() before writing JSON.

@@ -2,9 +2,6 @@ import express, { Request, Response, Router } from "express";
import { param, validationResult } from "express-validator";
import { validateWhiteRabbitFlowRunDto } from "../middlewares/WhiteRabbitValidatorMiddlewares.ts";
import { WhiteRabbitService } from "../services/WhiteRabbitService.ts";
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Buffer is still used later in this controller (Buffer.from(...) in getETLReportFromArtifacts), but the buffer import was removed. In this Deno + import-map setup, Buffer won’t be defined unless it’s imported. Re-add import { Buffer } from "buffer" (or equivalent) to avoid runtime failures when downloading the ETL report.

Suggested change
import { WhiteRabbitService } from "../services/WhiteRabbitService.ts";
import { WhiteRabbitService } from "../services/WhiteRabbitService.ts";
import { Buffer } from "buffer";

Copilot uses AI. Check for mistakes.
useFormData<FormData>(EMPTY_FORM_DATA);
const { data: databases = [], isLoading: isLoadingDatabases } =
useGetDatabasesQuery();
console.log("Databases:", databases);
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Remove the leftover console.log("Databases:", databases); it will spam the console for every drawer render and can leak potentially sensitive environment metadata in production logs.

Suggested change
console.log("Databases:", databases);

Copilot uses AI. Check for mistakes.
Comment on lines 106 to 113
try {
setLoading(true);
if (dataType === "csv") {
await scanData();
await uploadCsvData();
await scanData();
} else {
await scanDBData();
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

handleApply is memoized with useCallback, but its dependency list isn’t updated to include the values it calls (uploadCsvData, scanData, scanDBData, handleClose, and nodeId via those callbacks). This risks stale closures and will typically trip exhaustive-deps linting. Include the referenced values in the dependency array or remove useCallback here.

Copilot uses AI. Check for mistakes.
Comment on lines 61 to 67
fieldMap
);
console.debug("ETL Model:", model);
const response = await api.whiteRabbit.createEtlReport(model);
const response = await api.whiteRabbit.createEtlReport(model, nodeId);
const flowRunId = response.flowRunId;

const intervalId = setInterval(async () => {
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

handleReport now passes nodeId into createEtlReport, but the useCallback dependency array for handleReport isn’t updated to include nodeId. This can cause the ETL report request to use a stale nodeId if the context state changes. Add nodeId to the dependency list (or refactor to avoid memoizing this handler).

Copilot uses AI. Check for mistakes.
Comment on lines 290 to 294
const response = await createDBScanReport({
nodeId,
postgresqlForm: dbConnectionForm,
tablesToScan: selectedTables,
}).unwrap();
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

This callback uses nodeId and createDBScanReport but the useCallback dependency array isn’t updated accordingly. If the dialog is reused for a different node, this can call stale values. Add the missing dependencies (or refactor to avoid memoizing).

Copilot uses AI. Check for mistakes.
Comment on lines 145 to 151
} finally {
setLoading(false);
}
}, [selectedTables, dataType]);
}, [selectedTables, dataType, uploadedFiles, nodeId]);

const handleDataTypeChange = useCallback(
(event: SelectChangeEvent<string>) => {
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

handleApply references uploadNodeCsvFile, scanData, scanDBData, and handleClose, but they are not included in the useCallback dependency array. This risks stale closures and usually violates exhaustive-deps linting. Include the referenced values in the dependency list or remove the memoization.

Copilot uses AI. Check for mistakes.
Comment on lines +222 to 225
if (uploadedFiles && nodeId) {
const fileNames = uploadedFiles.map((file) => file.name);
const response = await api.whiteRabbit.createScanReport(nodeId, fileNames, delimiter);
const flowRunId = response.flowRunId;
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

scanData currently builds fileNames from all uploadedFiles, ignoring the user’s selectedTables choices. This will scan files the user didn’t select. Use the selected list (or filter uploadedFiles by selectedTables) when calling createScanReport.

Copilot uses AI. Check for mistakes.
Comment on lines 285 to 289
const data = {
options: {
data: iniSettings,
node_id: nodeId,
run_type: "SCAN_REPORT_DB",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

createDBScanReport sends node_id at options.node_id, but the White Rabbit flow expects node_id inside options.data (it reads options.data.node_id). As-is, DB scans will fail Pydantic validation due to missing node_id. Move node_id into the data payload (e.g., merge into iniSettings).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants