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

Move slack notification into the blt command #1464

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

pookmish
Copy link
Member

READY FOR REVIEW

Summary

[briefly summarize the changes here]

Need Review By (Date)

['10/30', 'asap', etc.]

Urgency

['low', 'medium', 'high', etc.]

Steps to Test

  1. [First testing step]
  2. ...

PR Checklist

if ($failed) {
$this->yell(sprintf("Update failed for the following sites:\n%s", implode("\n", $failed)), 100, 'red');

if (EnvironmentDetector::isAhStageEnv() || EnvironmentDetector::isAhProdEnv()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason you're using these instead of $target_env?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not at all. I didn't really think about it. lol

if ($failed) {
$this->yell(sprintf("Update failed for the following sites:\n%s", implode("\n", $failed)), 100, 'red');

if (EnvironmentDetector::isAhStageEnv() || EnvironmentDetector::isAhProdEnv()) {
$this->sendSlackNotification("A new deployment has been made to *$target_env* using *$deployed_tag*. At least one site failed updating.");
Copy link
Contributor

@joegl joegl Feb 22, 2024

Choose a reason for hiding this comment

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

Why not include the failed sites? Would the message be too long if too many sites failed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I was kinda on the fence about it. I figured it might be less noise in Slack. Maybe we can use the number of sites that failed? then it's still short message

Copy link
Contributor

Choose a reason for hiding this comment

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

Ooh I like that idea. A count would be useful without creating too much noise.

$sites = $this->getConfigValue('multisites');
$parallel_executions = 10;
$parallel_executions = (int) getenv(self::UPDATE_PARALLEL_PROCESSES) ?: 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't 100% understand the need to create the UPDATE_PARALLEL_PROCESSES constant here to call out the name of the environment variable.

Copy link
Member Author

@pookmish pookmish Feb 22, 2024

Choose a reason for hiding this comment

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

* waves hand over it *
To make it look more fancy.

Copy link
Contributor

Choose a reason for hiding this comment

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

fancy-cat

Copy link
Contributor

@joegl joegl left a comment

Choose a reason for hiding this comment

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

LGTM

@pookmish pookmish merged commit b797a6b into 10.1.4-release Feb 22, 2024
0 of 3 checks passed
@pookmish pookmish deleted the code-deploy-slack branch February 22, 2024 16:36
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.

2 participants