gitoria
All repositories: gitoria
1.7 KB
// lib/pullsync-helpers.hl — what lib/pullsync.hl looks up: the body of a commit message, the ticket names a text mentions,// one first line of git's answer. Statics only; git is not called here except through the `lines` handed in.import { NL } from './util.hl'// the commit message's lines → the text after the subject, without the blank line that separates them ('' if none)static bodyOfLines = (lines) => {let i = 1while (i < lines.length && lines[i].trim() == '') { i = i + 1 }out = []while (i < lines.length) {out.push(lines[i])i = i + 1}return out.join(NL).trimEnd()}static nameCode = (c) => {return (c >= 48 && c <= 57) || (c >= 65 && c <= 90) || (c >= 97 && c <= 122) || c == 45 || c == 46 || c == 95}static digitCode = (c) => { return c >= 48 && c <= 57 }// the tickets a text names, as `project#n` (contract §4): an explicit `project#12` is always listed; a bare `#12` only// when the repo is connected to a project (`project` is '' otherwise). No doubles, at most 50.static ticketNames = (text, project) => {out = []if (text == null || hlTypeName(text) != 'String') { return out }let i = 0while (i < text.length && out.length < 50) {if (text[i] == '#') {let j = i + 1while (j < text.length && j - i - 1 < 9 && digitCode(text.charCodeAt(j))) { j = j + 1 }let k = iwhile (k > 0 && nameCode(text.charCodeAt(k - 1))) { k = k - 1 }digits = text.slice(i + 1, j)after = j >= text.length || !nameCode(text.charCodeAt(j))if (j > i + 1 && after && digits.slice(0, 1) != '0') {name = k < i ? text.slice(k, i) : projectif (name != null && name != '' && !out.includes(name + '#' + digits)) { out.push(name + '#' + digits) }}i = j > i + 1 ? j : i + 1} else {i = i + 1}}return out}
Branches
- f1-broken-json
- f2-api-bugs
- gp-gate-ports
- heap-revert
- hl25-records
- ident-chooser-selector
- mainmain branch
- p51-public-pr-reads
- records-1112
- s25-no-session-on-login-error
- v59
- w52-person-approval
- w52b-approval-followup
- w52c-header-phone
- w53-pulls-speed-pr
- w54-repo-rename-pr
- w55-rename-org
- w56-owner-members
- w62-pr-close
- w63-force-push
- w64-org-slash
Latest commits
- 54927c9cgitoria#46: PR statuses and required checks before merge (merge w46-status)mre
- 187e1871gitoria#46: badges without decorative bordersmre
- 6b022798gitoria#46: tests/status.mjs in GATESmre
- c6162f00gitoria#46: status badges on /pulls, Required before merge in Settingsmre
- e5a0b64egitoria#46: PUT statuses/<sha>, required contexts block the merge on the servermre
- 26a140e3gitoria#44: reviews, inline threads, replies, conversation for apps (merge w44-reviews)mre
- 888dbf87gitoria#44: unknown API paths answer the contract's JSON 404 and sit above the page routesmre
- ea587d90gitoria#44: reviews with inline threads, replies, resolve and the PR conversation for apps (lib/reviews.hl, tests/reviews.mjs)mre
- 49533a50gitoria#43: signed events to connected apps (merge w43-events)mre
- 1a1e87d5gitoria#43: the sender never writes the apps row; Settings shows the newest deliverymre
- cd442066gitoria#43: app-auth unit test reads the apps table from its new filemre
- 5dccbe38gitoria#43: in-flight rows are left alone by the other process; gate in deploy.sh; READMEmre
- 8c8805f3merge main (gitoria#42), delivery log and redelivery routes, sweep fixmre
- 5a996ea8gitoria#42: short-lived app tokens, read-only git fetch with them (merge w42-app-token)mre
- afdb0cbfgitoria#43: rename the moved helper (name clash in the browser build)mre
- 15e01e94gitoria#43: tests/events.mjs and its probemre
- 77829b73gitoria#43: signed events to connected apps (deliveries table, sender timer, pull_request events, ping)mre
- b5d696fegitoria#42: app tokens (gat_, one hour), appOfRequest, app token as the git read passwordmre
- 1997e77dgitoria#40: stable PR numbers, refs/pull/N/head, ssh pushes reach the app (merge w40-pr-number)mre
- 9364fb16gitoria#40: ssh pushes call /__git/pushed before and after (ensurePulls, notifyPush, syncPulls); gate over the sshd imagemre