Skip to content

[Custom Reports]: Make element_type and element_class_id optional in CsvCreationHandler#1773

Merged
martineiber merged 1 commit into2025.4from
fix/custom-report-csv-creation
Apr 23, 2026
Merged

[Custom Reports]: Make element_type and element_class_id optional in CsvCreationHandler#1773
martineiber merged 1 commit into2025.4from
fix/custom-report-csv-creation

Conversation

@markus-moser
Copy link
Copy Markdown
Contributor

Problem

The custom report CSV export fails with:

The required options "element_class_id", "element_type" are missing.

CsvCreationHandler uses ExportCreationHandlerSetupTrait which marks element_type, element_class_id, and columns as required step config fields. This is correct for element grid exports (assets, data-objects), but the custom report flow reuses the same CsvCreationMessage / CsvCreationHandler without those fields — custom reports are not tied to any element type, so the collection step pre-builds all CSV data itself.

Fix

  • Remove ExportCreationHandlerSetupTrait from CsvCreationHandler and override configureStep directly: only CONFIG_CONFIGURATION and CONFIG_COLUMNS remain required (with empty-array defaults); ELEMENT_TYPE and ELEMENT_CLASS_ID become optional with null defaults.
  • Add extractOptionalConfigFieldFromJobStepConfig helper to AbstractHandler for safe extraction with a default value.
  • Switch CsvCreationHandler to use the optional extractor for element_type and element_class_id.

The existing element-grid CSV export flow is unaffected — it still provides all fields, they are just no longer enforced at the step-config validation level.

@sonarqubecloud
Copy link
Copy Markdown

@codacy-production
Copy link
Copy Markdown

Not up to standards ⛔

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes. Give us feedback

@markus-moser markus-moser changed the title fix(custom-report): make element_type and element_class_id optional in CsvCreationHandler [Custom Reports]: Make element_type and element_class_id optional in CsvCreationHandler Apr 21, 2026
@martineiber martineiber marked this pull request as ready for review April 22, 2026 06:35
@martineiber martineiber modified the milestones: 2025.4.2, 2025.4.1 Apr 22, 2026
Copy link
Copy Markdown
Contributor

@martineiber martineiber left a comment

Choose a reason for hiding this comment

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

LGTM

@martineiber martineiber requested a review from lukmzig April 22, 2026 08:00
@martineiber martineiber merged commit 74cd8c3 into 2025.4 Apr 23, 2026
12 of 13 checks passed
@martineiber martineiber deleted the fix/custom-report-csv-creation branch April 23, 2026 06:54
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants