gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitbc3bdecebc3bdecerecords: day38b live, #94 purgedmrebc3bdece/tests/purge94-seed.hl

3.0 KB

  1. // tests/purge94-seed.hl — the fixture of tests/purge94.mjs (mission 028, #94, identity rule): an EMPTY store (TICKETS_STORAGE,
  2. // TICKETS_ATTACHMENTS absolute) gets a FAKE project miserit-anthar with 94 tickets (no real data), and on #94: comments with files, an edit,
  3. // 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,
  4. // #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.
  5. import { ensureUser, setUserName, createToken } from '../lib/users.hl'
  6. import { createProject, addMember } from '../lib/projects.hl'
  7. import { createTicket, addComment, changeComment, editTicket, changeState, assignTicket, setParent, changeBlocker } from '../lib/tickets.hl'
  8. import { createSubscription } from '../lib/subscriptions.hl'
  9. u = ensureUser('p94alice1')
  10. alice = setUserName(u.id, 'alice').user
  11. v = ensureUser('p94bob001')
  12. bob = setUserName(v.id, 'bob').user
  13. mine = createProject(alice, 'miserit-anthar', 'miserit-anthar', 'fixture').project
  14. other = createProject(alice, 'other-proj', 'other-proj', '').project
  15. addMember(mine.id, bob.id, 'edit')
  16. ids = {}
  17. let n = 1
  18. let sub = null
  19. while (n <= 94) {
  20. if (n == 90) { sub = createSubscription(alice, { projects = [mine.id] label = 'p94' }) }
  21. r = createTicket('miserit-anthar', 'fixture ticket ' + n, 'body of fixture ' + n, alice, '', '')
  22. ids['' + n] = r.ticket.id
  23. n = n + 1
  24. }
  25. o1 = createTicket('other-proj', 'other one', 'in the other project', alice, '', '')
  26. t94 = ids['94']
  27. c1 = addComment(t94, alice, 'first comment on the fixture', [{ name = 'pic.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-one') }])
  28. c2 = addComment(t94, bob, 'second comment', [{ name = 'doc.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-two') }])
  29. c3 = addComment(t94, alice, 'third comment, to be deleted', [{ name = 'gone.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-three') }])
  30. ctl = addComment(ids['5'], alice, 'a control comment', [{ name = 'keep.txt' type = 'text/plain' bytes = toBytes('control-bytes') }])
  31. changeComment(t94, c1.event.id, alice, 'edit', 'first comment, edited')
  32. changeComment(t94, c2.event.id, alice, 'like', '')
  33. changeComment(t94, c3.event.id, alice, 'delete', '')
  34. changeComment(ids['5'], ctl.event.id, alice, 'edit', 'control comment, edited')
  35. editTicket(t94, alice, 'fixture ticket 94 edited', 'an edited body')
  36. assignTicket(t94, alice, 'bob')
  37. changeState(t94, 'progress', alice, 'a state note')
  38. setParent(t94, alice, 'miserit-anthar#93')
  39. changeBlocker(t94, alice, 'miserit-anthar#10', true, '')
  40. setParent(ids['30'], alice, 'miserit-anthar#94')
  41. changeBlocker(ids['50'], alice, 'miserit-anthar#94', true, '')
  42. changeBlocker(ids['51'], alice, 'miserit-anthar#52', true, '')
  43. tok = createToken(alice.id, 'p94').token
  44. out = { 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 }
  45. 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