Repository navigation
fix: support Compose job runs in projects - #4877
Merged
Merged
Conversation
- 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
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
mainbranchm.*())What This PR Implements
Adds manual runs for Compose jobs and shows jobs and pre-start hooks in the project view.
arcane projects run-job <project> <job>.projects:jobs:run, granted to Editor, Deployer, and No-shell Editor. Migration 00117 grants it to stored roles and API keys that holdprojects:deploy.project.job.run. Failures are logged with error severity.--permissionacceptspermission@envId. The oldresource:action:envIdform 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 itsdepends_onjobs for a run.pkg/projects/cmds.go:ComposeRunJobruns the job through the Compose SDK.project/service.go,handler.go,module.go:RunProjectJobunder the project lock, streamed atPOST /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.listing,details,updater,auto_heal_job.go,container/service.go, andFindComposeServiceContainerID.pkg/authz: catalog entry and built-in role grants forprojects:jobs:run.migrations/00117_grant_projects_jobs_run.go: SQLite and Postgres up and down.settings,timeouts:jobRunTimeoutsetting.event,pkg/agent/commands.go:project.job.runevent and agent command mapping.CLI
cli/pkg/projects/actions.go:run-jobcommand.cli/pkg/admin/apikeys/cmd.go:permission@envIdparsing, 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.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:
pnpm run check.just format allandjust lint all.Not verified:
AI Tool Used (if applicable)
Additional Context
Known limits:
build:run only if the image already exists locally.arcane projects getdoes not list jobs.projects:jobs:run:env1. Useprojects: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.

Confidence 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.
@envIdsuffix.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