gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitcd3641a1cd3641a1|||PR records: day72 deploy live, tickets closedmrecd3641a1/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

  • cd3641a1|||PR records: day72 deploy live, tickets closedmre
  • 7d44d852Merge branch 'records-t37' into mainTickets
  • 926f7061|||PR records: merges, D36 deploymre
  • bf58534eMerge branch 'l33-final' into mainTickets
  • 759a9ac3|||PR thin login (tickets#46, #45): merge main, route entry cleanupmre
  • 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
  • 5822cb3aMerge branch 'o34-clean' into mainTickets
  • 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
  • 14cf96b4Merge branch 'records-t36' into mainTickets
  • 07749fa1|||PR records: day72 + #40 mergedmre
  • ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre
  • 6dea1c60Merge branch 'r35-day72' into mainTickets
  • 7bcfdc22|||PR drop worker edits to conductor recordsmre
  • 2617b6ee|||PR dialogs: host flag cleared on close, dialog gate (tickets#40)mre
  • 6e701371|||PR record partial day72 dialog validationmre
  • b9fb9a91|||PR bind ticket dialog visibility to member flagsmre
  • 0788e65f|||PR re-vendor Hybriel day72mre
  • e2a6bdcfMerge branch 'records-t35' into mainTickets
  • d8d54df1|||PR records: R35 day72 + #40mre
  • 8a7f475aMerge branch 'records-t33' into mainTickets