Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7e5ff0b
5564: Update composer dependencies
turegjorup Oct 14, 2025
aa24a1a
5564: Update to phpunit 12
turegjorup Oct 14, 2025
e83bf18
5564: Update itk docker template, update github actions setup
turegjorup Oct 14, 2025
060d7e4
5564: Update Changelog
turegjorup Oct 14, 2025
a647b3d
5564: Update exported api spec
turegjorup Oct 14, 2025
5efc33a
5564: Lock api-platform to 4.1, bump composer dependencies
turegjorup Oct 14, 2025
338ccab
5564: PHP code style fixes
turegjorup Oct 14, 2025
0d207f9
5564: Add vincentlanglet/twig-cs-fixer
turegjorup Oct 14, 2025
16211ac
5564: Lint twig files
turegjorup Oct 14, 2025
ac2a23a
5564: Use assets mapper for CSS
turegjorup Oct 14, 2025
193ade3
5564: Lint yml files
turegjorup Oct 14, 2025
32b6143
5564: Add api spec to prettier ignore
turegjorup Oct 14, 2025
f1548aa
5564: Composer normalize
turegjorup Oct 14, 2025
918deec
5564: JS lint
turegjorup Oct 14, 2025
69528dc
5564: Markdown lint
turegjorup Oct 14, 2025
ad0a2f4
5564: CSS lint
turegjorup Oct 14, 2025
180faff
5564: Remove redundant psalm config
turegjorup Oct 17, 2025
e2a30c7
5564: Add Taskfile
turegjorup Oct 17, 2025
b3dece7
5564: Move commands crom composer.json to taskfile, cleanup actions
turegjorup Oct 17, 2025
129ac60
5564: Fix yaml indentation
turegjorup Oct 17, 2025
23daf7a
5564: Update checkout action
turegjorup Oct 17, 2025
fe4eb24
5564: Update test action to report code coverage
turegjorup Oct 17, 2025
a1c752a
5564: Fix PR review action
turegjorup Oct 17, 2025
0f57193
5564: Fix PR fixtures action
turegjorup Oct 17, 2025
39bc3f7
5564: Lint yml files
turegjorup Oct 17, 2025
9b278ff
5566: Add project entity and Leantime sync
turegjorup Oct 21, 2025
06ca1c5
5566: Add project crud controller, use 'disable' for actions, UI tweaks
turegjorup Oct 22, 2025
3cb35dc
5566: Add security contract entity and controller, refactor crud cont…
turegjorup Oct 23, 2025
e11493e
5566: Normalize composer.json
turegjorup Oct 23, 2025
c72a916
5566: Code style and static analysis cleanup
turegjorup Oct 23, 2025
a884b26
5566: Add CSS linting to taskfile, lint CSS files
turegjorup Oct 23, 2025
027eeac
Merge branch 'main' into feature/5566_maintenance_contract-
martinyde May 18, 2026
01cf02e
Added composer lock and fixed dependency issues
martinyde May 18, 2026
ba9c112
Added menu link
martinyde May 18, 2026
514260b
Removed deprecated leantime service, and project entity
martinyde May 19, 2026
c023288
Merge branch 'main' into hotfix/5566_maintenance_contract-merge-from-…
martinyde May 19, 2026
564b179
Merge branch 'hotfix/5566_maintenance_contract-merge-from-main' into …
martinyde May 19, 2026
4368891
Updated changelog
martinyde May 19, 2026
22a53c8
Applied coding standards
martinyde May 19, 2026
81923af
Updated test suite github action
martinyde May 19, 2026
1e3d94f
Updated PR.yml
martinyde May 19, 2026
7293af4
Updated PR
martinyde May 19, 2026
369f78d
Updated composer.lock
martinyde May 19, 2026
aa32aaa
Normalized composer
martinyde May 19, 2026
904b759
Modified changelog
martinyde May 19, 2026
f6db753
chore: scope PR down to maintenance contract feature
turegjorup May 20, 2026
08c2443
chore: drop phpstan-ignore on AutoBadge files, require ignore comments
turegjorup May 20, 2026
7c773f2
docs: add class-level docblocks to AutoBadge menu helpers
turegjorup May 20, 2026
1403daf
fix: restore Encore-based asset wiring, drop stranded AssetMapper calls
turegjorup May 20, 2026
e16aaea
chore: drop scratch detail.html.twig override
turegjorup May 20, 2026
263f31f
Merged migrations into a new single migration with just secority cont…
martinyde May 20, 2026
4985f7b
Merge branch 'develop' into feature/5566_maintenance_contract-by-martin
martinyde May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ VAULT_SECRET_ID="CHANGE_ME_IN_LOCAL_ENV"

