bamaer opened a new issue, #8516:
URL: https://github.com/apache/hop/issues/8516

   ### What needs to happen?
   
   The Kettle/PDI importer is reachable two ways — the GUI dialog 
(`KettleImportDialog`) and the `hop-import` CLI (`HopImport`) — and the two 
expose different option sets. Both drive the same `KettleImport` engine, so the 
divergence is purely in what each front-end lets you set.
   
   ### Options available in the GUI but not in the CLI
   
   **1. Default pipeline and workflow run configurations.**
   `defaultPipelineRunConfiguration` and `defaultWorkflowRunConfiguration` are 
declared on `HopImportBase` (lines 61-62) but are not part of the `IHopImport` 
interface, and the only callers of the setters are `KettleImportDialog` lines 
607-609. `HopImport` never sets them.
   
   This is not a cosmetic gap. `KettleImport.processNode()` unconditionally 
overwrites every `<run_configuration>` element with the field value (lines 
948-950) and appends a `<runConfiguration>` element to every Simple Mapping / 
Metadata Injection transform (lines 1010-1012). With the field left null, both 
serialize to an empty element, so a CLI import *removes* whatever 
run-configuration name the source PDI file carried. The resulting workflows 
fail at execution time with `You need to specify a workflow run configuration 
to execute this workflow` — the same symptom reported in #3814. The GUI at 
least warns when either name is left blank (`KettleImportDialog.NoDefaultRC*` 
messages); the CLI has no equivalent and no way to supply a value.
   
   **2. Project targeting.**
   The GUI either registers a new project at the target path (via the 
`HopImportCreateProject` extension point) or resolves an existing project's 
home folder (via `ProjectHome`). The CLI fires only `HopImportStart` and 
`HopImportEnd`, so an import produces files on disk that belong to no 
registered project; `hop-conf` has to be run separately afterwards.
   
   **3. Creating metadata as part of the import.**
   `KettleImportDialog.persistDialogMetadataToTarget()` writes the selected 
(including newly created) run configurations and naming scheme into the target 
project's metadata folder before the import runs. The CLI builds its metadata 
provider from the target folder only (`HopImportBase.runImport()`, lines 
115-124), so `--naming-scheme` resolves only if the scheme already exists there.
   
   ### Options available in the CLI but not in the GUI
   
   - `--no-apply-naming-schemes` — the dialog hardcodes 
`setApplyNamingSchemes(true)`.
   - `--type` / `--list-plugins` — defensible, since the dialog is the Kettle 
plugin's own dialog, but worth an explicit decision.
   
   Per the project convention that functionality should not exist only in a 
file or a flag, `--no-apply-naming-schemes` currently has no GUI expression.
   
   ### Inconsistent default
   
   `--skip-folders` defaults to `false` in the CLI (`HopImport` line 110), 
while the dialog checkbox defaults to selected on first use 
(`KettleImportDialog` line 239 — absent an audit value, 
`!"false".equalsIgnoreCase(null)` evaluates to `true`). The same import 
therefore behaves differently depending on which front-end launches it.
   
   ### Proposed work
   
   1. Promote `setDefaultPipelineRunConfiguration` / 
`setDefaultWorkflowRunConfiguration` to `IHopImport` (as default no-op methods, 
consistent with `setApplyNamingSchemes`) and add `--pipeline-run-configuration` 
/ `--workflow-run-configuration` options to `HopImport`.
   2. Decide and document the behaviour when no run configuration is supplied — 
either preserve the name already present in the source file instead of blanking 
it, or log a warning mirroring the GUI's.
   3. Add a CLI option to register the target folder as a project, or document 
`hop-conf` as the required follow-up step.
   4. Reconcile the `--skip-folders` default between the two front-ends.
   5. Expose the naming-scheme opt-out in the dialog, or drop 
`--no-apply-naming-schemes`.
   
   ### Related
   
   - #3814 — missing workflow run configuration after PDI import.
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: Import


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to