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

Add notification for deployment completion #445

Merged
merged 9 commits into from
Jan 29, 2025

Conversation

pierluigi
Copy link
Contributor

@pierluigi pierluigi commented Jan 28, 2025

Add notification for deployment completion status.

  • Create DeploymentCompleted notification class in app/Notifications/DeploymentCompleted.php to handle deployment completion notifications.
  • Update app/Actions/Site/Deploy.php to send DeploymentCompleted notification using Notifier when a deployment completes or fails.
  • Import Notifier and DeploymentCompleted classes in app/Actions/Site/Deploy.php.

For more details, open the Copilot Workspace session.

pierluigi and others added 2 commits January 28, 2025 09:08
Add notification for deployment completion status.

* Create `DeploymentCompleted` notification class in `app/Notifications/DeploymentCompleted.php` to handle deployment completion notifications.
* Update `app/Actions/Site/Deploy.php` to send `DeploymentCompleted` notification using `Notifier` when a deployment completes or fails.
* Import `Notifier` and `DeploymentCompleted` classes in `app/Actions/Site/Deploy.php`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/vitodeploy/vito?shareId=XXXX-XXXX-XXXX-XXXX).
@saeedvaziry
Copy link
Member

saeedvaziry commented Jan 28, 2025

Looking good!

Can you please write a test for it?

@pierluigi
Copy link
Contributor Author

$ php artisan test --filter DeploymentCompleted    

   PASS  Tests\Unit\Notifications\DeploymentCompletedTest
  ✓ raw text                                                                                              0.17s  
  ✓ to email                                                                                              0.05s  
  ✓ to slack                                                                                              0.04s  
  ✓ to discord                                                                                            0.04s  
  ✓ to telegram                                                                                           0.04s  

  Tests:    5 passed (7 assertions)
  Duration: 0.43s
  

@saeedvaziry
Copy link
Member

I will add one more test to cover it E2E. ideally on the deploy test, I would expect the notification has been sent

public function test_deploy(): void

@saeedvaziry
Copy link
Member

Added the test. also deleted the DeploymentCompletedTest as it was testing the framework itself.

@saeedvaziry saeedvaziry merged commit d702b95 into vitodeploy:2.x Jan 29, 2025
2 checks passed
@pierluigi pierluigi deleted the add-deployment-notification branch January 30, 2025 01:38
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