# The number of old results for each server/result-type combination
APP_KEEP_RESULTS=5

###> economics ###
APP_ECONOMICS_URI=https://economics.itkdev.dk
APP_ECONOMICS_API_KEY=changeme
###< economics ###
64 changes: 64 additions & 0 deletions .github/workflows/doctrine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Doctrine

env:
COMPOSE_USER: root

on:
pull_request:
push:
branches:
- main
- develop

jobs:
validate-doctrine-schema:
name: Validate Doctrine Schema
runs-on: ubuntu-latest
env:
APP_ENV: prod

steps:
- uses: actions/checkout@v6

- name: Create docker network
run: |
docker network create frontend

- name: Run Composer Install
run: |
docker compose run --rm phpfpm composer install

- name: Run Doctrine Migrations
run: |
docker compose run --rm phpfpm bin/console doctrine:migrations:migrate --no-interaction

- name: Setup messenger "failed" doctrine transport to ensure db schema is updated
run: |
docker compose run --rm phpfpm bin/console messenger:setup-transports failed

- name: Validate Doctrine schema
run: |
docker compose run --rm phpfpm bin/console doctrine:schema:validate

load-fixtures:
name: Load Doctrine fixtures
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Create docker network
run: |
docker network create frontend

- name: Run Composer Install
run: |
docker compose run --rm phpfpm composer install --no-interaction

- name: Run Doctrine Migrations
run: |
docker compose run --rm phpfpm bin/console doctrine:migrations:migrate --no-interaction

- name: Load fixtures
run: |
docker compose run --rm phpfpm composer fixtures
35 changes: 0 additions & 35 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,6 @@ name: Review
env:
COMPOSE_USER: runner
jobs:
validate-doctrine-schema:
runs-on: ubuntu-latest
name: Validate Doctrine Schema
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Create docker network
run: docker network create frontend

- name: Install and validate
run: |
docker compose up --detach
docker compose exec phpfpm composer install --no-interaction
docker compose exec phpfpm bin/console doctrine:migrations:migrate --no-interaction
docker compose exec phpfpm bin/console messenger:setup-transports failed
docker compose exec phpfpm bin/console doctrine:schema:validate

phpstan:
runs-on: ubuntu-latest
name: PHPStan
Expand Down Expand Up @@ -63,23 +45,6 @@ jobs:
fail_ci_if_error: true
flags: unittests

fixtures:
runs-on: ubuntu-latest
name: Load fixtures
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Create docker network
run: docker network create frontend

- name: Load fixtures
run: |
docker compose up --detach
docker compose exec phpfpm composer install --no-interaction
docker compose exec phpfpm bin/console doctrine:migrations:migrate --no-interaction
docker compose exec phpfpm composer fixtures

build-assets:
runs-on: ubuntu-latest
name: Build assets
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- [#80](https://github.com/itk-dev/devops_itksites/pull/80) 5566: Service agreements
- Add security contract entity with crud controller
- Add Abstract full crud controller and extend on it in some cases
- Add economics service and sync action/command for service agreement synchronization
- [#81](https://github.com/itk-dev/devops_itksites/pull/81) 5564: Asset Mapper migration
- Add Symfony Asset Mapper bundle and importmap

Expand Down
8 changes: 8 additions & 0 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ framework:
#esi: true
#fragments: true

http_client:
scoped_clients:
economics.client:
base_uri: '%env(APP_ECONOMICS_URI)%'
scope: '%env(APP_ECONOMICS_URI)%'
headers:
x-api-key: '%env(APP_ECONOMICS_API_KEY)%'

when@test:
framework:
test: true
Expand Down
31 changes: 31 additions & 0 deletions migrations/Version20260520101548.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260520101548 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE security_contract (id BINARY(16) NOT NULL, created_at DATETIME NOT NULL, modified_at DATETIME NOT NULL, created_by VARCHAR(255) DEFAULT \'\' NOT NULL, modified_by VARCHAR(255) DEFAULT \'\' NOT NULL, economics_id INT NOT NULL, project_name VARCHAR(255) NOT NULL, client_name VARCHAR(255) DEFAULT NULL, hosting_provider VARCHAR(255) DEFAULT NULL, document_url VARCHAR(255) DEFAULT NULL, monthly_price DOUBLE PRECISION DEFAULT NULL, valid_from DATE DEFAULT NULL, valid_to DATE DEFAULT NULL, active TINYINT NOT NULL, eol TINYINT NOT NULL, leantime_url VARCHAR(255) DEFAULT NULL, client_contact_name VARCHAR(255) DEFAULT NULL, client_contact_email VARCHAR(255) DEFAULT NULL, dedicated_server TINYINT NOT NULL, server_size VARCHAR(255) DEFAULT NULL, git_repos LONGTEXT DEFAULT NULL, system_owner_notices JSON DEFAULT NULL, project_tracker_key VARCHAR(255) DEFAULT NULL, quarterly_hours DOUBLE PRECISION DEFAULT NULL, cybersecurity_price DOUBLE PRECISION DEFAULT NULL, cybersecurity_note LONGTEXT DEFAULT NULL, UNIQUE INDEX UNIQ_8AE4AF8B4416F7E8 (economics_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci`');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE security_contract');
}
}
3 changes: 3 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
parameters:
level: 6
# Require a reason on every @phpstan-ignore so the next reader knows
# why a check was suppressed. https://phpstan.org/user-guide/ignoring-errors#requiring-comments-for-@phpstan-ignore
reportIgnoresWithoutComments: true
paths:
- bin/
- config/
Expand Down
40 changes: 40 additions & 0 deletions src/Command/SyncServiceAgreementsCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace App\Command;

