kunibert
All repositories: gitoria
2.1 KB
import WebFramework from 'hl:web'import { args } from 'hl:proc'import { readFile } from 'hl:fs'import { every } from 'hl:time'import Intake from '../lib/intake.hl'\\ MAP (kunibert#5 step 1): the gitoria event hook and the job queue.\\ POST /hook/gitoria lib/intake.hl (checks, answers) -> lib/gitoria-events.hl (event names) -> lib/queue.hl (jobs, worker)\\ GET /health lib/intake.hl -> lib/queue.hl health\\ timer tick lib/queue.hl tick -> lib/run-job.hl runJob\\ Run: HL_ENV=production hybriel service <config.json> config: { port, host (default 127.0.0.1), dataDir, tickSeconds, maxParallel (default 3, minimum 1), 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) }config = JSON.parse(readFile(args()[0]))port = config.portopt = (v, d) => { if (v == null) { return d } return v }\\ optional: reposFile (per-repo config), hybriel (runtime binary), jobTimeoutSeconds (default 900), runnerDataintake = new Intake(secretsFile = opt(config.secretsFile, ''), dataDir = config.dataDir, maxTries = config.maxTries, maxParallel = opt(config.maxParallel, 3), 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, ''))intake.start()routes = [{ pattern = "/hook/gitoria" method = "POST" function = (route, req) => { return intake.hook(req) } }{ pattern = "/health" function = (route, req) => { return intake.health() } }]ticker = every(config.tickSeconds)on ticker.tick(t) { intake.tick() }webFrameworkServer = new WebFramework(routes = routes, port = port, host = opt(config.host, '127.0.0.1'), watchMode = false)
Branches
Latest commits
- 402bfeb0|||PR runner: the model run uses the job's time limit (jobTimeoutSeconds), not a fixed 900 smre
- 8d34ca33records: repo rename (gitoria#53)mre
- 1e05cb3fMerge branch 'repo-rename' into mainKunibert
- 6ee0d2e9|||PR intake: match a delivery by repo.id and signature, not URLs (gitoria#53 rename)mre
- 900ffcd4status: routgermre
- 59b0b793log: routger merge waitmre
- e52f094alog: routger intake check (hycon#122)mre
- f979027frecords: design rule livemre
- 71efaf84Merge branch 'design-guard' into mainKunibert
- c0656581|||PR Flag removal of a documented design as major unless his recorded yes is linked; rules version 5mre
- 901cdd75records: L10 update 2 livemre
- 4a68016bMerge branch 'hl-standard-l10b' into mainKunibert
- 246d0f30|||PR HL-STANDARD L10 update (hybriel ab293e5a), rules version 4mre
- 1aa4d64crecords: HL-STANDARD L10 update livemre
- 2b04c240Merge branch 'hl-standard-l10' into mainKunibert
- 88c7b09d|||PR HL-STANDARD L10 update (hybriel 5885d688), rules version 3mre
- 00869ecbrecords: gitoria#50 step 3 livemre
- f97a0e5fMerge branch 'hl-standard' into mainKunibert
- 9710e39fType STANDARD as String (L10, Kunibert review)mre
- 4140b664|||PR Review against HL-STANDARD and cite rule ids (gitoria#50 step 3)mre