forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 37e985d7446f13ea8d71da4ff0e8d2d11d64a25fFiltered to crates/forge-runner/src/runner.rsClear filter

Today

🐛 fix: the runner waits out a forge restart while uploading artifacts, as it already did for the job result; a 503 at the end no longer fails a finished runAhmet Kaan Gümüş · e910f7e
🐛 fix: the runner waits out a forge restart while uploading artifacts, as it already did for the job result; a 503 at the end no longer fails a finished run

Yesterday

♻️ refactor: runner memory is one box (RAM minus kept-for-host) shared by all jobs, swap left to the OS, concurrency the only gate; drops reservations, pressure parking and requeue. Fixes: log upload retries transient failures instead of dropping the rest of the log, running jobs spin and their live step pulses, wiki hides its empty page railAhmet Kaan Gümüş · d75b65d
♻️ refactor: runner memory is one box (RAM minus kept-for-host) shared by all jobs, swap left to the OS, concurrency the only gate; drops reservations, pressure parking and requeue. Fixes: log upload retries transient failures instead of dropping the rest of the log, running jobs spin and their live step pulses, wiki hides its empty page rail
♻️ refactor: leftover cross-crate simplification (signed-token helper, NewPull, settings table, row helpers, strings! i18n macro, csrf form, RepoCtx helpers, shared page and e2e helpers, ci config split, one time helper set); fixes: runner reported labels survive override clears, milestone titles repaired from the swapped update bug, runner helper lines can no longer be spoofed by job output, rootfs GC no longer touches other id ranges, restart only labels jobs it cancelled, artifact quota re-checked in the store write, LFS gc and upload share a lock, OCI orphan blobs swept, mirror worker no longer spins on syncing mirrors, merge queue fails missing checks after the job timeout and resumes after restart, post_update walks every pushed commit, close-with-comment is one transaction, pull create is retry-safeAhmet Kaan Gümüş · c3c44bb
♻️ refactor: leftover cross-crate simplification (signed-token helper, NewPull, settings table, row helpers, strings! i18n macro, csrf form, RepoCtx helpers, shared page and e2e helpers, ci config split, one time helper set); fixes: runner reported labels survive override clears, milestone titles repaired from the swapped update bug, runner helper lines can no longer be spoofed by job output, rootfs GC no longer touches other id ranges, restart only labels jobs it cancelled, artifact quota re-checked in the store write, LFS gc and upload share a lock, OCI orphan blobs swept, mirror worker no longer spins on syncing mirrors, merge queue fails missing checks after the job timeout and resumes after restart, post_update walks every pushed commit, close-with-comment is one transaction, pull create is retry-safe
  • ✗ci/buildjob was cancelledDetails
♻️ refactor: forge-runner and forge-web-base drop dead code, duplicated parsing and stale comments; fixes: memory.high no longer drops to 0 on small boxes, log lines are cut at MAX_LINE exactly, a half-installed image rootfs is replaced on retry, register resolves local paths before using the one-time token, strip_ansi keeps the char after a lone ESCAhmet Kaan Gümüş · 68935b0
♻️ refactor: forge-runner and forge-web-base drop dead code, duplicated parsing and stale comments; fixes: memory.high no longer drops to 0 on small boxes, log lines are cut at MAX_LINE exactly, a half-installed image rootfs is replaced on retry, register resolves local paths before using the one-time token, strip_ansi keeps the char after a lone ESC

2026-11-30

2026-11-04

🐛 fix: a job stopped under memory pressure has its workspace removed before it goes back to the queue, so a free slot on the same runner that claims it again no longer has its folder deleted under it (git init: cannot change to the work folder); a forge restart or self-update no longer fails running jobs: after boot nothing is reaped for two minutes, so runners report in first, and a runner keeps offering a finished job's result for up to ten minutes while the forge cannot be reached, giving up early only when the forge refuses it 📝 docs: CI says what a forge restart does to running jobsAhmet Kaan Gümüş · 529f562
🐛 fix: a job stopped under memory pressure has its workspace removed before it goes back to the queue, so a free slot on the same runner that claims it again no longer has its folder deleted under it (git init: cannot change to the work folder); a forge restart or self-update no longer fails running jobs: after boot nothing is reaped for two minutes, so runners report in first, and a runner keeps offering a finished job's result for up to ten minutes while the forge cannot be reached, giving up early only when the forge refuses it 📝 docs: CI says what a forge restart does to running jobs
  • ✗ci/buildjob was cancelledDetails

