Skip to content

feat: queue-management implementation (#211)#304

Draft
rubenvdlinde wants to merge 13 commits intodevelopmentfrom
feature/211/queue-management
Draft

feat: queue-management implementation (#211)#304
rubenvdlinde wants to merge 13 commits intodevelopmentfrom
feature/211/queue-management

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Closes #211

Summary

Implements queue-management feature for Pipelinq, enabling priority-ordered work queues with overflow handling and skill-based routing. Backend services handle queue operations, capacity checks, and automatic overflow routing to configured overflow queues. Added required PHPDoc @SPEC tags to all new classes and public methods for traceability.

Spec Reference

Changes

  • lib/Service/QueueService.php — Queue operations service with capacity checks, overflow routing, and item assignment
  • lib/BackgroundJob/QueueOverflowJob.php — Background job that periodically checks queue capacities and moves overflow items
  • lib/Service/DefaultQueueService.php — Service for creating default queues and skills during repair/initialization
  • appinfo/info.xml — Registered QueueOverflowJob background job

Test Coverage

  • tests/Unit/Service/QueueServiceTest.php — Unit tests for QueueService covering getQueueDepth, isAtCapacity, assignToQueue, removeFromQueue
  • tests/Unit/BackgroundJob/QueueOverflowJobTest.php — Unit tests for QueueOverflowJob covering overflow execution and configuration scenarios

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/pipelinq @ d96d4f1

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 249/249
PHPUnit ⏭️
Newman ⏭️
Playwright

Spec coverage: 14% (42 tests / 298 specs)


Quality workflow — 2026-04-20 20:14 UTC

Download the full PDF report from the workflow artifacts.

*
* @version GIT: <git_id>
*
* @link https://github.com/ConductionNL/pipelinq
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[unfixed: inherited from base] phpcs reports missing @spec PHPDoc tag on several pre-existing background job classes (KennisbankReviewJob, ComplaintSlaJob, EmailSyncJob and others visible in the truncated quality-runner output). These are not in the changed-file scope of this PR. The three NEW PHP files in this PR (QueueOverflowJob, QueueService, DefaultQueueService) all carry proper @spec tags. Inherited debt cannot be bound-fixed in this pass.

Rule: PHPCS @SPEC tag requirement — ADR-008

@@ -51,6 +55,8 @@ public function __construct(
* @param string $queueId The queue UUID.
*
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[unfixed: check-not-run — phpunit failure excerpt missing] The pre-run quality suite reports phpunit FAILING but captured no excerpt ("No excerpt captured — see pipeline log for detail"). The test files tests/Unit/Service/QueueServiceTest.php and tests/Unit/BackgroundJob/QueueOverflowJobTest.php exist on the branch and use proper mocking patterns. Without the failure excerpt, the root cause cannot be diagnosed or fixed in this pass. The next retry cycle should surface the full phpunit output.

Rule: ADR-008 — all production-code changes require passing unit tests

@rubenvdlinde
Copy link
Copy Markdown
Contributor Author

Code Review — Juan Claude van Damme

Result: FAIL (0 fixed, 2 unfixed, 2 blocking)

Gate Summary

Gate Result Note
License headers (ADR-014) ✅ PASS All 3 new PHP files carry @copyright + @license EUPL-1.2
Forbidden patterns ✅ PASS No var_dump/die/error_log/print_r/dd/dump in lib/
Stub scan ✅ PASS run() in QueueOverflowJob has real implementation; all injected deps used
Composer audit ✅ PASS No CVEs in installed deps
phpcs ❌ FAIL Inherited pre-existing debt on unrelated files; our 3 new PHP files are clean
phpunit ❌ FAIL Suite failing but no failure excerpt captured — root cause unknown

Changed-file findings

lib/BackgroundJob/QueueOverflowJob.php — Clean. Proper EUPL-1.2 header, @spec tags on class + protected method, real implementation in run(), named arguments (ADR-015 compliant), all deps used.

lib/Service/QueueService.php — Clean. Proper headers, @spec on class + all public methods, named arguments throughout, no forbidden patterns, correct return types.

lib/Service/DefaultQueueService.php — Clean. Same quality as QueueService. Constants and seed data match spec. Both public methods documented with @spec.

openspec/ files — Spec artefacts only; no code quality requirements apply.

Unfixed findings

  1. [unfixed: inherited from base] phpcs missing @spec tag on pre-existing background job classes (KennisbankReviewJob, ComplaintSlaJob, EmailSyncJob + ~1400 more truncated lines). Not in this PR's changed-file scope. Requires a separate debt-cleanup pass.

  2. [unfixed: check-not-run — phpunit excerpt missing] phpunit reported FAIL but no output excerpt was captured by the pre-run quality runner. Test files exist on branch and appear structurally sound, but failure cannot be diagnosed without the excerpt. The next retry cycle must capture full phpunit output.

See inline comments for per-finding detail.

@rubenvdlinde
Copy link
Copy Markdown
Contributor Author

Security Review — Clyde Barcode

Result: FAIL (0 fixed, 2 unfixed WARNING, 0 blocking in diff)

Scans run on changed files

Check Result
Semgrep p/security-audit + p/owasp-top-ten ✅ 0 findings
Semgrep p/secrets ✅ 0 findings
Gitleaks (no-git, per-file) ✅ 0 leaks
composer audit ✅ clean (no packages declared)
npm audit --production ⚠️ 16 vulnerabilities (2 high) — pre-existing
OWASP manual diff review ✅ no findings in changed files

Findings in changed PHP files

None. The three PHP changes (QueueService.php, DefaultQueueService.php, QueueOverflowJob.php) add only @spec PHPDoc tags to existing classes and methods. No new security surface introduced.

Notes on the code reviewed for completeness:

  • _rbac: false, _multitenancy: false on all ObjectService calls is correct for system-level background jobs and initialization services with no user context.
  • No raw SQL, no string interpolation into queries, no secrets, no PII in logs beyond UUIDs.
  • QueueService methods are not exposed via any controller endpoint (verified by grep — zero controller references).

Pre-existing npm vulnerabilities (not introduced by this PR)

These were already flagged by the pre-run quality gate (cycle 2 hydra.json, npm-audit: fail). Not in the diff; cannot apply inline comments. Requires a dedicated dependency-update PR.

fast-xml-parser (HIGH) — 3 CVEs:

minimatch (HIGH) — 3 ReDoS CVEs:

Verdict is FAIL because these two WARNINGs are unfixed. The Applier should note these are pre-existing and unrelated to this PR's diff before making go/no-go decision.


Clyde Barcode · Hydra Security Reviewer · Conduction B.V.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants