Merge pull request #6868 from coollabsio/handle-pr-process-statuses
Handle all ProcessStatus values in PR updates
This commit is contained in:
commit
2aef2c383c
1 changed files with 10 additions and 9 deletions
|
|
@ -39,16 +39,17 @@ public function handle()
|
||||||
$this->delete_comment();
|
$this->delete_comment();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} elseif ($this->status === ProcessStatus::IN_PROGRESS) {
|
|
||||||
$this->body = "The preview deployment is in progress. 🟡\n\n";
|
|
||||||
} elseif ($this->status === ProcessStatus::FINISHED) {
|
|
||||||
$this->body = "The preview deployment is ready. 🟢\n\n";
|
|
||||||
if ($this->preview->fqdn) {
|
|
||||||
$this->body .= "[Open Preview]({$this->preview->fqdn}) | ";
|
|
||||||
}
|
|
||||||
} elseif ($this->status === ProcessStatus::ERROR) {
|
|
||||||
$this->body = "The preview deployment failed. 🔴\n\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
match ($this->status) {
|
||||||
|
ProcessStatus::QUEUED => $this->body = "The preview deployment is queued. ⏳\n\n",
|
||||||
|
ProcessStatus::IN_PROGRESS => $this->body = "The preview deployment is in progress. 🟡\n\n",
|
||||||
|
ProcessStatus::FINISHED => $this->body = "The preview deployment is ready. 🟢\n\n".($this->preview->fqdn ? "[Open Preview]({$this->preview->fqdn}) | " : ''),
|
||||||
|
ProcessStatus::ERROR => $this->body = "The preview deployment failed. 🔴\n\n",
|
||||||
|
ProcessStatus::KILLED => $this->body = "The preview deployment was killed. ⚫\n\n",
|
||||||
|
ProcessStatus::CANCELLED => $this->body = "The preview deployment was cancelled. 🚫\n\n",
|
||||||
|
ProcessStatus::CLOSED => '', // Already handled above, but included for completeness
|
||||||
|
};
|
||||||
$this->build_logs_url = base_url()."/project/{$this->application->environment->project->uuid}/environment/{$this->application->environment->uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
|
$this->build_logs_url = base_url()."/project/{$this->application->environment->project->uuid}/environment/{$this->application->environment->uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
|
||||||
|
|
||||||
$this->body .= '[Open Build Logs]('.$this->build_logs_url.")\n\n\n";
|
$this->body .= '[Open Build Logs]('.$this->build_logs_url.")\n\n\n";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue