Description

This is a feature request to implement a custom Drush command that replicates the existing bulk import functionality currently available through the UI. The addition of this command would enable developers to perform bulk imports directly from the command line.

Problem/Motivation

Current import functionality is limited to the UI, requiring manual intervention each time data needs to be imported.
For large datasets, the UI-based import process is slower, prone to timeouts, and lacks proper error recovery.

Proposed Solution

Create a custom Drush command

Issue fork acquia_dam-3523850

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vipin.mittal18 created an issue. See original summary.

divyansh.gupta’s picture

Assigned: Unassigned » divyansh.gupta

Working on it.

divyansh.gupta’s picture

Assigned: divyansh.gupta » Unassigned
Status: Active » Needs review

I have added the option to import using drush command.
Please review.

rajeshreeputra made their first commit to this issue’s fork.

rajeshreeputra’s picture

Updated MR, requesting review.

rajeshreeputra’s picture

I would like to propose a discussion regarding the implementation of the commands acquiadam:queue-assets and acquiadam:import-assets. Specifically, we need to consider whether these should be implemented as two separate commands or combined into a single command that handles both queuing and processing of assets.

Additionally, I suggest we introduce an option to limit the asset import process. For instance, we could allow users to specify a limit on the number of assets imported from the queue. An example:
./vendor/bin/drush acquiadam:import-assets --batch-size=50 --item-limit=500

This command would process 10 batches to import a total of 500 assets and then stop, even if there are remaining items in the queue. I believe this feature would enhance the flexibility and usability of the asset import process, especially for users dealing with large datasets.

Looking forward to your thoughts on this!

ankitv18’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Provided few suggestion on the MR and also test case is missing for this new drush command.

rajeshreeputra’s picture

Hello @ankitv18 - test coverage will be added once the discussion from #7 gets resolved.

Updates: Added test coverage for the Drush command.

rajeshreeputra’s picture

Status: Needs work » Needs review

japerry made their first commit to this issue’s fork.

japerry’s picture

Updated the code to modern standards (while still supporting our supported versions of Drupal), as well as make it consistent with the other Drush Commands in DAM.

japerry’s picture

Status: Needs review » Fixed

Thank you rajeshreeputra for fixing the tests! Looks good, committed.

  • japerry committed a920af04 on 1.1.x
    Followup for issue #3523850 by vishal.khode: Add attributes as CLI for...
divyansh.gupta’s picture

Hi,
Just wanted to mention that I had started the initial work on this issue. Getting credit on issues like this really helps motivate contributors like me to stay involved and keep contributing. I’d appreciate it if that could be reflected here.
Thanks, and looking forward to continuing to collaborate!

rajeshreeputra’s picture

Status: Fixed » Needs review

Missed to remove queueAssets() method removal from processQueue(). Requesting review.

japerry’s picture

@divyansh.gupta -- credits are given to those who contribute substantially to an issue. If you compare your commit (or mine) to what work was done, it did not rise sufficiently in this case to get credit.

@rajeshreeputra -- Ugh thats unfortunate. Fixed, but will need to go into the next version.

japerry’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.