Skip to content

ADR-022/031 tech-debt: MetricsRepository raw queries + bespoke state machines #1395

Description

@rubenvdlinde

Surfaced during this session's ADR-compliance audit (with the audit's own false-positives corrected by direct verification).

Real findings

  • ADR-022 (HIGH-ish): lib/Service/MetricsRepository.php issues ~8 raw QueryBuilder selects against OpenRegister's internal openregister_objects table, bypassing ObjectService / OR's aggregation API. This couples pipelinq to OR's internal storage schema. Migrate to OR's ObjectService.findAll/aggregation API (or OR's metrics/aggregation endpoints). lib/Controller/HealthController.php has 1 similar raw read.
  • ADR-031 (LOW, tech-debt): lib/Service/CallbackService.php declares a bespoke PHP transition map (open→in_behandeling→afgerond/verlopen) + validateTransition instead of x-openregister-lifecycle. Same pattern the POS suite just migrated away from (see the pos-lifecycle-guard-adoption change). Consider declaring the callback/task lifecycle declaratively and routing through OR TransitionEngine.

NOT issues (audit false-positives, verified against origin/development)

  • CallbackController is NOT unguarded — all 4 endpoints carry #[NoAdminRequired] + per-object checkTaskAuth/authorizeTaskMutation (reassign is admin-gated).
  • CallbackService has NO raw queries (the raw-query finding was misattributed; real source is MetricsRepository).
  • InvoiceSequenceService's single row-lock on oc_appconfig is a justified atomic-counter (no OR sequence abstraction); leave as-is.

Note: the InvoiceSequenceService raw query is intentional and was confirmed acceptable.


Gemigreerd van Codeberg — oorspronkelijk Conduction/pipelinq#43, geopend door rubenvdlinde op 2026-06-01.

Metadata

Metadata

Assignees

Labels

triageAwaiting triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions