Skip to content

feat(ci): run independent jobs in parallel#380

Merged
zoetaka38 merged 1 commit into
mainfrom
feat/ci-parallel-jobs
Jul 7, 2026
Merged

feat(ci): run independent jobs in parallel#380
zoetaka38 merged 1 commit into
mainfrom
feat/ci-parallel-jobs

Conversation

@zoetaka38

Copy link
Copy Markdown
Contributor

Jobs previously ran one at a time in topological order. They now execute concurrently: each job starts as soon as every job in its needs has finished, so independent jobs run in parallel, bounded by a per-run semaphore.

Safety

Each job instance now owns a private log buffer + line counter (jobAccumulator) instead of sharing mutable maps; shared run state (results, per-job status, aggregate log, conclusion) is merged under a mutex only around quick bookkeeping — never during step execution. needs skipping and job-level if: are still honored; matrix instances still run sequentially within their job.

Verified

  • go test -race — no data races; new test proves two independent jobs run concurrently (each blocks on a barrier until the other starts, failing if sequential).
  • Live: three independent sleep 2 jobs + a gather job needing all three complete in ~4s wall-clock (vs ~6-8s sequential), gather runs only after a/b/c finish.

Jobs previously ran one at a time in topological order. They now execute
concurrently: each job starts as soon as every job in its `needs` has
finished, so independent jobs (and independent branches of the graph) run in
parallel, bounded by a per-run semaphore (maxParallelJobsPerRun).

To make this safe, each job instance now owns a private log buffer and line
counter (jobAccumulator) instead of sharing mutable maps; the shared run state
(results, per-job status, the aggregate log, the overall conclusion) is merged
under a mutex only around the quick bookkeeping, never during step execution.
`needs` skipping and job-level `if:` are still honored, and matrix instances
still run sequentially within their job.

Verified with the race detector (no data races) and live: three independent
`sleep 2` jobs plus a `gather` job that needs all three complete in ~4s
wall-clock instead of the ~6-8s a sequential run would take, with `gather`
correctly running only after a/b/c finish.
@orange-codens

orange-codens Bot commented Jul 7, 2026

Copy link
Copy Markdown

🍊 Orange Codens レビュー

指摘事項はありません。✨

head: 091b10a | 🍊 Reviewed by Orange Codens — AI code review & security audit

@zoetaka38
zoetaka38 merged commit 5f9f1c0 into main Jul 7, 2026
20 checks passed
@zoetaka38
zoetaka38 deleted the feat/ci-parallel-jobs branch July 7, 2026 06:07
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