Skip to content

Validate Apalis route queue closure (backend-5.2.1)#357

Open
leynos wants to merge 6 commits into
mainfrom
backend-5-2-1-apalis-route-queue
Open

Validate Apalis route queue closure (backend-5.2.1)#357
leynos wants to merge 6 commits into
mainfrom
backend-5-2-1-apalis-route-queue

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented May 20, 2026

Summary

  • Validated the existing Apalis/PostgreSQL RouteQueue adapter against focused unit and behavioural coverage.
  • Reconciled docs/developers-guide.md with the actual GenericApalisRouteQueue<P, Q> BDD harness seam.
  • Marked backend roadmap item 5.2.1 done after full gates and CodeRabbit reviews completed cleanly.
  • ExecPlan: docs/execplans/backend-5-2-1-apalis-route-queue.md.

Validation

  • cargo test -p backend outbound::queue --lib passed (5 tests).
  • cargo test -p backend --test route_queue_apalis_bdd passed (9 tests).
  • make check-fmt passed.
  • make lint passed.
  • make test passed; Rust nextest ran 1220 tests with 1220 passed and 4 skipped, and the frontend/workspace tests passed.
  • coderabbit review --agent completed with 0 findings after targeted adapter verification, documentation reconciliation, full gates, final roadmap closure, and final branch-head review.

Scope Notes

  • 5.2.1 remains an outbound adapter milestone only.
  • Route-submission dispatch, worker consumption, retry policy, trace propagation, and route-engine invocation remain later roadmap work.
  • No user-facing server behaviour changed; this worktree does not contain docs/users-guide.md.

References

Summary by Sourcery

Validate and close the Apalis/PostgreSQL RouteQueue adapter work by updating the execution plan, aligning internal developer documentation with the existing adapter API and tests, and marking the corresponding backend roadmap item as complete after all quality gates and reviews passed.

Enhancements:

  • Clarify the backend execution plan for item 5.2.1 to focus on validation, evidence gathering, and closure rather than new implementation.
  • Align the developers guide with the actual Apalis RouteQueue adapter surface, including the public re-export of the generic adapter used by the BDD harness.

Documentation:

  • Update the backend roadmap to record completion of queue adapter milestone 5.2.1 using Apalis with PostgreSQL storage.
  • Revise the execution plan and developer documentation to accurately describe the Apalis-backed RouteQueue adapter scope, architecture boundaries, and testing seams.

Replace the stale in-progress backend 5.2.1 ExecPlan with an
approval-gated validation and closure plan. Capture the current repository
state, Wyvern planning findings, Firecrawl Apalis research, validation gates,
and the CodeRabbit rate-limit blocker before implementation proceeds.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Review Change Stack

Completion of Apalis RouteQueue adapter milestone (backend-5.2.1)

This PR validates and closes the backend roadmap item 5.2.1 for the Apalis/PostgreSQL RouteQueue adapter, marking the outbound queue adapter implementation as complete.

Changes

Roadmap update: Item 5.2.1 under "5.2. Queue adapter (Apalis)" is marked as complete in docs/backend-roadmap.md.

Developer documentation: docs/developers-guide.md was updated to reflect that GenericApalisRouteQueue<P, Q> is now public and re-exported alongside the production ApalisRouteQueue<P> alias, establishing it as a generic adapter seam for the BDD harness.

Execplan document: A new execplan at docs/execplans/backend-5-2-1-apalis-route-queue.md documents the complete validation and closure of the milestone. It records the limited scope (adapter validation/closure only; dispatch, worker consumption, retry policy, and other concerns deferred to later roadmap items), documents the observed success criteria with detailed evidence including:

  • Unit tests (5 passing)
  • Behavioural tests (9 passing)
  • Full test suite (1,220 tests passed, 4 skipped)
  • Code quality gates (format and lint checks passed)
  • CodeRabbit automated review (0 findings)

The execplan also captures implementation decisions, discoveries during execution, and confirmation that no user-facing server behaviour changed.

Scope

This milestone is limited to validating the outbound Apalis adapter; route submission dispatch, worker consumption, retry policy, and trace propagation remain for later roadmap items.

