Skip to content

refactor(driver): extract image backend selection from New - #1703

Merged
skevetter merged 1 commit into
mainfrom
refactor/driver-image-backend-selection
Oct 25, 2026
Merged

skevetter merged 1 commit into
mainfrom
refactor/driver-image-backend-selection

Conversation

@skevetter

@skevetter skevetter commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Extract image-backend selection from New into newImageBackend in pkg/driver/drivercreate/create.go.
  • New now runs newRuntime, then newImageBackend, then builds the Bundle.
  • Driver-specific choices, error strings, and the none opt-out are unchanged.

Why

New currently creates the runtime and selects its optional image backend in the same branch-heavy function, mixing two independent policies. Extracting image-backend selection into a named step makes each responsibility easier to change and review while preserving the existing driver-specific choices.

Validation

  • mise run cli:format: exit 0.
  • go vet ./pkg/driver/drivercreate/: clean.
  • go test ./pkg/driver/drivercreate/...: ok.
  • golangci-lint run --new-from-rev=origin/main ./pkg/driver/drivercreate/...: 0 issues.
  • mise run cli:lint:ci: 0 issues.
  • Throwaway old-vs-new test (deleted): empty, docker, custom, unknown, and external-without-backend paths produce identical results. Direct newImageBackend check: external none returns nil/nil; bogus returns the same error text. External with a backend via New stops earlier at runtime binary resolution in this environment, so that path was checked only through the direct call.

CodeRabbit CLI

coderabbit review --agent --committed --base-commit 3e3b6828 on 202fd4f: completed, 0 findings, 1 file reviewed (create.go).

Auto-merge

  • Non-test changed lines: 64 (39 added, 25 removed), 1 file.
  • Not merged. Draft PR for human review.

Next

Human review.

Summary by CodeRabbit

  • Bug Fixes
    • Improved image backend selection across driver types, including clearer handling of unsupported backend settings.

@skevetter skevetter added the auto-refactor Automated refactor PR label Oct 25, 2026
@netlify

netlify Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 202fd4f
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ade45567df000662f98a370

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d53d1c01-e89e-454c-a46d-1a30d11f4893
Commits

Reviewing files that changed from the base of the PR and between 3e3b682 and 202fd4f.

Files selected for processing: 1
  • pkg/driver/drivercreate/create.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The driver factory now selects image backends through newImageBackend. The helper handles external-driver settings, Microsandbox, and runtime drivers that implement driver.ImageBackend. New propagates selection errors and returns the runtime and selected image backend.

Changes: Image backend selection

Layer / File(s) Summary
Select and return image backend
pkg/driver/drivercreate/create.go
newImageBackend handles external-driver settings, Microsandbox, and runtimes that implement driver.ImageBackend. New propagates errors and returns the runtime with the selected backend.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Merge Risk: Minimal · up to 202fd

No actionable issue is identified; the change is ready to merge after normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the change, motivation, validation steps, and known test limitation. However, it does not follow the required template and omits the issue reference, change-type selection, AI… Update the description to use the required template. Add the issue reference or state "none"; select Refactor; complete the AI assistance section and acknowledgements; identify the applicable testing option and existing coverage; document m…
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: extracting image-backend selection from New. It follows the repository's Conventional Commits format.
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.
Full details: Description check

Explanation

The description explains the change, motivation, validation steps, and known test limitation. However, it does not follow the required template and omits the issue reference, change-type selection, AI assistance disclosure, checklist confirmations, manual verification details, and explicit testing classification.

Resolution

Update the description to use the required template. Add the issue reference or state "none"; select Refactor; complete the AI assistance section and acknowledgements; identify the applicable testing option and existing coverage; document manual verification; and complete the checklist items or explain why they do not apply.

Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@netlify

netlify Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 202fd4f
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ade4556e85a3f21ab2cb115

@skevetter
skevetter marked this pull request as ready for review October 25, 2026 20:04

Copy link
Copy Markdown
Contributor Author

@coderabbitai review
@greptileai review

@mergify

mergify Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This refactor appears safe to merge.

Summary

Extracts image-backend selection from New into newImageBackend.

  • Driver bundles choose runtimes and image backends in separate steps.

Reviews (1) · Last reviewed commit: "refactor(driver): extract image backend ..." · Reviewed by Greptile

@skevetter
skevetter merged commit ebb9d70 into main Oct 25, 2026
206 of 208 checks passed
@skevetter
skevetter deleted the refactor/driver-image-backend-selection branch October 25, 2026 20:07
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Labels

auto-refactor Automated refactor PR size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant