Closed danepowell closed 1 year ago
@danepowell thanks for picking this up! This does exactly what I'm looking for and will eliminate a lot of complexity in my CI processes (:
I think there is just one small issue to address -- if I give task-wait
an input that is not a valid UUID or notification URL there will be a PHP fatal error in most cases because the code will get all the way to the URL check where it checks for $urlParts[5]
without ensuring that array index exists. So we get:
PHP Warning: Undefined array key 5 in phar:///src/Command/CommandBase.php on line 1068
PHP Fatal error: Uncaught TypeError: Acquia\Cli\Command\CommandBase::validateUuid(): Argument #1 ($uuid) must be of type string, null given, called in phar:///src/Command/CommandBase.php on line 1069 and defined in phar:///src/Command/CommandBase.php:726
If that can be avoided it will just end up at the generic "Notification format is not one of UUID, JSON response, or URL" which seems fine.
Patch coverage: 100.00
% and project coverage change: +0.02
:tada:
Comparison is base (
17d93cd
) 91.75% compared to head (db131f9
) 91.77%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Thanks for the feedback! I fixed that and a few other bugs. Feel free to hammer on the new version, otherwise I'll merge this after getting coverage up.
Motivation
Fixes #1558
Proposed changes
Anywhere that a notification UUID is required as argument, support passing a notification object or URL as well. This basically generalizes the
getNotificationUuid
logic in app:task-wait to all commands.Testing steps
./bin/acli ckc
acli app:task-wait
with various forms of arguments to ensure they still work:@cdubz could you please help test and let me know if it satisfies your request? If you follow the steps above, you can find a pre-built version of CLI for this PR to test with, or you can build it yourself.