Walkthrough

This PR documents the completion of backend roadmap item 5.2.1: the Apalis queue adapter using PostgreSQL. The roadmap task is marked complete; the API developers guide is updated to reflect the re-exported generic adapter seam; and the execution plan is rewritten as a comprehensive validation-and-closure record capturing milestones, test evidence, and decision log entries.

Changes

Backend 5.2.1 Apalis Adapter Completion

Layer / File(s) Summary
Roadmap completion and API visibility updates
docs/backend-roadmap.md, docs/developers-guide.md
The 5.2.1 task checkbox is marked complete; GenericApalisRouteQueue<P, Q> is documented as a pub re-exported generic adapter seam for the BDD harness, replacing the internal-only description.
Execution plan completion and validation record
docs/execplans/backend-5-2-1-apalis-route-queue.md
The execution plan is rewritten from an in-progress approval-gated plan into a complete validation-and-closure record with milestones 0–5, explicit commands and evidence expectations, populated progress section with test outcomes and CodeRabbit results, and filled-in decision log and retrospective confirming no user-facing behaviour changes and scope closure.

Suggested labels

Roadmap

✅ Five-point-two-one, the queue adapter done,
PostgreSQL Apalis now runs, the work is spun,
Roadmap ticked, docs rewritten bright,
Milestones closed with evidence in sight,
The harness generic seam shines pure and right. 🚀

