Skip to content

feat: image build support#1687

Merged
kmendell merged 1 commit intomainfrom
feat/image-building
Feb 28, 2026
Merged

feat: image build support#1687
kmendell merged 1 commit intomainfrom
feat/image-building

Conversation

@kmendell
Copy link
Copy Markdown
Member

@kmendell kmendell commented Feb 8, 2026

What This PR Implements

Related issue

Related Issue

Fixes #

Changes Made

Testing Done

  • Development environment started: ./scripts/development/dev.sh start
  • Frontend verified at http://localhost:3000
  • Backend verified at http://localhost:3552
  • Manual testing completed (describe):
  • No linting errors (e.g., just lint all)
  • Backend tests pass: just test backend

Checklist

  • This PR is not opened from my fork’s main branch

AI Tool Used (if applicable)

AI Tool:
Assistance Level:
What AI helped with:
I reviewed and edited all AI-generated output:
I ran all required tests and manually verified changes:

Additional Context

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

Greptile Summary

This PR implements comprehensive image build support with both local Docker and Depot (remote BuildKit) providers. The implementation includes a manual build workspace with file browser, build configuration UI, real-time progress tracking, and persistent build history.

Key Changes:

  • Core build infrastructure in backend/pkg/libarcane/libbuild/ supporting local Docker and remote BuildKit providers
  • Build workspace service with file operations (upload, download, browse) and proper path traversal protection via sanitizeUploadFilename and sanitizeBuildPath functions
  • HTTP endpoints for build operations with proper authentication (BearerAuth/ApiKeyAuth) on all workspace routes
  • Database migration adds image_builds table with comprehensive tracking of build parameters, status, output (2MB limit), and duration
  • Frontend build workspace UI with form validation, provider selection, real-time progress visualization, and build history table
  • E2E tests covering local and depot provider workflows

Code Quality:

  • All unexported functions properly follow the "Internal" suffix convention per custom rule 306fc233
  • Path sanitization prevents traversal attacks (addresses previous security concerns)
  • Authentication properly configured on all build workspace endpoints (resolves previous auth gaps)
  • Proper use of Svelte 5 runes ($state, $derived) without state mutations in $effect blocks per custom rule 8e0bee41
  • Clean error handling and timeout management throughout

Previous Thread Items:
The implementation has addressed the security concerns raised in previous threads: filename path escapes are blocked via sanitizeUploadFilename, and authentication is properly configured on all build workspace endpoints.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - security concerns from previous threads have been addressed
  • The implementation is comprehensive and well-structured with proper security measures (path sanitization, authentication), follows project coding conventions (Internal suffix for unexported functions, Svelte 5 best practices), includes database migrations with appropriate indexes, has E2E test coverage, and addresses all previously identified security concerns. The code demonstrates solid error handling, timeout management, and clean separation of concerns across the build pipeline.
  • No files require special attention - previous security concerns have been properly addressed

Important Files Changed

Filename Overview
backend/pkg/libarcane/libbuild/builder_core.go Core builder implementation with provider resolution, BuildKit integration, and registry auth handling - clean implementation with proper error handling and timeout management
backend/internal/services/build_workspace_service.go File operations for build workspace with proper path sanitization via sanitizeUploadFilename and sanitizeBuildPath - security concerns from previous threads have been addressed
backend/internal/huma/handlers/build_workspaces.go Build workspace HTTP handlers with proper authentication (BearerAuth and ApiKeyAuth) on all endpoints - previous auth concerns resolved
backend/internal/services/build_service.go Build service orchestrates image builds with history tracking, log capture (2MB limit), and proper error handling throughout the build lifecycle
backend/pkg/libarcane/libbuild/builder_docker.go Docker build implementation with support for external Dockerfiles, proper context staging, and streaming progress - all helper functions follow Internal suffix convention
backend/resources/migrations/postgres/037_add_image_builds.up.sql Database migration adds image_builds table with appropriate indexes on environment_id, status, and created_at for efficient querying
frontend/src/routes/(app)/images/builds/+page.svelte Build workspace UI with form validation, real-time build progress tracking, and build history table - uses $state properly without updates in $effect blocks per custom rules
backend/internal/services/settings_service.go Settings service with depot token handling - note that empty depot token cannot be cleared via API (preserves existing value), which may be intentional for security

Last reviewed commit: 35d494e

Context used:

  • Rule from dashboard - What: All unexported functions must have the "Internal" suffix.

Why: Clearly distinguishes private ... (source)

  • Rule from dashboard - What: Avoid updating $state inside $effect blocks; use $derived for computed values instead.

... (source)

Copy link
Copy Markdown
Member Author

kmendell commented Feb 8, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kmendell kmendell force-pushed the feat/image-building branch from b5eed7e to 4c64e88 Compare February 8, 2026 05:28
@getarcaneappbot
Copy link
Copy Markdown
Contributor

getarcaneappbot commented Feb 8, 2026

Container images for this PR have been built successfully!

  • Manager: ghcr.io/getarcaneapp/arcane:pr-1687
  • Agent: ghcr.io/getarcaneapp/arcane-headless:pr-1687

Built from commit 658f63d

@kmendell kmendell force-pushed the feat/image-building branch 9 times, most recently from 4a3a8af to 11a71c6 Compare February 10, 2026 00:46
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@kmendell
Copy link
Copy Markdown
Member Author

@greptileai

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

10 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread backend/internal/services/build_workspace_service.go
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@kmendell kmendell force-pushed the feat/image-building branch from c6a834d to 097017a Compare February 10, 2026 20:10
@kmendell kmendell force-pushed the feat/image-building branch 2 times, most recently from 44a8c90 to 8fcf036 Compare February 10, 2026 23:33
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@kmendell kmendell force-pushed the feat/image-building branch 2 times, most recently from 1264e21 to ab4e67f Compare February 19, 2026 16:29
@kmendell kmendell force-pushed the feat/image-building branch 2 times, most recently from 2c41031 to 2697839 Compare February 19, 2026 21:25
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

2 similar comments
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 25, 2026

🔍 Deadcode Analysis

Found 2 unreachable functions in the backend.

View details
pkg/utils/stdcopy/stdcopy.go:56:21: unreachable func: stdWriter.Write
pkg/utils/stdcopy/stdcopy.go:91:6: unreachable func: NewStdWriter

Only remove deadcode that you know is 100% no longer used.

Analysis from commit d18c9af

@kmendell
Copy link
Copy Markdown
Member Author

@greptileai

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

81 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread backend/pkg/libarcane/libbuild/builder_utils.go Outdated
@kmendell
Copy link
Copy Markdown
Member Author

@greptileai

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

@kmendell
Copy link
Copy Markdown
Member Author

@greptileai

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed.

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