Skip to content

Fix for issue #7355#7357

Merged
hansva merged 1 commit into
apache:mainfrom
mattcasters:issue-7355
Jun 29, 2026
Merged

Fix for issue #7355#7357
hansva merged 1 commit into
apache:mainfrom
mattcasters:issue-7355

Conversation

@mattcasters

@mattcasters mattcasters commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Task: hardening the Apache Hop Testing Plugin, issue #7355

This report outlines the completed fixes and enhancements implemented in the Apache Hop codebase to resolve the problems described in the issue.

1. CSV Loader Safety (Out of Bounds Errors)

  • Problem: If a CSV data set file on disk changed (e.g. fewer columns) relative to the data set metadata or vice-versa, the CSV loader utility would throw ArrayIndexOutOfBoundsException errors.
  • Resolution:
    • Updated DataSetCsvUtil.java: Added boundary checks on the index mapping arrays before invok
      ing setRowMeta.getValueMeta(...) and csvRecord.get(...). Any missing or out-of-bound columns default gracefully to null instead of throwing exceptions.
    • Updated DataSet.java: Enhanced getMappedDataSetFieldsRowMeta to construct a dummy ValueMetaStri ng if a mapped field does not exist in the dataset metadata, preventing downstream NullPointerExceptions and metadata mismatches.

2. Open Selected Unit Test from Workflow Actions

  • Problem: Opening a pipeline via the Run Unit Tests action in a workflow opened the pipeline, but did not activate the specific unit test selected in that workflow action if multiple tests existed.
  • Resolution:
    • Updated RunPipelineTests.java: Set the chosen unit test's name in the D ataSetConst.VAR_UNIT_TEST_NAME environment variable (using reflection to access HopGui variables safely to maintain headless environment compatibility).
    • Updated AutoOpenTestExtensionPoint.java: Added checking for DataSetConst.VA R_UNIT_TEST_NAME during the PipelineAfterOpen extension point. If specified, the requested unit test is activated, and the variable is subsequently cleared.

3. Dataset Location Dialog Validation

  • Problem: Missing validation tools in the Dataset Location Dialog to check mapped/sort fields, file existence, and row reading.
  • Resolution:
    • Updated PipelineUnitTestSetLocationDialog.java: Added a Validate button at the bottom of the dialog.
    • Implemented a validate() check that:
      1. Validates that a dataset and transform are selected.
      2. Validates that the dataset exists in metadata.
      3. Checks if the mapped fields exist in both the transform and the dataset.
      4. Checks if the sort fields exist in the dataset.
      5. Checks if the actual CSV file exists on disk.
      6. Validates if rows can be successfully read from the CSV file.
      7. Displays validation remarks using the standard Hop CheckResultDialog or a popup message box.
    • Added corresponding translations in messages_en_US.properties.

4. Context Menu Override on Golden Dataset Arrow Click

  • Problem: Right-clicking or clicking on a golden dataset arrow on the canvas unexpectedly popped up the general pipeline context menu along with the expected location dialog.
  • Resolution:
    • Created LocationMouseUpExtensionPoint.java: Registered to the PipelineGr aphMouseUp extension point.
    • Intercepts MouseUp events on the canvas: if the clicked AreaOwner belongs to AREA_DRAWN_INPUT_DATA_SET, AREA_DRAWN_GOLDEN_DATA_SET, or AREA_DRAWN_GOLDEN_DATA_RESULT, it sets pipelineGraphExtension.setP reventingDefault(true), stopping the pipeline context dialog from appearing.

@hansva hansva merged commit ff74172 into apache:main Jun 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants