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

[LOPS-2314] Adds retry option to Drush and WP-CLI commands #2588

Merged
merged 12 commits into from
May 31, 2024

Conversation

alynnferry
Copy link
Contributor

@alynnferry alynnferry commented May 23, 2024

Description:

  • Adds retry option to Drush and WP-CLI commands.
  • Customer specifies number of retries.
  • Retry logic aborts if it encounters a permanent failure.
Screen.Recording.2024-05-29.at.10.58.38.AM.mov

CCB Ticket

Amanda Ferry added 7 commits May 23, 2024 11:19
@alynnferry alynnferry requested review from kporras07 and a team May 28, 2024 16:57
@alynnferry alynnferry marked this pull request as ready for review May 28, 2024 17:01
@alynnferry alynnferry requested a review from a team as a code owner May 28, 2024 17:01
@alynnferry alynnferry self-assigned this May 28, 2024
Copy link
Contributor

@kporras07 kporras07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, a couple comments/questions here and there :)

Amanda Ferry added 2 commits May 28, 2024 14:14
@alynnferry alynnferry requested a review from kporras07 May 28, 2024 18:25
{
$this->prepareEnvironment($site_env);
$this->setProgressAllowed($options['progress']);
return $this->executeCommand($wp_command);
$retries = isset($options['retry']) ? (int)$options['retry'] : 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that ?: is available in php 7.4. If so, this could just be (int)$options['retry'] ?: 0;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminus uses this operator elsewhere.

Copy link
Contributor Author

@alynnferry alynnferry May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want (int)$options['retry'] ?: 0; or (int)($options['retry'] ?? 0);?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first looks clearer to me, but both should behave the same. You may use the later if you prefer it.

@alynnferry alynnferry merged commit c23ba26 into 3.x May 31, 2024
6 checks passed
@alynnferry alynnferry deleted the LOPS-2314-add-retry branch May 31, 2024 20:56
@alynnferry alynnferry mentioned this pull request Jun 6, 2024
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.

None yet

5 participants