gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit2047955b2047955bMerge branch 'u12-gateports' into mainTracker2047955b/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

  • 2047955bMerge branch 'u12-gateports' into mainTracker
  • 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
  • 0b86324aMerge branch 'records-dp73' into mainTracker
  • 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
  • 613ae0ecMerge branch 'bs3' into mainTracker
  • 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
  • 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
  • 310613f1Merge branch 'records-dp72' into mainTracker
  • 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
  • c41587d2Merge branch 'bs2' into mainTracker
  • 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
  • 019d5cedMerge branch 'records-1110' into mainTracker
  • f88ae8b9|||PR records: day56 toggle live, reviewTracker
  • b6b3bb4dMerge branch 'ap56e' into mainTracker
  • 29a26da9|||PR AP56e: guard hidden show helpers during session syncTracker
  • 7c9ec236|||PR AP56e: re-vendor Hybriel set day56 (source 36ae83a8, bin c1f595a2)Tracker
  • 4b54f6f9Merge branch 'records-audit' into mainTracker
  • cab4a3bc|||PR records: branch audit, PR-onlyTracker
  • 641e1c4cMerge branch 'records-dp71' into mainTracker
  • 85a6e9f5|||PR records: DP71 checked in ChromeTracker