use App\Service\ServiceAgreementSyncService;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

#[AsCommand(
name: 'app:economics:sync-agreements',
description: 'Sync service agreements from Economics',
)]
class SyncServiceAgreementsCommand extends Command
{
public function __construct(
private readonly ServiceAgreementSyncService $syncService,
) {
parent::__construct();
}

protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

try {
$count = $this->syncService->syncAll();

$io->success(sprintf('Synced %d service agreements successfully.', $count));
} catch (\Throwable $e) {
$io->error($e->getMessage());

return Command::FAILURE;
}

return Command::SUCCESS;
}
}
65 changes: 65 additions & 0 deletions src/Controller/Admin/AbstractFullCrudController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace App\Controller\Admin;

use App\Trait\ExportCrudControllerTrait;
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Config\ActionGroup;
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;

abstract class AbstractFullCrudController extends AbstractCrudController
{
use ExportCrudControllerTrait;

#[\Override]
public function configureCrud(Crud $crud): Crud
{
return $crud->showEntityActionsInlined();
}

#[\Override]
public function configureActions(Actions $actions): Actions
{
// Remove default actions
$actions
->remove(Crud::PAGE_INDEX, Action::EDIT)
->remove(Crud::PAGE_INDEX, Action::DELETE);

// Re-add default actions as grouped action.
$groupedDefaultActions = ActionGroup::new('default', 'Default')
->addMainAction(
Action::new('show', 'Show')
->linkToCrudAction(Action::DETAIL)
)
->addAction(
Action::new('edit', 'Edit')
->linkToCrudAction(Action::EDIT)
->setIcon('fa fa-edit')
)
->addDivider()
->addAction(
Action::new('delete', 'Delete')
->linkToCrudAction(Action::DELETE)
->setIcon('fa fa-trash')
->setCssClass('btn-danger text-danger')
);

return $actions
->add(Crud::PAGE_INDEX, $groupedDefaultActions)
->add(Crud::PAGE_INDEX, $this->createExportAction())
->update(Crud::PAGE_INDEX, Action::NEW,
static fn (Action $action) => $action->setIcon('fa fa-plus')
)
;
}

#[\Override]
public function configureAssets(Assets $assets): Assets
{
return $assets
->addWebpackEncoreEntry('easyadmin');
}
}
3 changes: 2 additions & 1 deletion src/Controller/Admin/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function index(): Response
public function configureDashboard(): Dashboard
{
return Dashboard::new()
->setTitle('<img src="/img/itk-sites-logo.png" width="170px" alt="ITK sites">')
->setTitle('<img src="/img/itk-sites-logo.png" width="170px" alt="ITK sites logo">')
->setFaviconPath('img/favicon.ico')
->renderContentMaximized();
}
Expand All @@ -52,6 +52,7 @@ public function configureMenuItems(): iterable
yield MenuItem::linkTo(DomainCrudController::class, 'Domains', 'fas fa-link');
yield MenuItem::linkTo(OIDCCrudController::class, 'OIDC', 'fas fa-key');
yield MenuItem::linkTo(ServiceCertificateCrudController::class, 'Service certificates', 'fas fa-lock');
yield MenuItem::linkTo(SecurityContractCrudController::class, 'Service Agreements', 'fas fa-file-contract');
yield MenuItem::section('Dependencies');
yield MenuItem::linkTo(PackageCrudController::class, 'Packages', 'fas fa-cube');
yield MenuItem::linkTo(PackageVersionCrudController::class, 'Package Versions', 'fas fa-cubes');
Expand Down
8 changes: 2 additions & 6 deletions src/Controller/Admin/DetectionResultCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ public function configureCrud(Crud $crud): Crud
public function configureActions(Actions $actions): Actions
{
return $actions
->add(Crud::PAGE_INDEX, Action::DETAIL)
->remove(Crud::PAGE_INDEX, Action::NEW)
->remove(Crud::PAGE_INDEX, Action::EDIT)
->remove(Crud::PAGE_INDEX, Action::DELETE)
->remove(Crud::PAGE_DETAIL, Action::EDIT)
->remove(Crud::PAGE_DETAIL, Action::DELETE);
->disable(Action::DELETE, Action::NEW, Action::EDIT)
->add(Crud::PAGE_INDEX, Action::DETAIL);
}

