3396206: Alter AMA Drush commands to run as UID 1 admin.
Closes #3396206
Merge request reports
Activity
added 1 commit
- 0ac94337 - 3396206: Alter AMA Drush commands to run as UID 1 admin.
1 1 <?php 2 2 3 3 declare(strict_types=1); 4 This causes aphpcs
violation and hence causes the CI pipeline to regress: https://git.drupalcode.org/issue/acquia_migrate-3396206/-/jobs/835222
34 33 use Symfony\Component\Console\Output\ConsoleSectionOutput; 35 34 use Symfony\Component\Console\Output\OutputInterface; 36 35 use Symfony\Component\Console\Terminal; 36 use Consolidation\AnnotatedCommand\CommandData; 37 use Drupal\Core\Session\AccountSwitcherInterface; 38 use Drupal\Core\Session\UserSession; - Comment on lines 35 to +38
This causes aphpcs
violation and hence causes the CI pipeline to regress: https://git.drupalcode.org/issue/acquia_migrate-3396206/-/jobs/835222 changed this line in version 3 of the diff
- Resolved by Bryan Jiencke
- Resolved by Bryan Jiencke
1770 $this->accountSwitcher->switchBack(); 1771 } 1772 1773 } 1774 1775 /** 1776 * Determines if a command is an AMA command. 1777 * 1778 * @param \Consolidation\AnnotatedCommand\CommandData $command_data 1779 * The command to check. 1780 * 1781 * @return bool 1782 * Whether or not this command is an AMA command. 1783 */ 1784 public function isAmaCommand(CommandData $command_data) { 1785 return $command_data->annotationData()->get('validate-module-enabled') === 'acquia_migrate'; changed this line in version 3 of the diff
added 1 commit
- 8962c3a6 - 3396206: Adjust for coding standards and logic to determine AMA command.
added 1 commit
- 41bcba35 - Awesome! GitLab can apply suggestions this simply now.
1771 $this->accountSwitcher->switchBack(); 1772 } 1773 1774 } 1775 1776 /** 1777 * Determines if a command is an AMA command. 1778 * 1779 * @param \Consolidation\AnnotatedCommand\CommandData $command_data 1780 * The command to check. 1781 * 1782 * @return bool 1783 * Whether or not this command is an AMA command. 1784 */ 1785 public function isAmaCommand(CommandData $command_data) { 1786 return ($command_data->annotationData()->get('_classname') === AcquiaMigrateCommands::class); @wimleers annotated data does have command name, so we could check "if command name starts with 'ama:'", but it also has class name that can do an exact match. Let me know which you advise.
I'm hoping to apply this to all commands in AMA to avoid any traps later, but we could also just explicitly list command names.
Edited by Bryan Jienckechanged this line in version 7 of the diff
added 1 commit
- bc3e4bd7 - 3396206: Pull recommendations branch from upstream instead of origin undo.
added 13 commits
- 37aed84f...8962c3a6 - 3 earlier commits
- 41bcba35 - Awesome! GitLab can apply suggestions this simply now.
- 86b65fe4 - 3396206: Pull recommendations branch from upstream instead of origin.
- ec88c9dc - Merge branch '3396206-ama-drush-command-as-admin' of...
- bc3e4bd7 - 3396206: Pull recommendations branch from upstream instead of origin undo.
- b616c4d6 - 3396206: Check if build passes clean.
- 5905d06e - 3396206: Check if build passes clean undo.
- 1882371a - 3396206: Check if build passes clean undo.
- 1b8b6e9b - 3396206: Check if build passes clean.
- cac44d89 - 3396206: Check if build passes clean.
- d2fb94a1 - Project setup.
Toggle commit list