kunibert
All repositories: gitoria
2.4 KB
$mode = 'static'import { run } from 'hl:proc'import { require } from './review-output.hl'// Read the optional ignore file from the exact PR HEAD, also before a worktree exists.vendoredPaths = (String repo, String head, Hybrid configured) => {prefixes = []for (p of configured) { if (p != '' && !prefixes.includes(p)) { prefixes.push(p) } }names = run(['git', 'ls-tree', '--name-only', head, '--', '.kunibertignore'], { cwd = repo, timeout = 30 })require(names.exit == 0, 'cannot look up .kunibertignore at PR head')if (!names.lines.includes('.kunibertignore')) { return prefixes }file = run(['git', 'show', head + ':.kunibertignore'], { cwd = repo, timeout = 30 })require(file.exit == 0, 'cannot read .kunibertignore at PR head')for (line of file.lines) {p = line.trim()if (p != '' && !p.startsWith('#') && !prefixes.includes(p)) { prefixes.push(p) }}return prefixes}isVendored = (String path, Hybrid prefixes) => {for (p of prefixes) { if (path.startsWith(p)) { return true } }return false}// Keep old keys stable, but settle these threads before thread updates and wake prompts.settleVendored = (Hybrid state, Hybrid prefixes) => {for (let i = 0; i < state.threads.length; i = i + 1) {t = state.threads[i]if (isVendored(t.path, prefixes)) {t.vendored = truet.settled = trueif (!state.settled.includes(t.key)) { state.settled.push(t.key) }state.threads[i] = t}}return state}// Only app findings enter applyResult: framework findings never get a thread key.appResult = (Hybrid result, Hybrid prefixes, Hybrid state, String link) => {app = []framework = []for (f of result.findings) {if (isVendored(f.path, prefixes)) { framework.push(f) } else { app.push(f) }}replies = []for (r of result.replies) {let vendored = falsefor (t of state.threads) { if (t.key == r.thread && t.vendored) { vendored = true } }if (!vendored) { replies.push(r) }}result.findings = appresult.framework = frameworkresult.replies = repliesresult.vendoredLink = linkif (prefixes.length > 0) {result.verdict = app.length == 0 ? 'approve' : 'comment'for (f of app) { if (f.severity == 'blocker' || f.severity == 'major') { result.verdict = 'request_changes' } }}return result}
Branches
Latest commits
- 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
- 75c6888drecords: gitoria#50 step 1 connected and provenmre
- aa6d997frecords: gitoria#50 connect plan, Anton reportmre
- 8a190ba7Records: kunibert#18 and #15 donemre