gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitbc3bdecebc3bdecerecords: day38b live, #94 purgedmrebc3bdece/tools/fix-import-summaries.hl

2.0 KB

  1. // tools/fix-import-summaries.hl — ONE-OFF (ticket #10, 2026-09-24): the tickets imported
  2. // before the importer joined hard-wrapped lines (#1–#5) kept the files' line breaks in
  3. // their stored summary. This rewrites ONLY `summary` of every ticket that has a `source`
  4. // (= was imported) with lib/import.hl's paragraphsOf(); id, state, dates, event count and
  5. // the event history are untouched (no event is written). Idempotent: a second run
  6. // changes nothing. (Since ticket #38 it works on the storage/mpackdb/ tables.) STOP THE SERVER FIRST (it holds the tables), back up storage/:
  7. //
  8. // kill $(cat server.pid); cp -a storage .scratch/storage-backup-$(date +%Y%m%d-%H%M%S)
  9. // TICKETS_STORAGE=$PWD/storage/mpackdb bin/hybriel tools/fix-import-summaries.hl
  10. //
  11. // TICKETS_STORAGE must be ABSOLUTE: Hybriel resolves a relative path against the ENTRY
  12. // SCRIPT's directory (tools/), so the default './storage/mpackdb' would open empty
  13. // tables in tools/storage/mpackdb/. Without it the tool refuses (the import has already created
  14. // empty tools/storage/mpackdb/* files by then — delete them).
  15. import { env } from 'hl:proc'
  16. import { merged, countOf, storageDir } from '../lib/util.hl'
  17. import { ticketsTable } from '../lib/tickets.hl'
  18. import { paragraphsOf } from '../lib/import.hl'
  19. if (env('TICKETS_STORAGE') == null || !env('TICKETS_STORAGE').startsWith('/')) {
  20. hlError('set TICKETS_STORAGE to the ABSOLUTE table directory, e.g. TICKETS_STORAGE=$PWD/storage/mpackdb')
  21. }
  22. fixed = 0
  23. same = 0
  24. all = ticketsTable.find(null, null)
  25. if (countOf(all) > 0) {
  26. for (t of all) {
  27. if (t.source != null && t.source != '') {
  28. s = paragraphsOf(t.summary != null ? t.summary : '')
  29. if (s != t.summary) {
  30. ticketsTable.update(t.id, merged(t, { summary = s }))
  31. fixed = fixed + 1
  32. console.log('FIXED ' + t.project + ' #' + t.number + ' (' + t.source + ')')
  33. } else {
  34. same = same + 1
  35. console.log('SAME ' + t.project + ' #' + t.number + ' (' + t.source + ')')
  36. }
  37. }
  38. }
  39. }
  40. console.log('fix-import-summaries: ' + fixed + ' fixed, ' + same + ' already fine (' + storageDir + ')')

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