Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat (Core): ImportUtil refactor to improve responses #31407

Conversation

jgambarios
Copy link
Contributor

@jgambarios jgambarios commented Feb 17, 2025

This PR represents the final stage of the Import Content response improvements, where the ImportContentletsProcessor now leverages the new structured response format while maintaining full backward compatibility with existing Struts implementations.

Changes Overview

  • Updated ImportContentletsProcessor to use new response format
  • Added converter to maintain backward compatibility with Struts actions
  • Improved error handling and validation message organization
  • Enhanced documentation and code organization

What's Not Changed

We intentionally kept several aspects unchanged to ensure stability:

  • Core import logic remains untouched
  • Legacy response format is still fully supported
  • Existing workflow processing behavior
  • Current transaction handling
  • Permission checking mechanisms

While working on this code, we identified several potential improvements that were intentionally left for future iterations to keep the scope focused on the immediate needs.

This PR is related to: #30882
This PR fixes: #31339

This PR fixes: #31339

Updated import-related classes to enhance JSON serialization/deserialization, removed unused enums, added new validation codes, and streamlined legacy format conversion in `ImportResultConverter`. These changes improve code maintainability and align with new API requirements.
…mportContentletsProcessor-to-Use-New-Import-Result-Format-While-Maintaining-Legacy-Support
Copy link

Please use a Conventional Commit title format for this PR. For more information, see https://www.conventionalcommits.org/en/v1.0.0/

Introduced a boolean parameter to determine whether counters should be updated in the parseLineResults method, ensuring flexibility for error handling scenarios. Removed redundant @NotNull annotations to simplify code. These changes improve clarity and functionality of the import utility.
This update introduces logic to track the last inode during imports and makes it accessible as an optional value. Adjustments include storing, retrieving, and converting the last inode to maintain consistency across processes. This enhances import result tracking and improves data handling.
Adjusted validation parameters to align with updated requirements and fixed assertion to correctly reflect the expected error count. This ensures tests accurately validate warnings and errors, improving code reliability.
@jgambarios jgambarios marked this pull request as ready for review February 18, 2025 18:22
Replaced JSONObject-based map transformation with ObjectMapper for better consistency and reduced dependency. Simplified `transformToMap` method implementation and updated the documentation accordingly. Additionally, minor code formatting improvements were made in ImportContentletsProcessor.
…mportContentletsProcessor-to-Use-New-Import-Result-Format-While-Maintaining-Legacy-Support
Replaced manual iteration and filtering with stream-based processing to retrieve unique fields. This improves readability and maintains the same functionality with cleaner code.
…mportContentletsProcessor-to-Use-New-Import-Result-Format-While-Maintaining-Legacy-Support
Replaced repetitive calls to 'result.data()' with the 'data' variable to improve code readability and maintainability. This change reduces redundancy and ensures consistent access to the processed data throughout the affected methods.
…mportContentletsProcessor-to-Use-New-Import-Result-Format-While-Maintaining-Legacy-Support
@jgambarios jgambarios added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit 4f65bac Feb 20, 2025
36 checks passed
@jgambarios jgambarios deleted the issue-31339-Migrate-ImportContentletsProcessor-to-Use-New-Import-Result-Format-While-Maintaining-Legacy-Support branch February 20, 2025 17:58
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.

Migrate ImportContentletsProcessor to Use New Import Result Format While Maintaining Legacy Support
4 participants