gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit07025b9907025b99Open the job worktree read-only for the review user before each model runKunibert07025b99/service/project.hl

2.0 KB

  1. import WebFramework from 'hl:web'
  2. import { args } from 'hl:proc'
  3. import { readFile } from 'hl:fs'
  4. import { every } from 'hl:time'
  5. import Intake from '../lib/intake.hl'
  6. \\ MAP (kunibert#5 step 1): the gitoria event hook and the job queue.
  7. \\ POST /hook/gitoria lib/intake.hl (checks, answers) -> lib/gitoria-events.hl (event names) -> lib/queue.hl (jobs, worker)
  8. \\ GET /health lib/intake.hl -> lib/queue.hl health
  9. \\ timer tick lib/queue.hl tick -> lib/run-job.hl runJob
  10. \\ Run: HL_ENV=production hybriel service <config.json> config: { port, host (default 127.0.0.1), dataDir, tickSeconds, maxTries, backoffSeconds, reposFile, secretsFile (optional default secret), hybriel, jobTimeoutSeconds, runnerData, ticketsBase (optional), ticketsTokenFile (optional), reviewUser (optional: unix user the model runs as), codexBin (default codex), workDir (optional: where job worktrees go) }
  11. config = JSON.parse(readFile(args()[0]))
  12. port = config.port
  13. opt = (v, d) => { if (v == null) { return d } return v }
  14. \\ optional: reposFile (per-repo config), hybriel (runtime binary), jobTimeoutSeconds (default 900), runnerData
  15. intake = new Intake(secretsFile = opt(config.secretsFile, ''), dataDir = config.dataDir, maxTries = config.maxTries, backoffSeconds = config.backoffSeconds, reposFile = opt(config.reposFile, ''), hybriel = opt(config.hybriel, 'hybriel'), timeoutSeconds = opt(config.jobTimeoutSeconds, 900), runnerData = opt(config.runnerData, ''), ticketsBase = opt(config.ticketsBase, ''), ticketsTokenFile = opt(config.ticketsTokenFile, ''), reviewUser = opt(config.reviewUser, ''), codexBin = opt(config.codexBin, 'codex'), workDir = opt(config.workDir, ''))
  16. intake.start()
  17. routes = [
  18. { pattern = "/hook/gitoria" method = "POST" function = (route, req) => { return intake.hook(req) } }
  19. { pattern = "/health" function = (route, req) => { return intake.health() } }
  20. ]
  21. ticker = every(config.tickSeconds)
  22. on ticker.tick(t) { intake.tick() }
  23. webFrameworkServer = new WebFramework(routes = routes, port = port, host = opt(config.host, '127.0.0.1'), watchMode = false)

Branches

Latest commits

  • 07025b99Open the job worktree read-only for the review user before each model runKunibert
  • 2a44bd54Runner CLI: --review-user/--codex-bin/--work-dir work in every modeKunibert
  • 2177f66fReview model runs as its own unix user (reviewUser, codexBin, workDir)Kunibert
  • 35df8306Records: live service on byrodin, real proof part 1Kunibert
  • 7480a98dkunibert.service: SIGTERM stop is a clean exitKunibert
  • 3a8d93f9gitoria client: parse only JSON answers, accept a plain-text errorKunibert
  • c9b48bfeVendor Hybriel plugins; deploy ships bin/ from zig-outKunibert
  • a41ba15fKunibert: event intake, git cache, review runner, posting, linked tickets, deploy filesKunibert