gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainfe209ffeMerge branch 'w56-owner-members' into mainGitoriamain/tests/limits.mjs

21.3 KB

  1. import { requiredPort } from './gate-ports.mjs';
  2. // tests/limits.mjs — GATE OF THE APPS API's LIMITS AND READS (gitoria#47, contract docs/apps-api.md v1.3 §4–§6): the status read route (all apps' contexts, 404),
  3. // pull.statuses / pull.required, the tickets list, 413 / 400 on every write route, the rate limit (300 reads / 60 writes per minute per app by default; low values by env
  4. // GITORIA_LIMIT_READS / _WRITES / _WINDOW_MS in the second run; reads and writes counted apart, apps apart, a bad token not counted, a restart starts at zero).
  5. // node tests/limits.mjs (GITORIA_LIMITS_PORT required, GITORIA_LIMITS_IDENT_PORT required)
  6. import { spawn, spawnSync, execFileSync } from 'node:child_process';
  7. import { request } from 'node:http';
  8. import { mkdirSync, rmSync, writeFileSync, existsSync } from 'node:fs';
  9. import { dirname, join, resolve } from 'node:path';
  10. import { fileURLToPath } from 'node:url';
  11. import { startIdent } from './identkit.mjs';
  12. const HERE = dirname(fileURLToPath(import.meta.url));
  13. const APP = resolve(HERE, '..');
  14. const PORT = requiredPort('GITORIA_LIMITS_PORT'), IDENT_PORT = requiredPort('GITORIA_LIMITS_IDENT_PORT');
  15. const IDENT_DIR = process.env.GITORIA_GATE_IDENT_DIR || [resolve(APP, '../ident.worldapi.org'), '/media/STORAGE/projects/WorldAPI/ident.worldapi.org'].find(d => existsSync(join(d, 'project.hl')));
  16. const STORE = join(APP, '.scratch/limits-store');
  17. const J = JSON.stringify, sleep = (ms) => new Promise(r => setTimeout(r, ms));
  18. let passes = 0, failures = 0;
  19. const check = (label, ok, detail = '') => { console.log(`${ok ? 'ok ' : 'FAIL'} ${label}${ok ? '' : ' — ' + detail}`); if (ok) passes++; else failures++; };
  20. function raw(method, path, { host = `localhost:${PORT}`, headers = {}, body = null, cookie = null } = {}) {
  21. return new Promise((res, rej) => {
  22. const h = { host, ...headers }; if (cookie) h.cookie = cookie;
  23. if (body !== null) h['content-length'] = Buffer.byteLength(body);
  24. const r = request({ host: '127.0.0.1', port: PORT, method, path, headers: h }, (m) => { const c = []; m.on('data', d => c.push(d)); m.on('end', () => res({ status: m.statusCode, headers: m.headers, body: Buffer.concat(c).toString('latin1') })); });
  25. r.on('error', rej); if (body !== null) r.write(body); r.end();
  26. });
  27. }
  28. const get = (path, o = {}) => raw('GET', path, o);
  29. const errCode = (r) => { try { return JSON.parse(r.body).error.code; } catch { return null; } };
  30. const body = (r) => { try { return JSON.parse(r.body); } catch { return null; } };
  31. let server = null, log = '';
  32. function startServer(env) {
  33. log = '';
  34. const p = spawn(join(APP, 'bin/hybriel'), ['project.hl'], { cwd: APP, stdio: ['ignore', 'pipe', 'pipe'],
  35. env: { ...process.env, GITORIA_PORT: String(PORT), GITORIA_WATCH: '0', GITORIA_PUBLIC_URL: `http://localhost:${PORT}`, GITORIA_SSH_SECRET: 'sshsecret-limits-gate', GITORIA_TICKETS_URL: 'http://127.0.0.1:1', ...env } });
  36. p.stdout.on('data', d => log += d); p.stderr.on('data', d => log += d);
  37. server = p; return p;
  38. }
  39. async function up() { for (let i = 0; i < 960; i++) { try { if ((await get('/api/repos')).status === 200) return; } catch {} await sleep(250); } throw new Error('gitoria did not come up\n' + log); }
  40. const stop = async () => { if (server) { const p = server; server = null; p.kill(); await new Promise(r => p.once('exit', r)); } };
  41. let ident;
  42. try {
  43. rmSync(STORE, { recursive: true, force: true }); mkdirSync(STORE, { recursive: true });
  44. ident = await startIdent({ identDir: IDENT_DIR, workDir: join(STORE, 'ident'), port: IDENT_PORT });
  45. const alice = await ident.signIn('[email protected]');
  46. const BASE = `http://localhost:${PORT}`;
  47. const app = await ident.registerApp(alice, 'gitoria (limits gate)', [BASE]);
  48. const ENV = { GITORIA_STORAGE: join(STORE, 'mpackdb'), GITORIA_SESSIONS: join(STORE, 'sessions') + '/', GITORIA_GIT: join(STORE, 'git'), IDENT_URL: ident.base, IDENT_EXCHANGE_URL: ident.base, IDENT_API_KEY: app.key, IDENT_API_SECRET: app.secret };
  49. startServer(ENV); await up();
  50. const cookieOf = (r) => (r.headers['set-cookie'] || []).map(c => c.split(';')[0])[0] || null;
  51. const ck0 = cookieOf(await get('/'));
  52. const cb = await get('/login/callback?ident_code=' + await ident.selectorCode(alice, app, BASE) + '&next=%2F', { cookie: ck0 });
  53. const A = { cookie: cookieOf(cb) || ck0 };
  54. let n = 0;
  55. const face = async (event, payload, cookie = A.cookie) => {
  56. const r = await raw('POST', '/__hl/emit', { headers: { 'content-type': 'application/json' }, cookie, body: J({ t: 'emit', i: ++n, event, payload }) });
  57. let j = null; try { j = JSON.parse(r.body); } catch {}
  58. return j && j.value;
  59. };
  60. await face('gitoriaSaveName', ['Alice']);
  61. const tA = (await face('gitoriaMakeToken', ['a'])).token;
  62. const W = join(STORE, 'work'); mkdirSync(W, { recursive: true });
  63. const genv = { ...process.env, GIT_TERMINAL_PROMPT: '0', GIT_CONFIG_GLOBAL: '/dev/null', GIT_AUTHOR_NAME: 'a', GIT_AUTHOR_EMAIL: 'a@a', GIT_COMMITTER_NAME: 'a', GIT_COMMITTER_EMAIL: 'a@a' };
  64. const g = (...a) => execFileSync('git', a, { cwd: W, encoding: 'utf8', env: genv, stdio: ['ignore', 'pipe', 'pipe'] });
  65. const sh = (fn) => { try { return fn(); } catch (e) { return null; } };
  66. const urlOf = (host, path) => `http://a:${tA}@${host}.localhost:${PORT}/${path}`;
  67. const push = (host, path, ...refs) => sh(() => { g('push', '-q', urlOf(host, path), ...refs); return true; });
  68. const sha = () => g('rev-parse', 'HEAD').trim();
  69. g('init', '-q', '-b', 'main'); writeFileSync(join(W, 'README.md'), '# t\n'); g('add', '-A'); g('commit', '-q', '-m', 'init'); const initSha = sha();
  70. check('alice creates "pub" and "other"', !!(await face('gitoriaCreate', ['pub', 'p'])).repo && !!(await face('gitoriaCreate', ['other', 'o'])).repo);
  71. check('alice pushes main to pub and other', push('pub', 'pub.git', 'main') === true && push('other', 'other.git', 'main') === true);
  72. g('checkout', '-q', '-b', 'feat'); writeFileSync(join(W, 'a.txt'), 'a\n'); g('add', '-A');
  73. g('commit', '-q', '-m', '|||PR Add a', '-m', 'Fixes other-proj#7, bare #12 and gitoria.worldapi.org#3. See x#a and #0 and #12abc.');
  74. const h1 = sha();
  75. g('checkout', '-q', 'main'); g('checkout', '-q', '-b', 'feat2'); writeFileSync(join(W, 'b.txt'), 'b\n'); g('add', '-A'); g('commit', '-q', '-m', '|||PR Closes #5.');
  76. check('alice pushes the branches feat and feat2 (|||PR commits)', push('pub', 'pub.git', 'feat', 'feat2') === true);
  77. g('checkout', '-q', 'main'); g('checkout', '-q', '-b', 'lone'); writeFileSync(join(W, 'o.txt'), 'o\n'); g('add', '-A'); g('commit', '-q', '-m', 'only on other');
  78. const otherSha = sha();
  79. check('a commit that exists only in "other"', push('other', 'other.git', 'lone') === true);
  80. const addApp = (slug, name) => face('gitoriaAppAdd', [slug, name, 'https://kunibert.worldapi.org/hook']);
  81. const kK = await addApp('pub', 'Kunibert'), kO = await addApp('pub', 'Otto'), kX = await addApp('other', 'Xaver'), kZ = await addApp('pub', 'Zed');
  82. const tok = async (host, key) => JSON.parse((await raw('POST', '/api/apps/token', { host: `${host}.localhost:${PORT}`, headers: { authorization: 'Bearer ' + key } })).body).token;
  83. const tK = await tok('pub', kK.key), tO = await tok('pub', kO.key), tX = await tok('other', kX.key);
  84. const H = (host) => `${host}.localhost:${PORT}`;
  85. const call = (method, host, token, path, b = null) => raw(method, path, { host: H(host), headers: { ...(token ? { authorization: 'Bearer ' + token } : {}), 'content-type': 'application/json' }, body: b === null ? null : (typeof b === 'string' ? b : J(b)) });
  86. const st = (context, state) => ({ context, state, title: 't ' + context, summary: '**md**', url: null });
  87. // ---- 1. the status read route (v1.3) ------------------------------------------------------------------------------------------------
  88. const pK = await call('PUT', 'pub', tK, '/api/statuses/' + h1, st('kunibert', 'success'));
  89. const pO = await call('PUT', 'pub', tO, '/api/statuses/' + h1, st('lint', 'failure'));
  90. const sK = (body(pK) || {}).status || {};
  91. check('PUT answer: status has app {id,name} and head', pK.status === 200 && sK.app && sK.app.name === 'Kunibert' && /^[^ ]+$/.test(sK.app.id || '') && sK.head === h1 && sK.context === 'kunibert', pK.body);
  92. const gK = await call('GET', 'pub', tK, '/api/statuses/' + h1), gO = await call('GET', 'pub', tO, '/api/statuses/' + h1);
  93. const ctxs = (r) => ((body(r) || {}).statuses || []).map(s => s.context + ':' + s.state + ':' + s.app.name).sort().join(',');
  94. check('GET statuses/<sha>: 200 { statuses } with the contexts of BOTH apps (each with app, head, updated)', gK.status === 200 && ctxs(gK) === 'kunibert:success:Kunibert,lint:failure:Otto' && body(gK).statuses.every(s => s.head === h1 && /Z$/.test(s.updated) && s.app.id), gK.body);
  95. check('the other app reads the same list (it may read what it may not write)', gO.status === 200 && ctxs(gO) === ctxs(gK), gO.body);
  96. const empty = await call('GET', 'pub', tK, '/api/statuses/' + initSha);
  97. check('a sha of the repo with no status: 200 { statuses: [] }', empty.status === 200 && J(body(empty)) === '{"statuses":[]}', empty.body);
  98. const un = await call('GET', 'pub', tK, '/api/statuses/' + 'a'.repeat(40));
  99. check('a sha the repo does not have: 404 not_found (§6 shape)', un.status === 404 && errCode(un) === 'not_found' && body(un).error.message, un.status + un.body);
  100. const oth = await call('GET', 'pub', tK, '/api/statuses/' + otherSha);
  101. check('a sha that exists only in ANOTHER repo: 404 not_found on this one', oth.status === 404 && errCode(oth) === 'not_found', oth.body);
  102. const bad = await call('GET', 'pub', tK, '/api/statuses/zzz');
  103. check('a malformed sha: 404 not_found', bad.status === 404 && errCode(bad) === 'not_found', bad.body);
  104. check('no token: 401; a token of another repo: 404', (await call('GET', 'pub', null, '/api/pulls')).status === 401 && (await call('GET', 'pub', tX, '/api/statuses/' + h1)).status === 404);
  105. check('the same read on the other repo shows none of pub\'s statuses', (await call('GET', 'other', tX, '/api/statuses/' + otherSha)).status === 200 && J(body(await call('GET', 'other', tX, '/api/statuses/' + otherSha))) === '{"statuses":[]}');
  106. // ---- 2. pull.statuses and pull.required --------------------------------------------------------------------------------------------
  107. await face('gitoriaRequiredAdd', ['pub', kK.rows.find(x => x.name === 'Kunibert').id, 'kunibert']); await face('gitoriaRequiredAdd', ['pub', kO.rows.find(x => x.name === 'Otto').id, 'lint']);
  108. let p1 = body(await call('GET', 'pub', tK, '/api/pulls/1'));
  109. check('GET pulls/1: statuses = every context on the current head from every app, required = the owner\'s names', p1 && ctxs({ body: J({ statuses: p1.statuses }) }) === ctxs(gK) && J((p1.required || []).map(r => r.app.name + ':' + r.context).sort()) === '["Kunibert:kunibert","Otto:lint"]' && p1.required.every(r => r.app.id && Object.keys(r).sort().join() === 'app,context'), J(p1 && { s: p1.statuses, r: p1.required }));
  110. const lst = body(await call('GET', 'pub', tO, '/api/pulls?state=all'));
  111. check('GET pulls (list): the same two fields on every pull', lst && lst.pulls.length === 2 && lst.pulls.every(p => Array.isArray(p.statuses) && Array.isArray(p.required)) && lst.pulls.find(p => p.number === 1).statuses.length === 2 && lst.pulls.find(p => p.number === 2).statuses.length === 0);
  112. g('checkout', '-q', 'feat'); writeFileSync(join(W, 'a2.txt'), 'a2\n'); g('add', '-A'); g('commit', '-q', '-m', 'more'); const h2 = sha();
  113. check('push moves the head of PR 1', push('pub', 'pub.git', 'feat') === true);
  114. p1 = body(await call('GET', 'pub', tK, '/api/pulls/1'));
  115. check('after the push: pull.head is new, pull.statuses is EMPTY (the CURRENT head only), required unchanged', p1.head === h2 && p1.statuses.length === 0 && p1.required.length === 2, J(p1.statuses));
  116. check('the old head\'s statuses are still readable by sha', ctxs(await call('GET', 'pub', tK, '/api/statuses/' + h1)).includes('kunibert:success:Kunibert'));
  117. await call('PUT', 'pub', tO, '/api/statuses/' + h2, st('lint', 'pending'));
  118. p1 = body(await call('GET', 'pub', tK, '/api/pulls/1'));
  119. check('a status on the new head appears in pull.statuses (with app)', p1.statuses.length === 1 && p1.statuses[0].context === 'lint' && p1.statuses[0].state === 'pending' && p1.statuses[0].app.name === 'Otto', J(p1.statuses));
  120. const p2 = body(await call('GET', 'pub', tK, '/api/pulls/2'));
  121. check('pull with no status: statuses [] (an array, not null)', J(p2.statuses) === '[]');
  122. // ---- 3. tickets: explicit project#n always, bare #n only when the repo is connected (NOT connected here) ------------------------------
  123. check('tickets, repo NOT connected: only the explicit ones, no doubles; "#12", "#0", "#12abc", "x#a" are not listed', J(p1.tickets) === '["other-proj#7","gitoria.worldapi.org#3"]', J(p1.tickets));
  124. check('tickets, not connected: a bare "#5" before a full stop is not listed (no project known)', J(p2.tickets) === '[]', J(p2.tickets));
  125. // ---- 4. 413 and 400 on every write route -----------------------------------------------------------------------------------------------
  126. const writes = [['POST', '/api/pulls/1/reviews'], ['POST', '/api/pulls/1/comments'], ['POST', '/api/pulls/1/threads/x/replies'], ['POST', '/api/pulls/1/threads/x/resolve'], ['PUT', '/api/statuses/' + h1]];
  127. const bigBody = '{"body":"' + 'x'.repeat(1048576) + '"}';
  128. for (const [m, path] of writes) {
  129. const r413 = await call(m, 'pub', tK, path, bigBody);
  130. check(`${m} ${path.replace(/[0-9a-f]{40}/, '<sha>')}: a body over 1 MB → 413 too_large`, r413.status === 413 && errCode(r413) === 'too_large', r413.status + r413.body.slice(0, 120));
  131. let ok = true, why = '';
  132. for (const b of ['', 'hello', '[1,2]', '{"a":', '{', 'null', '123']) { const r = await call(m, 'pub', tK, path, b); if (r.status !== 400 || errCode(r) !== 'invalid_json') { ok = false; why += J(b) + '→' + r.status + ' '; } }
  133. check(`${m} ${path.replace(/[0-9a-f]{40}/, '<sha>')}: bodies that are not a JSON object → 400 invalid_json`, ok, why);
  134. }
  135. const broken = await call('POST', 'pub', tK, '/api/pulls/1/comments', '{"a":}x}');
  136. check('broken JSON inside braces: 400 invalid_json', broken.status === 400 && errCode(broken) === 'invalid_json', broken.status + broken.body);
  137. const afterBroken = await call('GET', 'pub', tK, '/api/pulls/1');
  138. check('the server answers the request after broken JSON', afterBroken.status === 200 && body(afterBroken)?.number === 1, afterBroken.status + afterBroken.body);
  139. const ex = await raw('POST', '/api/apps/exchange', { host: H('pub'), body: bigBody });
  140. check('POST /api/apps/exchange: over 1 MB → 413; not JSON → 400', ex.status === 413 && errCode(ex) === 'too_large' && (await raw('POST', '/api/apps/exchange', { host: H('pub'), body: 'nope' })).status === 400);
  141. const bigOk = await call('POST', 'pub', tK, '/api/pulls/1/comments', { body: 'y'.repeat(65536) });
  142. check('a body just under the limit (65,536 characters) is fine', bigOk.status === 201, bigOk.status + bigOk.body.slice(0, 100));
  143. // ---- 5. the default limits: 300 reads and 60 writes per minute, per app ----------------------------------------------------------------
  144. const tZ = await tok('pub', kZ.key); // write 1 of 60
  145. let w429 = null, wOk = 0;
  146. for (let i = 0; i < 60; i++) { const r = await call('PUT', 'pub', tZ, '/api/statuses/' + h1, '{"context":"","state":"x"}'); if (r.status === 429) { w429 = i; break; } wOk++; }
  147. const wLast = await call('PUT', 'pub', tZ, '/api/statuses/' + h1, '{"context":"","state":"x"}');
  148. check('default: the token call + 59 PUTs are answered (422), the 61st write of the minute is 429', w429 === null && wOk === 60 - 1 + 1 && wLast.status === 429 || (wOk === 59 && w429 === 59), `ok=${wOk} first429@${w429} last=${wLast.status}`);
  149. check('429: body code rate_limited, Retry-After is whole seconds 1..60', wLast.status === 429 && errCode(wLast) === 'rate_limited' && /^\d+$/.test(wLast.headers['retry-after'] || '') && Number(wLast.headers['retry-after']) >= 1 && Number(wLast.headers['retry-after']) <= 60, J(wLast.headers) + wLast.body);
  150. let r429 = null, rOk = 0;
  151. for (let i = 0; i < 300; i++) { const r = await call('GET', 'pub', tZ, '/api/deliveries'); if (r.status === 429) { r429 = i; break; } rOk++; }
  152. const rLast = await call('GET', 'pub', tZ, '/api/deliveries');
  153. check('default: 300 reads are answered (200), the 301st read of the minute is 429 — while the exhausted writes did not touch reads', r429 === null && rOk === 300 && rLast.status === 429 && errCode(rLast) === 'rate_limited' && Number(rLast.headers['retry-after']) >= 1, `ok=${rOk} first429@${r429} last=${rLast.status}`);
  154. check('Zed\'s limit does not touch another app (Kunibert reads and writes)', (await call('GET', 'pub', tK, '/api/pulls/1')).status === 200 && (await call('PUT', 'pub', tK, '/api/statuses/' + h1, st('kunibert', 'success'))).status === 200);
  155. check('the key and a token never appear in the server log', ![kK.key, kO.key, kX.key, kZ.key, tK, tO, tX, tZ].some(s => log.includes(s)));
  156. // ---- 6. a restart (a deploy swap) starts every count at zero; low limits by env; connect the repo to tickets ---------------------------
  157. await stop();
  158. const pr = spawnSync(join(APP, 'bin/hybriel'), ['tests/limits-probe.hl', 'pub', 'conn-proj'], { cwd: APP, env: { ...process.env, ...ENV }, encoding: 'utf8' });
  159. check('the probe connects "pub" to the tickets project conn-proj', /connected pub conn-proj/.test(pr.stdout), pr.stdout + pr.stderr);
  160. const WINDOW = 7000;
  161. startServer({ ...ENV, GITORIA_LIMIT_READS: '5', GITORIA_LIMIT_WRITES: '3', GITORIA_LIMIT_WINDOW_MS: String(WINDOW) }); await up();
  162. check('after the restart Zed is at zero again (the counts were in the process)', (await call('GET', 'pub', tZ, '/api/deliveries')).status === 200 && (await call('PUT', 'pub', tZ, '/api/statuses/' + h1, '{"context":"","state":"x"}')).status === 422);
  163. const t0 = Date.now();
  164. const reads = []; for (let i = 0; i < 7; i++) reads.push((await call('GET', 'pub', tK, '/api/pulls/1')).status);
  165. check('low limit: Kunibert\'s reads 1..5 are 200, the 6th and 7th are 429', J(reads) === '[200,200,200,200,200,429,429]', J(reads));
  166. const r6 = await call('GET', 'pub', tK, '/api/pulls/1');
  167. const ra = Number(r6.headers['retry-after']);
  168. check('429 carries Retry-After in whole seconds, no longer than the window', r6.status === 429 && /^\d+$/.test(r6.headers['retry-after'] || '') && ra >= 1 && ra <= Math.ceil(WINDOW / 1000), J(r6.headers));
  169. check('429 body: { error: { code: rate_limited, message } } as JSON', r6.status === 429 && errCode(r6) === 'rate_limited' && /json/.test(r6.headers['content-type'] || '') && !!body(r6).error.message, r6.body);
  170. const writesK = []; for (let i = 0; i < 5; i++) writesK.push((await call('PUT', 'pub', tK, '/api/statuses/' + h1, st('kunibert', 'success'))).status);
  171. check('reads and writes are counted apart: with its reads used up, Kunibert\'s writes 1..3 are 200 and the 4th and 5th are 429', J(writesK) === '[200,200,200,429,429]', J(writesK));
  172. check('and with its writes used up the reads stay 429 (own counter), a POST token call is a write too', (await call('GET', 'pub', tK, '/api/pulls/1')).status === 429 && (await raw('POST', '/api/apps/token', { host: H('pub'), headers: { authorization: 'Bearer ' + kK.key } })).status === 429);
  173. const otto = []; for (let i = 0; i < 2; i++) otto.push((await call('GET', 'pub', tO, '/api/pulls/1')).status);
  174. otto.push((await call('PUT', 'pub', tO, '/api/statuses/' + h1, st('lint', 'failure'))).status);
  175. check('apps are counted apart: Otto (same repo) is not affected by Kunibert\'s 429s', J(otto) === '[200,200,200]', J(otto));
  176. check('Xaver on another repo too', (await call('GET', 'other', tX, '/api/statuses/' + otherSha)).status === 200);
  177. const bads = []; for (let i = 0; i < 8; i++) bads.push((await call('GET', 'pub', 'gat_' + 'c'.repeat(40), '/api/pulls/1')).status);
  178. bads.push((await call('GET', 'other', tO, '/api/pulls/1')).status, (await call('GET', 'pub', null, '/api/pulls')).status);
  179. check('a bad token (401), no token, and a token on another repo (404) are NOT counted: Otto still has reads left', J(bads) === '[401,401,401,401,401,401,401,401,404,401]' && (await call('GET', 'pub', tO, '/api/pulls/1')).status === 200, J(bads));
  180. const left = WINDOW - (Date.now() - t0);
  181. await sleep(Math.max(0, left) + 400);
  182. check('after the minute (window) the counts restart: Kunibert reads and writes are 200 again', (await call('GET', 'pub', tK, '/api/pulls/1')).status === 200 && (await call('PUT', 'pub', tK, '/api/statuses/' + h1, st('kunibert', 'success'))).status === 200);
  183. // ---- 7. tickets with the repo connected: a bare #n is listed under the project -------------------------------------------------------------
  184. p1 = body(await call('GET', 'pub', tO, '/api/pulls/1'));
  185. check('tickets, repo CONNECTED (conn-proj): explicit ones as written, the bare "#12" under the project, order of appearance, no doubles', J(p1.tickets) === '["other-proj#7","conn-proj#12","gitoria.worldapi.org#3"]', J(p1.tickets));
  186. const p2c = body(await call('GET', 'pub', tO, '/api/pulls/2'));
  187. check('tickets, connected: "Closes #5." (number before a full stop) → conn-proj#5', J(p2c.tickets) === '["conn-proj#5"]', J(p2c.tickets));
  188. check('the key and a token never appear in the server log (second run)', ![kK.key, kO.key, kX.key, kZ.key, tK, tO, tX, tZ].some(s => log.includes(s)));
  189. } catch (e) {
  190. check('the gate ran without an exception', false, String(e && e.stack || e));
  191. } finally {
  192. await stop().catch(() => {});
  193. try { ident && ident.stop && await ident.stop(); } catch {}
  194. console.log(`\n${passes} passed, ${failures} failed`);
  195. process.exit(failures ? 1 : 0);
  196. }

Branches

Latest commits

  • fe209ffeMerge branch 'w56-owner-members' into mainGitoria
  • fa0754c8|||PR repository owner transfer and members API (#55)mre
  • 8862e537Merge branch 'w55-rename-org' into mainGitoria
  • 014d2b7fOne immutable readers snapshot per move for the left-organization event (#53)mre
  • 1859d506Decide who hears a repo left its organization by its readers before the move (#53)mre
  • 499f25f2Review fixes for the Settings organization move (#53)mre
  • ed3b922b|||PR move a repository into an organization in Settings (#53)mre
  • 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
  • 9f7ce8d8Preserve rename compatibility and live page titlesmre
  • c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
  • ce08920dMerge branch 'w52c-header-phone' into mainGitoria
  • 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
  • e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
  • c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
  • 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
  • 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre
  • 69141f65|||PR pulls page: cache the git part per repo by branch tipsmre
  • 155861f6Merge branch 'w52-person-approval' into mainGitoria
  • b5435de8|||PR person approvals: second Kunibert round (#52)mre
  • 3a8b2fb8|||PR person approvals: Kunibert review fixes (#52)mre