Compare commits

...
Author SHA1 Message Date
Khushboo Verma bd5f375593 Merge branch 'main' into feat-improve-vcs-comment 2024-03-19 18:40:08 +05:30
Khushboo Verma 6d018fd621 Update design 2024-03-01 11:36:09 +05:30
Khushboo Verma aafc303428 Add note for deployment activation. 2024-02-29 14:13:56 +05:30
Khushboo Verma f9936d8dcb Fix formatting error 2024-02-28 22:03:47 +05:30
Khushboo Verma 03a87e282c Update VCS Comment 2024-02-28 21:58:16 +05:30
+17 -10
View File
@@ -65,18 +65,23 @@ class Comment
];
}
//TODO: Update link to documentation
$text .= "**Your function has been automatically deployed.** Learn more about Appwrite [Function Deployments](https://appwrite.io/docs/functions).\n\n";
foreach ($projects as $projectId => $project) {
$text .= "**{$project['name']}** `{$projectId}`\n\n";
$text .= "| Function | ID | Status | Action |\n";
$text .= "| :- | :- | :- | :- |\n";
$protocol = App::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
$hostname = App::getEnv('_APP_DOMAIN');
foreach ($project['functions'] as $functionId => $function) {
if ($function['status'] === 'waiting' || $function['status'] === 'processing' || $function['status'] === 'building') {
$text .= "**Your function deployment is in progress. Please check back in a few minutes for the updated status.**\n\n";
} elseif ($function['status'] === 'ready') {
$text .= "**Your function has been successfully deployed.**\n\n";
} else {
$text .= "**Your function deployment has failed. Please check the logs for more details and retry.**\n\n";
}
$text .= "Project name: **{$project['name']}** \nProject ID: `{$projectId}`\n\n";
$text .= "| Function | ID | Status | Action |\n";
$text .= "| :- | :- | :- | :- |\n";
$protocol = App::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
$hostname = App::getEnv('_APP_DOMAIN');
$generateImage = function (string $status) use ($protocol, $hostname) {
$extention = $status === 'building' ? 'gif' : 'png';
$imagesUrl = $protocol . '://' . $hostname . '/images/vcs/';
@@ -104,6 +109,8 @@ class Comment
$text .= "\n\n";
}
$functionUrl = $protocol . '://' . $hostname . '/console/project-' . $projectId . '/functions/function-' . $functionId;
$text .= "Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to [your deployments]($functionUrl). Learn more about Appwrite [Function deployments](https://appwrite.io/docs/functions).\n\n"; //TODO: Update link to documentation
//TODO: Update did you know section
$tip = $this->tips[array_rand($this->tips)];
$text .= "> **💡 Did you know?** \n " . $tip . "\n\n";