Skip to content

Phase 9: Conversion Job Core (CONV-112–CONV-129)#122

Merged
menvil merged 17 commits into
developfrom
feature/phase09-conversion-job-core
May 31, 2026
Merged

Phase 9: Conversion Job Core (CONV-112–CONV-129)#122
menvil merged 17 commits into
developfrom
feature/phase09-conversion-job-core

Conversation

@menvil

@menvil menvil commented May 31, 2026

Copy link
Copy Markdown
Owner

Phase 9 — Conversion Job Core (CONV-112 → CONV-129)

Backend domain + application layer for creating and processing conversion jobs through a queue + driver architecture. No real image/PDF conversion (Phase 10), no Convert Now UI (Phase 11), no billing (Phase 14/15) — lifecycle is proven end-to-end with a fake driver.

What's included

  • CONV-112 Database queue tables — already satisfied by the default Laravel jobs/failed_jobs migration and QUEUE_CONNECTION=database in .env.example (no change needed).
  • CONV-113 ConversionStatus enum (draft/queued/processing/completed/failed/cancelled/expired).
  • CONV-114 conversion_jobs table + ConversionJob model + factory.
  • CONV-115 Model relationships (user, sourceFile, resultFile; reverse on User/FileRecord).
  • CONV-116 / CONV-117 ConversionContext and ConversionResult DTOs.
  • CONV-118 / CONV-119 / CONV-120 ConverterDriver interface, ConverterDriverRegistry (+ MissingConverterDriverException), and a test-only FakeConverterDriver.
  • CONV-121 RecordConversionResultFileAction (turns a ConversionResult into a FileRecord).
  • CONV-122 → CONV-124 CreateConversionJobAction — validates the source→target pair and options, persists a queued job, dispatches ProcessConversionJob.
  • CONV-125 → CONV-129 ProcessConversionJobqueued → processing → completed happy path via the driver + recorder, and queued → processing → failed with error_code/error_message on driver exception.

Deviations from the plan (reconciled with the real codebase)

  • Code lives under the existing app/Support/Conversions/* convention (not app/Services/*/app/DTO), mirroring app/Support/Converters/*.
  • Reused the existing App\Support\Converters\ConverterRegistry::find() and Converter::validateOptions() (which normalizes + fills defaults) instead of inventing new validators. Unsupported pairs raise a new UnsupportedConversionException; invalid options raise the existing InvalidConverterOptionsException.
  • IDs are bigint auto-increment (matching users/files), not ULID.
  • ConverterDriverRegistry is registered empty in ConverterServiceProvider as the Phase 10 extension point.

Verification

  • composer test — green (256 tests / 700 assertions)
  • composer lint (Pint) — clean
  • npm run build — passes

Summary by cubic

Adds the backend core for conversion jobs (Phase 9, CONV-112–CONV-129): create, queue, and process jobs via a driver registry with a fake driver to prove the lifecycle. Uses the existing ConverterRegistry for pair/option validation; real drivers land in Phase 10.

  • New Features

    • conversion_jobs table, ConversionJob model + factory, and relations on User/FileRecord.
    • ConversionStatus enum; UnsupportedConversionException and MissingConverterDriverException.
    • CreateConversionJobAction validates source→target and options, stores driver-style converter_key (e.g. png_to_jpg), saves a queued job, and dispatches ProcessConversionJob.
    • ProcessConversionJob moves queued → processing → completed/failed, resolves drivers via ConverterDriverRegistry, records result via RecordConversionResultFileAction, and persists error code/message on failure.
    • DTOs: ConversionContext, ConversionResult. Driver contract: ConverterDriver. Registry is bound empty in the service provider; a fake driver is used only in tests.
    • RecordConversionResultFileAction now throws if the output file is missing before recording.
  • Migration

    • Run database migrations.
    • Ensure QUEUE_CONNECTION=database is set.

Written for commit 0ebc5cc. Summary will update on new commits.

Review in cubic

menvil and others added 16 commits May 31, 2026 22:33
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…126/CONV-128)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…CONV-127/CONV-129)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aa5fef83-2300-4e7a-907b-42b2752ffb06

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/phase09-conversion-job-core

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

… missing result file, share factory user

- CreateConversionJobAction stores the driver-style converter_key (e.g. png_to_jpg)
  so ProcessConversionJob's ConverterDriverRegistry lookup resolves.
- RecordConversionResultFileAction throws when the result file is missing instead
  of hashing an empty string.
- ConversionJobFactory keeps the source file owned by the same user as the job.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@menvil menvil merged commit 0401920 into develop May 31, 2026
5 checks passed
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.

1 participant