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
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
Comment #2
divyansh.gupta commentedWorking on it.
Comment #4
divyansh.gupta commentedI have added the option to import using drush command.
Please review.
Comment #6
rajeshreeputraUpdated MR, requesting review.
Comment #7
rajeshreeputraI would like to propose a discussion regarding the implementation of the commands
acquiadam:queue-assetsandacquiadam: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=500This 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!
Comment #8
ankitv18 commentedProvided few suggestion on the MR and also test case is missing for this new drush command.
Comment #9
rajeshreeputraHello @ankitv18 -
test coverage will be added once the discussion from #7 gets resolved.Updates: Added test coverage for the Drush command.
Comment #10
rajeshreeputraComment #12
japerryUpdated 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.
Comment #13
japerryThank you rajeshreeputra for fixing the tests! Looks good, committed.
Comment #16
divyansh.gupta commentedHi,
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!
Comment #18
rajeshreeputraMissed to remove queueAssets() method removal from processQueue(). Requesting review.
Comment #20
japerry@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.
Comment #21
japerry