gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3da2ea863da2ea86RV48: report day48 cold starts, gates and cleanupmre3da2ea86/tools/old-short-ids.hl

1.7 KB

  1. // tools/old-short-ids.hl — mission 060 (tracker.worldapi.org#27), one-off: the old tracker's short ids → data/old-short-ids.json.
  2. // The old export's Show.jsonl carries `id` (5 characters, base62 counter '100jh'…) on 702 of 9,453 shows; the file maps the
  3. // old Mongo `_id` (= our shows' `oldId`, tools/migrate.hl) → that id. shortids.hl reads it at start and gives those shows
  4. // their old id back. Reads only the export (never storage/); the export is on Loreana only, the JSON file goes with the code.
  5. //
  6. // TRACKER_OLD_DATA=/media/STORAGE/projects/old-tracker/mongo-export TRACKER_MIGRATE_TMP=$PWD/.scratch/old-short-ids-tmp \
  7. // TRACKER_OLD_SHORT_IDS=$PWD/data/old-short-ids.json ./bin/hybriel tools/old-short-ids.hl
  8. import { env } from 'hl:proc'
  9. import { writeFile } from 'hl:fs'
  10. import { oidOf, bigLinesOf } from '../lib/export.hl'
  11. oldDir = env('TRACKER_OLD_DATA')
  12. tmpDir = env('TRACKER_MIGRATE_TMP')
  13. outFile = env('TRACKER_OLD_SHORT_IDS')
  14. if (oldDir == null || !oldDir.startsWith('/') || tmpDir == null || !tmpDir.startsWith('/') || outFile == null || !outFile.startsWith('/')) {
  15. hlError('set TRACKER_OLD_DATA (the mongo-export directory), TRACKER_MIGRATE_TMP (a scratch directory) and TRACKER_OLD_SHORT_IDS (the JSON file to write), all ABSOLUTE')
  16. }
  17. // hl:fs readFile stops at 10 MiB (lib/export.hl): Show.jsonl (12.4 MB) is cut into chunks first, like migrate.hl does
  18. shows = 0
  19. found = {}
  20. count = 0
  21. for (l of bigLinesOf(oldDir + '/Show.jsonl', tmpDir + '/show', 5000)) {
  22. d = JSON.parse(l)
  23. shows = shows + 1
  24. if (d.id != null && hlTypeName(d.id) == 'String' && d.id != '') {
  25. found[oidOf(&d._id)] = d.id
  26. count = count + 1
  27. }
  28. }
  29. writeFile(outFile, JSON.stringify(found), 420)
  30. print('shows=' + shows + ' withShortId=' + count + ' → ' + outFile)

Branches

Latest commits

  • 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
  • 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
  • 4a802ae7status: RV48 runningmre
  • 0a5412b6RV48 brief, day48 outmre
  • 56665efelog: CB69 mergedmre
  • 05448a98Merge cb69-imports: appTitle in a dependency-free topicmre
  • e55b379dKeep shared app title independent of the route import graphmre
  • 9a99659blog: hybriel#334, batch waits for day48mre
  • 85fa6c9blog: CB68 result, CB69 startedmre
  • 2f07c1b7log: DP68 boot gate failed, CB68mre
  • 9652782dlog: HM59 merged, DP68 startedmre
  • 29867a75Merge hm59-logic: tracker#59 page logic moved to libmre
  • f7bfe90bMove remaining page builders into their topicsmre
  • 7c3991f9log: day46 from Antonmre
  • ec54fc35Move show page logic into the shows topicmre
  • c1a8d074log: correct timesmre
  • 5827eba9log: HM57 merged, HM59 startedmre
  • d1a91be9Merge hm57-let: tracker#57 let only for reassigned namesmre
  • a404ed75Report HM57 audit, gates and integration notesmre
  • 1dcb87a7Use plain declarations for unchanged bindingsmre