From 9b7ab63535c81bcd831370583e3041180db9ae11 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Tue, 7 Apr 2026 13:39:49 +0200 Subject: [PATCH 1/4] Fix #[AdminRoute] attribute error, add smoke tests for admin routes --- src/Trait/ExportCrudControllerTrait.php | 2 + tests/Controller/Admin/AdminSmokeTest.php | 75 +++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 tests/Controller/Admin/AdminSmokeTest.php diff --git a/src/Trait/ExportCrudControllerTrait.php b/src/Trait/ExportCrudControllerTrait.php index d02b687..04fceac 100644 --- a/src/Trait/ExportCrudControllerTrait.php +++ b/src/Trait/ExportCrudControllerTrait.php @@ -5,6 +5,7 @@ namespace App\Trait; use App\Service\Exporter; +use EasyCorp\Bundle\EasyAdminBundle\Attribute\AdminRoute; use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; use EasyCorp\Bundle\EasyAdminBundle\Config\Action; use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; @@ -39,6 +40,7 @@ protected function createExportAction(string|TranslatableMessage|null $label = n ->linkToCrudAction('export'); } + #[AdminRoute] public function export(AdminContext $context): Response { if (!isset($this->exporter)) { diff --git a/tests/Controller/Admin/AdminSmokeTest.php b/tests/Controller/Admin/AdminSmokeTest.php new file mode 100644 index 0000000..c41e253 --- /dev/null +++ b/tests/Controller/Admin/AdminSmokeTest.php @@ -0,0 +1,75 @@ +get('doctrine')->getManager() + ->getRepository(User::class)->findOneBy([]); + $client->loginUser($user); + + $url = static::getContainer()->get(AdminUrlGenerator::class) + ->setController($controllerClass) + ->setAction(Crud::PAGE_INDEX) + ->generateUrl(); + + $client->request('GET', $url); + + $this->assertResponseIsSuccessful(); + } + + /** + * @return iterable + */ + public static function crudControllerProvider(): iterable + { + yield 'Advisory' => [AdvisoryCrudController::class]; + yield 'DetectionResult' => [DetectionResultCrudController::class]; + yield 'DockerImage' => [DockerImageCrudController::class]; + yield 'DockerImageTag' => [DockerImageTagCrudController::class]; + yield 'Domain' => [DomainCrudController::class]; + yield 'GitRepo' => [GitRepoCrudController::class]; + yield 'GitTag' => [GitTagCrudController::class]; + yield 'Installation' => [InstallationCrudController::class]; + yield 'Module' => [ModuleCrudController::class]; + yield 'ModuleVersion' => [ModuleVersionCrudController::class]; + yield 'OIDC' => [OIDCCrudController::class]; + yield 'Package' => [PackageCrudController::class]; + yield 'PackageVersion' => [PackageVersionCrudController::class]; + yield 'Server' => [ServerCrudController::class]; + yield 'ServiceCertificate' => [ServiceCertificateCrudController::class]; + yield 'Site' => [SiteCrudController::class]; + } +} From b616e03e64d7b2227edef48479c6437d66cddb35 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Tue, 7 Apr 2026 13:41:58 +0200 Subject: [PATCH 2/4] Update Changelog --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44658a8..cec30a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.9.2] - 2026-04-07 + +- [#67](https://github.com/itk-dev/devops_itksites/pull/67) + 6654: Fix `#[AdminRoute] attribute error, add smoke tests for admin routes +- ## [1.9.1] - 2026-04-07 - [#66](https://github.com/itk-dev/devops_itksites/pull/66) @@ -145,7 +150,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.0] - 2022-09-15 -[Unreleased]: https://github.com/itk-dev/devops_itksites/compare/1.9.1...HEAD +[Unreleased]: https://github.com/itk-dev/devops_itksites/compare/1.9.2...HEAD +[1.9.2]: https://github.com/itk-dev/devops_itksites/compare/1.9.1...1.9.2 [1.9.1]: https://github.com/itk-dev/devops_itksites/compare/1.9.0...1.9.1 [1.9.0]: https://github.com/itk-dev/devops_itksites/compare/1.8.9...1.9.0 [1.8.10]: https://github.com/itk-dev/devops_itksites/compare/1.8.9...1.8.10 From 2e141c0dfeaa30c71e2180bf74aa223ec874bc13 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Tue, 7 Apr 2026 13:43:15 +0200 Subject: [PATCH 3/4] Markdownlint --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cec30a8..ddd3cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#67](https://github.com/itk-dev/devops_itksites/pull/67) 6654: Fix `#[AdminRoute] attribute error, add smoke tests for admin routes -- +- + ## [1.9.1] - 2026-04-07 - [#66](https://github.com/itk-dev/devops_itksites/pull/66) From 21af0c3347562590a960fe881cc414aff2e7b2a3 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Tue, 7 Apr 2026 13:45:37 +0200 Subject: [PATCH 4/4] Disable webpack strict mode in test env --- config/packages/webpack_encore.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/packages/webpack_encore.yaml b/config/packages/webpack_encore.yaml index cc51912..6583378 100644 --- a/config/packages/webpack_encore.yaml +++ b/config/packages/webpack_encore.yaml @@ -40,6 +40,6 @@ framework: # # Available in version 1.2 # cache: true -#when@test: -# webpack_encore: -# strict_mode: false +when@test: + webpack_encore: + strict_mode: false