diff --git a/app/database/Migrations/20240728.115465_1_1_default_create_default_project.php b/app/database/Migrations/20240728.115465_1_1_default_create_default_project.php index bffe33a..3f1fb2a 100644 --- a/app/database/Migrations/20240728.115465_1_1_default_create_default_project.php +++ b/app/database/Migrations/20240728.115465_1_1_default_create_default_project.php @@ -17,6 +17,13 @@ class OrmDefaultD93e77c9f5556975e93bfbc969442732 extends Migration public function up(): void { + $defaultProject = $this->getRepository()->findOne(['key' => Project::DEFAULT_KEY]); + + // Ignore if default project already exists + if ($defaultProject !== null) { + return; + } + $this->getEntityManager() ->persist(new Project(Key::create(Project::DEFAULT_KEY), 'Default project')) ->run(); @@ -25,6 +32,7 @@ public function up(): void public function down(): void { $defaultProject = $this->getRepository()->findOne(['key' => Project::DEFAULT_KEY]); + // Delete default project if exists if ($defaultProject !== null) { $this->getEntityManager()->delete($defaultProject)->run(); } diff --git a/app/modules/Projects/Application/YamlFileProjectLocator.php b/app/modules/Projects/Application/YamlFileProjectLocator.php index e4da3b8..266c3fb 100644 --- a/app/modules/Projects/Application/YamlFileProjectLocator.php +++ b/app/modules/Projects/Application/YamlFileProjectLocator.php @@ -22,7 +22,7 @@ public function __construct( public function findAll(): iterable { - $this->finder->files()->in($this->directory)->name('*.project.yaml'); + $this->finder->files()->in($this->directory)->name(['*.project.yaml', '*.project.yml']); foreach ($this->finder as $file) { try { diff --git a/app/modules/Webhooks/Application/WebhooksBootloader.php b/app/modules/Webhooks/Application/WebhooksBootloader.php index 3ee6411..59bad5b 100644 --- a/app/modules/Webhooks/Application/WebhooksBootloader.php +++ b/app/modules/Webhooks/Application/WebhooksBootloader.php @@ -78,12 +78,14 @@ public function defineSingletons(): array finder: \Symfony\Component\Finder\Finder::create() ->files() ->in($dirs->get('runtime') . '/configs') - ->name('*.webhook.yaml'), + ->name(['*.webhook.yaml', '*.webhook.yml']), ), ], ), - WebhookLocatorInterface::class => static fn(YamlFileWebhookLocator $locator): WebhookLocatorInterface => new CompositeWebhookLocator([ + WebhookLocatorInterface::class => static fn( + YamlFileWebhookLocator $locator, + ): WebhookLocatorInterface => new CompositeWebhookLocator([ $locator, ]),