diff --git a/app/config/vcs.php b/app/config/vcs.php index 4264d6c0d9..f456f80d96 100644 --- a/app/config/vcs.php +++ b/app/config/vcs.php @@ -9,7 +9,6 @@ use Utopia\VCS\Adapter\Git\GitHub; return [ 'github' => [ - 'enabled' => true, 'adapter' => GitHub::class, 'envVariables' => [ 'APP_NAME' => '_APP_VCS_GITHUB_APP_NAME', @@ -22,7 +21,6 @@ return [ 'requiredEnvVariables' => ['APP_NAME', 'PRIVATE_KEY', 'APP_ID', 'CLIENT_ID', 'CLIENT_SECRET'], ], 'gitea' => [ - 'enabled' => true, 'adapter' => Gitea::class, 'envVariables' => [ 'ENDPOINT' => '_APP_VCS_GITEA_ENDPOINT', diff --git a/src/Appwrite/Vcs/Factory.php b/src/Appwrite/Vcs/Factory.php index 4d8037e035..58a5e06c13 100644 --- a/src/Appwrite/Vcs/Factory.php +++ b/src/Appwrite/Vcs/Factory.php @@ -23,15 +23,7 @@ class Factory protected Cache $cache, ?array $registry = null, ) { - $registry ??= Config::getParam('vcs', []); - - foreach ($registry as $key => $entry) { - if (!($entry['enabled'] ?? false)) { - continue; - } - - $this->registry[$key] = $entry; - } + $this->registry = $registry ?? Config::getParam('vcs', []); } public function getProviders(): array diff --git a/tests/unit/Vcs/FactoryTest.php b/tests/unit/Vcs/FactoryTest.php index 9d2d367922..ec38c4149e 100644 --- a/tests/unit/Vcs/FactoryTest.php +++ b/tests/unit/Vcs/FactoryTest.php @@ -35,17 +35,6 @@ final class FactoryTest extends TestCase } } - public function testDisabledProvidersAreNotRegistered(): void - { - $factory = new Factory($this->cache(), [ - 'github' => $this->githubEntry(), - 'legacy' => ['enabled' => false] + $this->githubEntry(), - ]); - - $this->expectException(Exception::class); - $factory->fromProvider('legacy'); - } - public function testFromProviderUnknownThrows(): void { $factory = new Factory($this->cache(), ['github' => $this->githubEntry()]); @@ -84,7 +73,6 @@ final class FactoryTest extends TestCase public function testIsConfigured(): void { $entry = [ - 'enabled' => true, 'adapter' => GitHub::class, 'envVariables' => ['TOKEN' => '_APP_VCS_TEST_TOKEN'], 'requiredEnvVariables' => ['TOKEN'], @@ -122,7 +110,6 @@ final class FactoryTest extends TestCase protected function githubEntry(): array { return [ - 'enabled' => true, 'adapter' => GitHub::class, 'envVariables' => [ 'APP_NAME' => '_APP_VCS_GITHUB_APP_NAME',