2026-10-29

✨ feat(ci): a runner's page answers what it is working on and how its host is doing: a Jobs tab lists the jobs it runs now and its last 20 finished ones, each with its run, how long it ran and how long it waited in the queue (the Running jobs stat links there, and ci_jobs gets an index on runner_id, started_at); a Metrics tab graphs the last hour of CPU (with the time jobs ran shaded), memory against the total and network received and sent, from samples the runner takes from /proc every 5 s and sends every 10 s; the graphs are server-drawn SVG in the accent colour with a hover readout per 30 s and a table view, and the forge keeps the samples in memoryAhmet Kaan Gümüş · 42861fb
✨ feat(ci): a runner's page answers what it is working on and how its host is doing: a Jobs tab lists the jobs it runs now and its last 20 finished ones, each with its run, how long it ran and how long it waited in the queue (the Running jobs stat links there, and ci_jobs gets an index on runner_id, started_at); a Metrics tab graphs the last hour of CPU (with the time jobs ran shaded), memory against the total and network received and sent, from samples the runner takes from /proc every 5 s and sends every 10 s; the graphs are server-drawn SVG in the accent colour with a hover readout per 30 s and a table view, and the forge keeps the samples in memory
⚡ perf: forge uses about a quarter less memory: the server turns off transparent huge pages at start (mimalloc's 2 MiB pages counted whole: 166 → 123 MB after a seeded 600-page crawl, 63 → 40 MB at boot) and the unit sets MIMALLOC_ALLOW_THP=0; worst cases are bounded across the crates: gix's delta cache is 16 MB per open, not 96 MB; blob reads don't copy and text reads check the size first; file listings, git stderr, grep lines and fsck output are capped; readers keep a 2 MiB page cache; the advisory import and the issue export stream in batches and an import commits only when parsing finished; imported release assets stream to storage; argon2 (4) and avatar decodes (2) are capped server-wide; SSH takes at most 256 connections; watcher, fork and admin counts are SQL counts; the runner keeps a 2 MiB log tail per job, drops output once nothing reads it, stops artifact walks at the cap and refuses image configs over 4 MiBAhmet Kaan Gümüş · cae5972
⚡ perf: forge uses about a quarter less memory: the server turns off transparent huge pages at start (mimalloc's 2 MiB pages counted whole: 166 → 123 MB after a seeded 600-page crawl, 63 → 40 MB at boot) and the unit sets MIMALLOC_ALLOW_THP=0; worst cases are bounded across the crates: gix's delta cache is 16 MB per open, not 96 MB; blob reads don't copy and text reads check the size first; file listings, git stderr, grep lines and fsck output are capped; readers keep a 2 MiB page cache; the advisory import and the issue export stream in batches and an import commits only when parsing finished; imported release assets stream to storage; argon2 (4) and avatar decodes (2) are capped server-wide; SSH takes at most 256 connections; watcher, fork and admin counts are SQL counts; the runner keeps a 2 MiB log tail per job, drops output once nothing reads it, stops artifact walks at the cap and refuses image configs over 4 MiB

2026-10-28

🐛 fix: a builtin job without `memory` gets the runner's memory budget as its cgroup limit, as docs/ci.md says, instead of limits.memory (4g), which OOM-killed rustc in cargo testAhmet Kaan Gümüş · bdd842c
🐛 fix: a builtin job without `memory` gets the runner's memory budget as its cgroup limit, as docs/ci.md says, instead of limits.memory (4g), which OOM-killed rustc in cargo test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-10-21

✨ feat: the runner parks the youngest job in swap under memory pressure instead of letting the kernel killAhmet Kaan Gümüş · 197fa34
✨ feat: the runner parks the youngest job in swap under memory pressure instead of letting the kernel kill

Jobs now live in a runner-owned box cgroup capped at the memory budget. An inotify watch on
memory.events and a PSI trigger wake a controller that freezes the youngest job, pushes it to swap,
and thaws it when there is room. A job that cannot be parked is killed and requeued. Admission waits
on the controller instead of a timer, memory declarations in ci.toml are now optional.
✨ feat: the runner reports OOM kills from the job cgroup, shown on the job page and in alertsAhmet Kaan Gümüş · edff93b
✨ feat: the runner reports OOM kills from the job cgroup, shown on the job page and in alerts

A killed rustc leaves cargo exiting 101 with the signal only in the log, so the exit code
and message checks missed it. The helper reads memory.events (oom, oom_kill) before the
cgroup is deleted, the runner sends oom_killed and oom_kills in the finish body, the forge
stores them, the job page says killed: out of memory and the killed-job alert fires on it,
with the old exit code and message matches kept as a fallback.

2026-10-20

✨ feat: memory-aware job admission so a runner never over-commits its RAMAhmet Kaan Gümüş · 69c5821
✨ feat: memory-aware job admission so a runner never over-commits its RAM

A job can declare memory in ci.toml. A runner admits a job only when the
reservations of its running jobs plus the new one fit its memory budget
(MemTotal minus headroom by default, swap ignored), tells the forge how much
it can admit on every claim, and the forge hands out the first queued job that
fits. A job that waited 5 minutes and does not fit stops smaller jobs passing
it. Each job's cgroup gets memory.max of its declared memory plus slack, with
swap off. Budget and default reservation are live settings on the runner page,
which also shows budget, reserved and free. Old runners and forges keep the
old behaviour. forge's own ci.toml declares 4g for test and build.
✨ feat: restart a runner from the admin pages, after its jobs or nowAhmet Kaan Gümüş · 767f2d0
✨ feat: restart a runner from the admin pages, after its jobs or now

A runner that advertises the restart capability gets the request in the claim answer or heartbeat, stops claiming, drains or cancels its jobs and exits 75. The request clears when it reports a new boot id.
✨ feat: show a real build identity (commit, date) for server and runnersAhmet Kaan Gümüş · 1979f80
✨ feat: show a real build identity (commit, date) for server and runners

Embeds the git short sha and commit date at build time (forge-ci build.rs, env fallback, then unknown). forge --version, /admin/server and /admin/health show it. Runners report it on claim and heartbeat, it is stored (migration 0056), and /admin/runners and the runner page show it with an up to date, outdated or unknown badge.
✨ feat: live runner config and server settings in admin UIAhmet Kaan Gümüş · 8609bad
✨ feat: live runner config and server settings in admin UI

- Runner config: per-runner concurrency and labels editable live from
  /admin/runners, applied via heartbeat/claim header with no restart; the
  runner limiter resizes without killing running jobs
- Runner detail page at /admin/runners/{id} shows every runner.toml field
  with source and kind (live / restart needed / read-only), secrets redacted,
  with live SSE updates
- New GET/PUT /api/v1/ci/runners/config endpoints; migrations 0044, 0045
- Server settings at /admin/server: DB-backed overrides over the config file
  (UI > file > default), five tabs, per-field live / restart / read-only /
  write-only secret kinds, reset to file value
- Shared AppState::live() handle, validation via Config::validate, saves
  audited by key only; migration 0046

2026-10-18

⚡ perf(ci): per-branch build cache kept on the runnerAhmet Kaan Gümüş · fabd8b3
⚡ perf(ci): per-branch build cache kept on the runner

- Jobs list workspace paths to keep with `cache = ["target"]`.
- The runner moves a same-branch entry into the checkout and back after the run; a new
  branch starts from a copy of its base or default branch entry.
- The server picks the scope from the run's trigger: pushes write `ref:<ref>`, pull requests
  only `pr:<n>`, so a PR can never seed the cache a deploy build reuses.
- `cache_max_gib` (default 20, 0 = off) evicts the least recently saved entries.

🐛 deploy: exit 75 is a deliberate restart, not a failure. Without SuccessExitStatus the
OnFailure rollback ran on every self-update and restored the previous binary.

2026-10-17

🚀 feat: self-update on green ci and repo workflowAhmet Kaan Gümüş · 4c18432
🚀 feat: self-update on green ci and repo workflow

- forge swaps its binary when a push to main passes CI (artifact dist_forge), keeps .prev, exits 75 for systemd restart
- runners update from the server's binary when idle via claim headers
- systemd user units with OnFailure rollback and a .bad list
- .forge/ci.toml runs test and build

2026-10-16

🎉 feat: initial commit of forgeAhmet Kaan Gümüş · 50bfaf3
🎉 feat: initial commit of forge

Self-hosted git forge in Rust: web UI, SSH and smart HTTP git,
issues, pull requests with reviews and merge rules, CI with a
sandboxed runner, webhooks, notifications, releases, LFS, mirrors,
replication and scheduled backups.