1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

QA bug fixes

This commit is contained in:
Matej Baco 2022-11-15 19:43:40 +01:00
parent 44a82de09b
commit 6bf370a058
4 changed files with 7 additions and 8 deletions

View file

@ -1157,8 +1157,7 @@ App::post('/v1/functions/:functionId/executions')
->setData($data)
->setJWT($jwt)
->setProject($project)
->setUser($user)
->trigger();
->setUser($user);
return $response
->setStatusCode(Response::STATUS_CODE_ACCEPTED)

View file

@ -33,7 +33,7 @@ Server::setResource('dbForConsole', function (Cache $cache, Registry $register)
}, ['cache', 'register']);
Server::setResource('dbForProject', function (Cache $cache, Registry $register, Message $message, Database $dbForConsole) {
$args = $message->getPayload()['value'] ?? [];
$args = $message->getPayload() ?? [];
$project = new Document($args['project'] ?? []);
if ($project->isEmpty() || $project->getId() === 'console') {

View file

@ -106,11 +106,11 @@ class BuildsV1 extends Worker
$build->setAttribute('status', 'building');
$build = $dbForProject->updateDocument('builds', $buildId, $build);
$data = $deployment->getArrayCopy(array_keys($deploymentModel->getRules()));
/** Trigger Webhook */
$deploymentModel = new Deployment();
$data = $deployment->getArrayCopy(array_keys($deploymentModel->getRules()));
$deploymentUpdate = new Event(Event::WEBHOOK_QUEUE_NAME, Event::WEBHOOK_CLASS_NAME);
$deploymentUpdate
->setProject($project)

View file

@ -43,11 +43,11 @@ $execute = function (
?Document $user = null,
string $jwt = null
) use ($executor, $register) {
$user ??= new Document();
$functionId = $function->getId();
$deploymentId = $function->getAttribute('deployment', '');
/** Check if deployment exists */
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
@ -209,7 +209,7 @@ $execute = function (
/** Trigger Functions */
$functions
->setData($data)
->setData($data ?? '')
->setProject($project)
->setUser($user)
->setEvent('functions.[functionId].executions.[executionId].update')
@ -333,7 +333,7 @@ $server->job()
$data = $args['data'] ?? '';
$execution = new Document($args['execution'] ?? []);
$user = new Document($args['user'] ?? []);
$function = $dbForProject->getDocument('functions', $execution->getAttribute('functionId'));
// $function = $dbForProject->getDocument('functions', $execution->getAttribute('functionId'));
call_user_func($execute, $project, $function, $dbForProject, $functions, 'http', $execution->getId(), null, null, $data, $user, $jwt);
break;
case 'schedule':