🚥 Pre-merge checks | ✅ 16 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Developer Documentation ⚠️ Warning Roadmap 5.2.1 complete and execplan up-to-date. Line 664 violates en-GB-oxendict spelling: "parameterises" should be "parameterizes" and breaks 80-column wrapping. Change line 664 "parameterises" to "parameterizes" and adjust wrapping per review comments.
Domain Architecture ⚠️ Warning Domain architecture properly segregated; RouteQueue port infrastructure-free. Documentation violates en-GB-oxendict spelling and 80-column guidelines. Fix docs/developers-guide.md: change 'parameterises' to 'parameterize' and wrap lines 664–665 under 80 columns per review comment.
Observability ⚠️ Warning Apalis queue adapter lacks observability: no logging, tracing, or metrics in enqueue(), provider setup, or job dispatch despite operational state changes. Add tracing at decision points: log enqueue() calls, trace provider setup/failures, and instrument push_job() with structured error context for diagnosing job dispatch failures.
Architectural Complexity And Maintainability ⚠️ Warning The PR fails the spelling fix in review comment: line 664 uses "parameterises" instead of "parameterizes" per en-GB-oxendict requirement, contradicting the stated requirement and review guidance. Change line 664 from "parameterises the adapter" to "parameterizes the adapter" to match en-GB-oxendict convention and apply the proposed fix from the review comment.
✅ Passed checks (16 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the backend roadmap item 5.2.1 and accurately summarises the main change: validation and closure of the Apalis route queue adapter.
Description check ✅ Passed The description comprehensively relates to the changeset, detailing validation results, documentation reconciliation, roadmap closure, and scope boundaries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Testing (Overall) ✅ Passed No new functionality introduced; PR is documentation and removal of deferred work only. Existing Apalis RouteQueue tests are substantive with rigorous assertions.
User-Facing Documentation ✅ Passed PR validates internal backend adapter only. RouteQueue is infrastructure, not user-facing. No user-facing behaviour changed; no docs/users-guide.md updates required.
Module-Level Documentation ✅ Passed PR modifies only documentation files (docs/*.md), not code modules. Existing queue modules already carry comprehensive module-level docstrings explaining purpose, utility, and relationships.
Testing (Unit And Behavioural) ✅ Passed Four unit tests verify serialisation, error paths, and edge cases using fake providers. Four BDD tests verify adapter-PostgreSQL boundary with real database persistence—not disguised unit tests.
Testing (Property / Proof) ✅ Passed PR contains only documentation changes (roadmap, developer guide, execution plan). No new code introduces invariants requiring property or formal testing.
Testing (Compile-Time / Ui) ✅ Passed PR contains documentation-only changes (three markdown files) with no compile-time code or generated output; existing tests on underlying adapter already passed per PR objectives.
Unit Architecture ✅ Passed RouteQueue adapter architecture maintains clean separation: explicit async enqueue command; dependencies injected; fallible operations visible in Result types; unit/BDD test boundary proper.
Security And Privacy ✅ Passed Documentation-only PR. No secrets, credentials, authentication bypasses, injection risks or sensitive data exposed in files changed.
Performance And Resource Use ✅ Passed No algorithmic regressions, unbounded growth, excessive allocation, or blocking on hot paths detected. Single serialisation and database write per enqueue are necessary and appropriate.
Concurrency And State ✅ Passed Documentation-only changes with no code modifications. Apalis queue adapter has sound concurrency: no shared mutable state, proper Send+Sync bounds, brief mutex holds without awaits.
Rust Compiler Lint Integrity ✅ Passed PR introduces no Rust lint suppressions in queue code. GenericApalisRouteQueue is public and re-exported; test helpers actively use it.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backend-5-2-1-apalis-route-queue

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 20, 2026

Reviewer's Guide

Validates the existing Apalis/PostgreSQL RouteQueue adapter and associated tests, reconciles developer documentation with the actual adapter API (notably the visibility and re-export of GenericApalisRouteQueue), and marks backend roadmap item 5.2.1 as complete after confirming all gates and reviews are clean.

File-Level Changes

Change Details Files
ExecPlan for backend roadmap item 5.2.1 is rewritten from an implementation plan into a validation-and-closure plan describing constraints, risks, decision log, progress, and concrete steps for verifying the Apalis/PostgreSQL RouteQueue adapter.
  • Update title and status to reflect validation/closure rather than initial implementation.
  • Replace detailed implementation steps and agent-role breakdown with an approval-gated validation plan focused on auditing the existing adapter, running focused tests, and closing the roadmap item.
  • Revise constraints, tolerances, risks, and decision log to emphasise keeping scope to 5.2.1, preserving hexagonal boundaries, and using apalis-postgres with PostgreSQL storage.
  • Document the current repository orientation, implementation milestones, and step-by-step validation commands (cargo tests, make gates, CodeRabbit).
  • Fill in progress, surprises & discoveries, decisions, and outcomes reflecting that the adapter already existed and that work consisted of validation, documentation reconciliation, and roadmap closure.
docs/execplans/backend-5-2-1-apalis-route-queue.md
Developer guide documentation for the Apalis RouteQueue adapter is updated to match the actual public API, clarifying that GenericApalisRouteQueue<P, Q> is re-exported and used as a BDD harness seam.
  • Change the visibility table entry for GenericApalisRouteQueue<P, Q> from “Internal; not re-exported” to “pub”, noting it is a generic adapter and BDD harness seam.
  • Adjust the descriptive text to state that GenericApalisRouteQueue is re-exported alongside the production alias because the BDD harness constructs the adapter with a test provider, while production code should prefer ApalisRouteQueue

    .

  • Keep the description of QueueProvider and test helper types as internal seams for tests and providers.
docs/developers-guide.md
Backend roadmap is updated to mark Apalis RouteQueue implementation (item 5.2.1) as done after successful validation and closure.
  • Change the checkbox for roadmap item 5.2.1 from unchecked to checked.
  • Leave subsequent queue-related roadmap items (5.2.2 onward) unchanged, keeping future work explicitly open.
docs/backend-roadmap.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

codescene-delta-analysis[bot]

This comment was marked as outdated.

leynos added 5 commits May 26, 2026 12:48
Mark the approved execution as in progress and capture the targeted
adapter validation evidence. Record the first implementation CodeRabbit
review result so the ExecPlan can be resumed from the documented state.
Correct the developer guide's visibility notes for
`GenericApalisRouteQueue` so they match the exported BDD harness seam.
Update the ExecPlan with the documentation check evidence and the
user-guide applicability decision.
Capture the successful full formatting, lint, and test gate results in
the ExecPlan before requesting the post-gate review.
Mark backend roadmap item 5.2.1 done after the approved
validation gates passed, and complete the ExecPlan with final
gate evidence plus the implementation retrospective.
Add the final CodeRabbit closure result to the ExecPlan so the
implementation record matches the completed review sequence.
@leynos leynos marked this pull request as ready for review May 26, 2026 18:05
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai coderabbitai Bot added the Roadmap label May 26, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/developers-guide.md`:
- Around line 662-665: Update the doc paragraph describing
GenericApalisRouteQueue<P, Q> to use the en-GB-oxendict -ize spelling: replace
"parameterises" with "parameterize" and reflow the sentence(s) so no line
(including indentation) exceeds 80 characters; ensure the references to
GenericApalisRouteQueue<P, Q> and ApalisRouteQueue<P> remain intact and the
meaning (that tests substitute a queue provider Q while production uses
ApalisRouteQueue<P>) is preserved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cada4f64-233a-4f41-a54a-4214d68c825b

📥 Commits

Reviewing files that changed from the base of the PR and between b23476f and 01ad786.

📒 Files selected for processing (3)
  • docs/backend-roadmap.md
  • docs/developers-guide.md
  • docs/execplans/backend-5-2-1-apalis-route-queue.md

Comment thread docs/developers-guide.md
Comment on lines +662 to +665
- `GenericApalisRouteQueue<P, Q>` – Re-exported beside the production alias
because the BDD harness constructs the adapter with a test provider. It
parameterises the adapter over the queue provider type `Q` so tests can
substitute doubles.
substitute doubles, while production code should prefer `ApalisRouteQueue<P>`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Correct spelling to match en-GB-oxendict and fix line wrapping.

Line 664 uses "parameterises" which conflicts with the en-GB-oxendict guideline requiring -ize endings. Line 665 exceeds 80 columns when indentation is included.

📝 Proposed fix
-- `GenericApalisRouteQueue<P, Q>` – Re-exported beside the production alias
-  because the BDD harness constructs the adapter with a test provider. It
-  parameterises the adapter over the queue provider type `Q` so tests can
-  substitute doubles, while production code should prefer `ApalisRouteQueue<P>`.
+- `GenericApalisRouteQueue<P, Q>` – Re-exported beside the production alias
+  because the BDD harness constructs the adapter with a test provider. It
+  parameterizes the adapter over the queue provider type `Q` so tests can
+  substitute doubles, while production code should prefer
+  `ApalisRouteQueue<P>`.

Triage: [type:spelling] [type:docstyle]

As per coding guidelines, use en-GB-oxendict with -ize endings: 'parameterize' not 'parameterise'. Paragraphs and bullet points must be wrapped at 80 columns.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `GenericApalisRouteQueue<P, Q>` – Re-exported beside the production alias
because the BDD harness constructs the adapter with a test provider. It
parameterises the adapter over the queue provider type `Q` so tests can
substitute doubles.
substitute doubles, while production code should prefer `ApalisRouteQueue<P>`.
- `GenericApalisRouteQueue<P, Q>` – Re-exported beside the production alias
because the BDD harness constructs the adapter with a test provider. It
parameterizes the adapter over the queue provider type `Q` so tests can
substitute doubles, while production code should prefer
`ApalisRouteQueue<P>`.
🧰 Tools
🪛 LanguageTool

[typographical] ~662-~662: Consider using an em dash in dialogues and enumerations.
Context: ...ue: - GenericApalisRouteQueue<P, Q>` – Re-exported beside the production alias...

(DASH_RULE)


[uncategorized] ~664-~664: Do not mix variants of the same word (‘parameterise’ and ‘parameterize’) within a single text.
Context: ... the adapter with a test provider. It parameterises the adapter over the queue provider typ...

(EN_WORD_COHERENCY)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/developers-guide.md` around lines 662 - 665, Update the doc paragraph
describing GenericApalisRouteQueue<P, Q> to use the en-GB-oxendict -ize
spelling: replace "parameterises" with "parameterize" and reflow the sentence(s)
so no line (including indentation) exceeds 80 characters; ensure the references
to GenericApalisRouteQueue<P, Q> and ApalisRouteQueue<P> remain intact and the
meaning (that tests substitute a queue provider Q while production uses
ApalisRouteQueue<P>) is preserved.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant