mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix startup bugs
This commit is contained in:
@@ -2317,7 +2317,7 @@ $collections = [
|
||||
'filters' => [],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('repoId'),
|
||||
'$id' => ID::custom('vcsRepoId'),
|
||||
'type' => Database::VAR_STRING,
|
||||
'signed' => true,
|
||||
'size' => 2048,
|
||||
|
||||
@@ -38,7 +38,7 @@ App::get('/v1/vcs/github/installations')
|
||||
->action(function (Response $response, Document $project) {
|
||||
$projectId = $project->getId();
|
||||
|
||||
$appName = App::getEnv('VCS_GITHUB_NAME', '');
|
||||
$appName = App::getEnv('VCS_GITHUB_NAME');
|
||||
$response->redirect(`https://github.com/apps/"{$appName}"/installations/new?state={$projectId}`);
|
||||
});
|
||||
|
||||
@@ -121,9 +121,9 @@ App::get('v1/vcs/github/installations/:installationId/repositories')
|
||||
|
||||
$privateKey = App::getEnv('VCS_GITHUB_PRIVATE_KEY');
|
||||
$githubAppId = App::getEnv('VCS_GITHUB_APP_ID');
|
||||
//TODO: Update GitHub Username
|
||||
$githubAppName = App::getEnv('VCS_GITHUB_NAME');
|
||||
$github = new GitHub();
|
||||
$github->initialiseVariables($installationId, $privateKey, $githubAppId, 'vermakhushboo');
|
||||
$github->initialiseVariables($installationId, $privateKey, $githubAppId, $githubAppName);
|
||||
$repos = $github->listRepositoriesForGitHubApp();
|
||||
|
||||
$response->dynamic(new Document([
|
||||
@@ -149,6 +149,7 @@ App::post('/v1/vcs/github/incomingwebhook')
|
||||
$github = new GitHub();
|
||||
$privateKey = App::getEnv('VCS_GITHUB_PRIVATE_KEY');
|
||||
$githubAppId = App::getEnv('VCS_GITHUB_APP_ID');
|
||||
$githubAppName = App::getEnv('VCS_GITHUB_NAME');
|
||||
$parsedPayload = $github->parseWebhookEventPayload($event, $payload);
|
||||
$parsedPayload = json_decode($parsedPayload, true);
|
||||
|
||||
@@ -247,7 +248,7 @@ App::post('/v1/vcs/github/incomingwebhook')
|
||||
$installationId = $parsedPayload["installationId"];
|
||||
$pullRequestNumber = $parsedPayload["pullRequestNumber"];
|
||||
$repositoryName = $parsedPayload["repositoryName"];
|
||||
$github->initialiseVariables($installationId, $privateKey, $githubAppId, 'vermakhushboo');
|
||||
$github->initialiseVariables($installationId, $privateKey, $githubAppId, $githubAppName);
|
||||
|
||||
$vcsRepos = $dbForConsole->find('vcs_repos', [
|
||||
Query::equal('repositoryId', [$repositoryId]),
|
||||
|
||||
@@ -102,9 +102,10 @@ class BuildsV1 extends Worker
|
||||
|
||||
$privateKey = App::getEnv('VCS_GITHUB_PRIVATE_KEY');
|
||||
$githubAppId = App::getEnv('VCS_GITHUB_APP_ID');
|
||||
$githubAppName = App::getEnv('VCS_GITHUB_NAME');
|
||||
|
||||
$github = new GitHub();
|
||||
$github->initialiseVariables($installationId, $privateKey, $githubAppId, 'vermakhushboo'); //TODO: Update GitHub Username
|
||||
$github->initialiseVariables($installationId, $privateKey, $githubAppId, $githubAppName);
|
||||
$branchName = $deployment->getAttribute('branch');
|
||||
$gitCloneCommand = $github->generateGitCloneCommand($repositoryId, $branchName);
|
||||
$stdout = '';
|
||||
|
||||
@@ -809,11 +809,13 @@ class DeletesV1 extends Worker
|
||||
$this->listByGroup('functions', [
|
||||
Query::equal('vcsInstallationInternalId', [$document->getInternalId()])
|
||||
], $dbForProject, function($function) use ($dbForProject) {
|
||||
$dbForProject->deleteDocument('vcs_repos', $function->getAttribute('vcsRepoId'));
|
||||
|
||||
$function = $function
|
||||
->setAttribute('vcsInstallationId', '')
|
||||
->setAttribute('vcsInstallationInternalId', '')
|
||||
->setAttribute('repoId', '')
|
||||
->setAttribute('repoInternalId', '');
|
||||
->setAttribute('vcsRepoId', '')
|
||||
->setAttribute('vcsRepoInternalId', '');
|
||||
$dbForProject->updateDocument('functions', $function->getId(), $function);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user