Skip to content

feat: configurable compose up button#1940

Merged
kmendell merged 1 commit intomainfrom
feat/compose-button-up
Mar 3, 2026
Merged

feat: configurable compose up button#1940
kmendell merged 1 commit intomainfrom
feat/compose-button-up

Conversation

@kmendell
Copy link
Copy Markdown
Member

@kmendell kmendell commented Mar 2, 2026

What This PR Implements

Related issue

Related Issue

Fixes # #1270

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 a configurable compose up button that allows users to customize Docker deployment behavior with pull policies and container recreation options.

Changes:

  • Added admin setting defaultDeployPullPolicy (missing/always/never) to control default image pull behavior
  • Created new split button UI component with dropdown menu for per-deployment overrides
  • Added "force recreate" option to force container recreation during deploy
  • Implemented proper precedence: compose file pull_policy → user override → admin default → fallback to "missing"
  • Frontend store persists user preferences to localStorage with server sync on first load
  • Updated all project deploy calls to pass options through the request body

Implementation:

  • Backend: Added DeployOptions type with validation, updated service layer and compose commands
  • Frontend: New deployOptionsStore for state management, split button component, integrated across all deploy UIs
  • Tests updated for new parameter signature and precedence logic verified

Confidence Score: 4/5

  • This PR is safe to merge with minor considerations around user preference persistence
  • The implementation is well-structured with proper validation, testing, and follows Go/TypeScript best practices. Type definitions include binding tags, service layer changes maintain proper separation of concerns, and all existing tests have been updated. One known limitation is that admin setting changes won't propagate to users who have already made explicit choices (flagged in previous threads), but this appears to be intentional design rather than a bug.
  • No files require special attention

Important Files Changed

Filename Overview
types/settings/settings.go Added DefaultDeployPullPolicy field with proper validation binding tag
types/project/project.go Added DeployOptions struct with PullPolicy and ForceRecreate fields, proper validation
backend/internal/services/project_service.go Updated DeployProject to accept options, added normalizeDeployPullPolicyInternal, correct precedence logic
backend/pkg/projects/cmds.go Added forceRecreate parameter to ComposeUp, sets recreate policy to force when enabled
frontend/src/lib/stores/deploy-options.store.svelte.ts Created store for deploy options with persisted state, syncs from settings with user override tracking
frontend/src/lib/services/project-service.ts Added DeployProjectOptions type, updated deployProject method with overloads for options support
frontend/src/lib/components/deploy-split-button/deploy-split-button.svelte Created split button component with dropdown for pull policy and force recreate options
frontend/src/lib/components/action-buttons.svelte Replaced deploy button with split button, integrated deploy options store, updated all deploy calls

Last reviewed commit: bec81dd

Copy link
Copy Markdown
Member Author

kmendell commented Mar 2, 2026

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

@kmendell kmendell marked this pull request as ready for review March 2, 2026 19:19
@kmendell kmendell requested a review from a team March 2, 2026 19:19
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 2, 2026

🔍 Deadcode Analysis

Found 3 unreachable functions in the backend.

View details
pkg/libarcane/edge/transport.go:59:6: unreachable func: GetActiveTunnelTransport
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 1a3a8fe

@getarcaneappbot
Copy link
Copy Markdown
Contributor

getarcaneappbot commented Mar 2, 2026

Container images for this PR have been built successfully!

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

Built from commit 65ff15a

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.

18 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment thread backend/internal/services/project_service.go Outdated
Comment thread types/settings/settings.go Outdated
Comment thread frontend/src/lib/stores/deploy-options.store.svelte.ts
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 2, 2026

Additional Comments (1)

frontend/src/lib/components/deploy-split-button/deploy-split-button.svelte
Hardcoded "Missing" label is not i18n-friendly

The "Always" and "Never" labels use m.common_always() / m.common_never(), but the "Missing" label is a hardcoded English string in three places (deploy-split-button.svelte, action-buttons.svelte, and DockerTab.svelte). A corresponding message key (e.g. deploy_pull_policy_missing_label) should be added to en.json and used here for consistency.

This same hardcoded string also appears at:

  • frontend/src/lib/components/action-buttons.svelte (two instances in the mobile and desktop dropdown menus)
  • frontend/src/routes/(app)/environments/[id]/components/DockerTab.svelte (label: 'Missing' in deployPullPolicyOptions)
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/lib/components/deploy-split-button/deploy-split-button.svelte
Line: 475-479

Comment:
**Hardcoded "Missing" label is not i18n-friendly**

The "Always" and "Never" labels use `m.common_always()` / `m.common_never()`, but the "Missing" label is a hardcoded English string in three places (`deploy-split-button.svelte`, `action-buttons.svelte`, and `DockerTab.svelte`). A corresponding message key (e.g. `deploy_pull_policy_missing_label`) should be added to `en.json` and used here for consistency.

This same hardcoded string also appears at:
- `frontend/src/lib/components/action-buttons.svelte` (two instances in the mobile and desktop dropdown menus)
- `frontend/src/routes/(app)/environments/[id]/components/DockerTab.svelte` (`label: 'Missing'` in `deployPullPolicyOptions`)

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex

@kmendell kmendell force-pushed the feat/compose-button-up branch from c172c1e to bec81dd Compare March 2, 2026 19:55
@kmendell
Copy link
Copy Markdown
Member Author

kmendell commented Mar 2, 2026

@greptileai

@kmendell kmendell force-pushed the feat/compose-button-up branch from bec81dd to 65ff15a Compare March 2, 2026 20:50
@kmendell kmendell merged commit f6bb8d2 into main Mar 3, 2026
23 of 24 checks passed
@kmendell kmendell deleted the feat/compose-button-up branch March 3, 2026 00:22
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