mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Fix site build specification defaults
This commit is contained in:
1 parent
8e3a8ba07c
commit
aae23cf5a1
3 files changed
+9
-2
No files matched your search
@@ -56,11 +56,11 @@ class Base extends Action
|
||||
|
||||
// If there is no plan use the highest specification
|
||||
if (empty($plan)) {
|
||||
return end($allowedSpecifications) ?? $fallback;
|
||||
return end($allowedSpecifications) ?: '';
|
||||
}
|
||||
|
||||
// Otherwise, use the lowest specification available in the plan
|
||||
return $allowedSpecifications[0] ?? $fallback;
|
||||
return $allowedSpecifications[0] ?? '';
|
||||
}
|
||||
|
||||
public function redeployVcsFunction(Request $request, Document $function, Document $project, Document $installation, Database $dbForProject, BuildPublisher $publisherForBuilds, Document $template, GitHub $github, bool $activate, array $platform = [], string $referenceType = 'branch', string $reference = ''): Document
|
||||
|
||||
@@ -178,6 +178,11 @@ class Update extends Base
|
||||
$framework = $site->getAttribute('framework');
|
||||
}
|
||||
|
||||
$missingParam = new \stdClass();
|
||||
if ($request->getPayload('buildSpecification', $missingParam) === $missingParam) {
|
||||
$buildSpecification = $site->getAttribute('buildSpecification', APP_COMPUTE_SPECIFICATION_DEFAULT);
|
||||
}
|
||||
|
||||
$repositoryId = $site->getAttribute('repositoryId', '');
|
||||
$repositoryInternalId = $site->getAttribute('repositoryInternalId', '');
|
||||
|
||||
|
||||
@@ -1680,6 +1680,7 @@ final class SitesCustomServerTest extends Scope
|
||||
|
||||
$this->assertEquals(200, $site['headers']['status-code']);
|
||||
$this->assertNotEmpty($site['body']['$id']);
|
||||
$this->assertEquals(Specification::S_2VCPU_2GB, $site['body']['buildSpecification']);
|
||||
$this->assertEquals(Specification::S_1VCPU_1GB, $site['body']['runtimeSpecification']);
|
||||
|
||||
// Change the specs to 1vcpu 512mb
|
||||
@@ -1697,6 +1698,7 @@ final class SitesCustomServerTest extends Scope
|
||||
|
||||
$this->assertEquals(200, $site['headers']['status-code']);
|
||||
$this->assertNotEmpty($site['body']['$id']);
|
||||
$this->assertEquals(Specification::S_2VCPU_2GB, $site['body']['buildSpecification']);
|
||||
$this->assertEquals(Specification::S_1VCPU_512MB, $site['body']['runtimeSpecification']);
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user