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

Improve imports #15898

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

bryanlopezinc
Copy link
Contributor

PR Summary

  • Validate input options when importing items from the CLI.
  • Validate the import type to prevent errors when an invalid type is provided, applicable to both CLI and API endpoints.
  • Fixed an issue in the import command where a success message was returned even when the import file did not exist.
  • Remove the deprecated method fetchOne

Checklist:

@bryanlopezinc bryanlopezinc requested a review from snipe as a code owner November 28, 2024 10:52
Copy link

what-the-diff bot commented Nov 28, 2024

PR Summary

  • Improved Import Command Functionality

    • The object import command has been refined. We added a mechanism that checks the validity of an import file to make sure it exists and follows the rules we set. This helps in avoiding faulty operations.
    • We've made it easier to create importers and included more detailed error messages if something goes wrong during the import.
  • New Factory Class

    • A new class called 'Factory' has been created. This is responsible for creating appropriate importer objects based on what type of item we're importing. So it's a smart way to keep our import operations flexible and manageable.
  • Constant Class for Mime Types

    • A new class accommodating supported types of import files has been created. It ensures we work with valid file types and helps avoid errors.
  • Defined Type of Importers

    • We have introduced a way to define valid types of importers and a function to obtain these types, making it easier for future command-line operations.
  • Improved Request Validation

    • The rules validating the types of items being imported have been improved. This ensures we only deal with valid items.
  • Upgraded Importer Class

    • Changes were made to the import method making it easier to recognize the header row, improving the efficiency of the import operation.
  • Added Tests

    • New tests were created to make sure our import command works well, which includes a variety of scenarios and checks. This will make it easier for us to catch any potential issues early on.
  • Code Cleanup

    • Some minor changes were made to improve the style of the code and the clarity of the comments.

@snipe snipe changed the title Impprove imports Improve imports Dec 2, 2024
@snipe
Copy link
Owner

snipe commented Dec 19, 2024

Hiya - looks like there's a merge conflict here - can you take a look?

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