#[\Override]
Expand Down
8 changes: 2 additions & 6 deletions src/Controller/Admin/DockerImageCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ public function configureCrud(Crud $crud): Crud
public function configureActions(Actions $actions): Actions
{
return $actions
->add(Crud::PAGE_INDEX, Action::DETAIL)
->remove(Crud::PAGE_INDEX, Action::NEW)
->remove(Crud::PAGE_INDEX, Action::EDIT)
->remove(Crud::PAGE_INDEX, Action::DELETE)
->remove(Crud::PAGE_DETAIL, Action::EDIT)
->remove(Crud::PAGE_DETAIL, Action::DELETE);
->disable(Action::DELETE, Action::NEW, Action::EDIT)
->add(Crud::PAGE_INDEX, Action::DETAIL);
}

#[\Override]
Expand Down
8 changes: 2 additions & 6 deletions src/Controller/Admin/DockerImageTagCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ public function configureCrud(Crud $crud): Crud
public function configureActions(Actions $actions): Actions
{
return $actions
->add(Crud::PAGE_INDEX, Action::DETAIL)
->remove(Crud::PAGE_INDEX, Action::NEW)
->remove(Crud::PAGE_INDEX, Action::EDIT)
->remove(Crud::PAGE_INDEX, Action::DELETE)
->remove(Crud::PAGE_DETAIL, Action::EDIT)
->remove(Crud::PAGE_DETAIL, Action::DELETE);
->disable(Action::DELETE, Action::NEW, Action::EDIT)
->add(Crud::PAGE_INDEX, Action::DETAIL);
}

#[\Override]
Expand Down
9 changes: 2 additions & 7 deletions src/Controller/Admin/DomainCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,9 @@ public function configureCrud(Crud $crud): Crud
public function configureActions(Actions $actions): Actions
{
return $actions
->disable(Action::DELETE, Action::NEW, Action::EDIT)
->add(Crud::PAGE_INDEX, Action::DETAIL)
->add(Crud::PAGE_INDEX, $this->createExportAction())
->remove(Crud::PAGE_INDEX, Action::NEW)
->remove(Crud::PAGE_INDEX, Action::EDIT)
->remove(Crud::PAGE_INDEX, Action::DELETE)
->remove(Crud::PAGE_DETAIL, Action::EDIT)
->remove(Crud::PAGE_DETAIL, Action::DELETE)
;
->add(Crud::PAGE_INDEX, $this->createExportAction());
}

#[\Override]
Expand Down
8 changes: 2 additions & 6 deletions src/Controller/Admin/GitRepoCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ public function configureCrud(Crud $crud): Crud
public function configureActions(Actions $actions): Actions
{
return $actions
->add(Crud::PAGE_INDEX, Action::DETAIL)
->remove(Crud::PAGE_INDEX, Action::NEW)
->remove(Crud::PAGE_INDEX, Action::EDIT)
->remove(Crud::PAGE_INDEX, Action::DELETE)
->remove(Crud::PAGE_DETAIL, Action::EDIT)
->remove(Crud::PAGE_DETAIL, Action::DELETE);
->disable(Action::DELETE, Action::NEW, Action::EDIT)
->add(Crud::PAGE_INDEX, Action::DETAIL);
}

#[\Override]
Expand Down
Loading
Loading