tickets
All repositories: gitoria
3.0 KB
// tests/purge94-seed.hl — the fixture of tests/purge94.mjs (mission 028, #94, identity rule): an EMPTY store (TICKETS_STORAGE,// TICKETS_ATTACHMENTS absolute) gets a FAKE project miserit-anthar with 94 tickets (no real data), and on #94: comments with files, an edit,// a comment edit + a comment deletion, a like, an assignment, a state note, relations to and from other tickets (#93 parent, #10 blocker, #30 child,// #50 blocked by it) and a subscription made at #90 (its cursor lies before #94's rows). Control rows live on other tickets and in a second project. Prints one JSON line.import { ensureUser, setUserName, createToken } from '../lib/users.hl'import { createProject, addMember } from '../lib/projects.hl'import { createTicket, addComment, changeComment, editTicket, changeState, assignTicket, setParent, changeBlocker } from '../lib/tickets.hl'import { createSubscription } from '../lib/subscriptions.hl'u = ensureUser('p94alice1')alice = setUserName(u.id, 'alice').userv = ensureUser('p94bob001')bob = setUserName(v.id, 'bob').usermine = createProject(alice, 'miserit-anthar', 'miserit-anthar', 'fixture').projectother = createProject(alice, 'other-proj', 'other-proj', '').projectaddMember(mine.id, bob.id, 'edit')ids = {}let n = 1let sub = nullwhile (n <= 94) {if (n == 90) { sub = createSubscription(alice, { projects = [mine.id] label = 'p94' }) }r = createTicket('miserit-anthar', 'fixture ticket ' + n, 'body of fixture ' + n, alice, '', '')ids['' + n] = r.ticket.idn = n + 1}o1 = createTicket('other-proj', 'other one', 'in the other project', alice, '', '')t94 = ids['94']c1 = addComment(t94, alice, 'first comment on the fixture', [{ name = 'pic.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-one') }])c2 = addComment(t94, bob, 'second comment', [{ name = 'doc.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-two') }])c3 = addComment(t94, alice, 'third comment, to be deleted', [{ name = 'gone.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-three') }])ctl = addComment(ids['5'], alice, 'a control comment', [{ name = 'keep.txt' type = 'text/plain' bytes = toBytes('control-bytes') }])changeComment(t94, c1.event.id, alice, 'edit', 'first comment, edited')changeComment(t94, c2.event.id, alice, 'like', '')changeComment(t94, c3.event.id, alice, 'delete', '')changeComment(ids['5'], ctl.event.id, alice, 'edit', 'control comment, edited')editTicket(t94, alice, 'fixture ticket 94 edited', 'an edited body')assignTicket(t94, alice, 'bob')changeState(t94, 'progress', alice, 'a state note')setParent(t94, alice, 'miserit-anthar#93')changeBlocker(t94, alice, 'miserit-anthar#10', true, '')setParent(ids['30'], alice, 'miserit-anthar#94')changeBlocker(ids['50'], alice, 'miserit-anthar#94', true, '')changeBlocker(ids['51'], alice, 'miserit-anthar#52', true, '')tok = createToken(alice.id, 'p94').tokenout = { alice = alice.id mine = mine.id other = other.id t94 = t94 t93 = ids['93'] t50 = ids['50'] t30 = ids['30'] t5 = ids['5'] t51 = ids['51'] token = tok sub = sub.subscription.id }console.log('SEED ' + JSON.stringify(out))
Branches
Latest commits
- bc3bdecerecords: day38b live, #94 purgedmre
- f6c5aa0dMerge main (records)mre
- e23d42acconnect gate: wait for hydration before clicking Disconnectmre
- a5d45d00records: D38 cause, GOmre
- 19eeb938records: D38 gates, two day38b failuresmre
- f8e42a85Re-vendor tickets to Hybriel set day38b (1e554d7)mre
- 51645016Merge purge-94 (#94, identity rule)mre
- 94d6ca2arecords: D38 startedmre
- 9df09aacmission 029: day38b re-vendor + deploymre
- d2834f65records: #94 backup planmre
- 4467d8cbrecords: #94 purge readymre
- aa2d124eREADME: the #94 purge gatemre
- e843ff7cOne-time purge of miserit-anthar#94 (#94, identity rule): idempotent step in lib/migrate.hl, fixture gate tests/purge94.mjsmre
- 506a4efdmission 028: #94, identity rulemre
- 78c7f48eRefine mpackdb holdmre
- 3d7d89c8Record mpackdb hold until day38mre
- f1bf7195#51 done; my subscription idmre
- 9870b945status: #51 proof greenmre
- e92173c6log: #51 live push proofmre
- 72d87041log: Hermes push livemre