Skip to content

fix: support Compose job runs in projects - #4877

Merged
kmendell merged 2 commits into
mainfrom
t3/74a4fa77
Nov 18, 2026
Merged

kmendell merged 2 commits into
mainfrom
t3/74a4fa77

Conversation

@kmendell

@kmendell kmendell commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Checklist

  • This PR is not opened from my fork's main branch
  • All new user-facing strings are translated via Paraglide (m.*())

What This PR Implements

Adds manual runs for Compose jobs and shows jobs and pre-start hooks in the project view.

  • Project Services tab lists jobs with their image and schedules, and shows each service's pre-start hooks.
  • Each job has a Run action. Output streams the same way a deploy does.
  • CLI: arcane projects run-job <project> <job>.
  • Hook runners and job runs are no longer counted as services in status, updater targets, auto-heal, or redeploy.
  • Job images are pulled on deploy with Arcane's registry auth.
  • New setting Job Run Timeout (default 1800 seconds) on the Timeouts page and the environment tab.
  • New permission projects:jobs:run, granted to Editor, Deployer, and No-shell Editor. Migration 00117 grants it to stored roles and API keys that hold projects:deploy.
  • New event project.job.run. Failures are logged with error severity.
  • CLI API keys: --permission accepts permission@envId. The old resource:action:envId form still works.

Requires an engine with API 1.57 and the Compose jobs extension. There is no one-off fallback.

Fixes: none. This is a new feature with no tracking issue.

Changes Made

Backend

  • pkg/projects/jobs.go: lists jobs and materializes one job with its depends_on jobs for a run.
  • pkg/projects/cmds.go: ComposeRunJob runs the job through the Compose SDK.
  • project/service.go, handler.go, module.go: RunProjectJob under the project lock, streamed at POST /agents/{id}/projects/{projectId}/jobs/{jobName}/run.
  • pkg/projects/image_refs.go, pull_policy.go, coordinator.go: job images are included in build refs, pull plans, and deploy preparation.
  • Hook runners and job containers are excluded in listing, details, updater, auto_heal_job.go, container/service.go, and FindComposeServiceContainerID.
  • pkg/authz: catalog entry and built-in role grants for projects:jobs:run.
  • migrations/00117_grant_projects_jobs_run.go: SQLite and Postgres up and down.
  • settings, timeouts: jobRunTimeout setting.
  • event, pkg/agent/commands.go: project.job.run event and agent command mapping.

CLI

  • cli/pkg/projects/actions.go: run-job command.
  • cli/pkg/admin/apikeys/cmd.go: permission@envId parsing, with the legacy form still accepted.

Frontend

  • project-jobs-panel.svelte (new), project-services-panel.svelte, and the project page: jobs panel and Run wiring.
  • project-service.ts, types/project.ts: run call and job types.
  • Timeouts page and environment timeouts tab: Job Run Timeout field.
  • Activity labels, filter, and toasts for project.job.run.
  • frontend/messages/en.json: new keys.

Tests

  • pkg/projects/jobs_test.go: job listing, materialization, dependency and manual-trigger handling.
  • database/database_test.go: migration 00117 up and down, plus the updated migration 102 expectations.
  • config/schema/schema_test.go: new setting key.

Testing Done

Reported passing on this branch:

  • Backend build and the narrow tests above.
  • pnpm run check.
  • just format all and just lint all.

Not verified:

  • No job has run against an engine with the jobs extension enabled.
  • The UI has not been checked in a browser.
  • Migration 00117 has only been run on SQLite. Its Postgres SQL follows the pattern of migration 00115 and has not been executed.
  • The CLI permission parser has no unit tests and has not been run against a server.

AI Tool Used (if applicable)

Additional Context

Known limits:

  • Tag updates do not cover job or hook images yet.
  • Jobs with build: run only if the image already exists locally.
  • arcane projects get does not list jobs.
  • The CLI rejects four-part permissions such as projects:jobs:run:env1. Use projects:jobs:run@env1.

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

To have Greptile Re-Review the changes, mention greptileai.

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

Adds manual Compose job runs from project pages and the CLI, with job permissions, activity records, image pulls, and a configurable timeout.

  • People can run a Compose job from a project or the CLI and watch its output.
  • Project pages show Compose jobs, their schedules, and each service’s pre-start hooks.
  • Project deploys prepare Compose job images alongside service images.
  • Hook runners and one-off job containers stay out of regular service handling.
  • API-key commands accept scoped permission names with an @envId suffix.

Review used source inspection. No runtime tests were run. Cross-repository checks were blocked by access permissions.

Reviews (2) · Last reviewed commit: "feat: translate bind volumes and inject ..." · Reviewed by Greptile

- Add POST /agents/{id}/projects/{projectId}/jobs/{jobName}/run to stream a manual `docker compose run` of a Compose job
- List project jobs (schedules, manual trigger, disabled state) in project details
- Add projects:jobs:run permission, included in the editor and deployer roles
- Migration 117 grants projects:jobs:run to roles and API keys that already have projects:deploy
- Add jobRunTimeout setting (default 1800 seconds)
- Hide job and compose hook runner containers from service lists, update checks, auto-heal, and redeploy
@kmendell
kmendell requested a review from a team November 18, 2026 19:46
Comment thread backend/internal/project/service.go Resolved
Comment thread backend/pkg/projects/jobs.go Resolved
Comment thread cli/pkg/projects/actions.go Resolved
- Translate bind mount sources for job volumes in host path mapping and file resource remapping
- Inject project environment variables into jobs and disabled jobs
- Remove the 30 minute client timeout for `project job run` in the CLI
- Key pre_start hook rows by value instead of index in the services panel
@kmendell kmendell changed the title feat: add manual Compose job runs to projects fix: support Compose job runs in projects Nov 18, 2026
@kmendell
kmendell merged commit be20c78 into main Nov 18, 2026
21 checks passed
@kmendell
kmendell deleted the t3/74a4fa77 branch November 18, 2026 21:45
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