tracker
All repositories: gitoria
1.7 KB
// tools/old-short-ids.hl — mission 060 (tracker.worldapi.org#27), one-off: the old tracker's short ids → data/old-short-ids.json.// The old export's Show.jsonl carries `id` (5 characters, base62 counter '100jh'…) on 702 of 9,453 shows; the file maps the// old Mongo `_id` (= our shows' `oldId`, tools/migrate.hl) → that id. shortids.hl reads it at start and gives those shows// their old id back. Reads only the export (never storage/); the export is on Loreana only, the JSON file goes with the code.//// TRACKER_OLD_DATA=/media/STORAGE/projects/old-tracker/mongo-export TRACKER_MIGRATE_TMP=$PWD/.scratch/old-short-ids-tmp \// TRACKER_OLD_SHORT_IDS=$PWD/data/old-short-ids.json ./bin/hybriel tools/old-short-ids.hlimport { env } from 'hl:proc'import { writeFile } from 'hl:fs'import { oidOf, bigLinesOf } from '../lib/export.hl'oldDir = env('TRACKER_OLD_DATA')tmpDir = env('TRACKER_MIGRATE_TMP')outFile = env('TRACKER_OLD_SHORT_IDS')if (oldDir == null || !oldDir.startsWith('/') || tmpDir == null || !tmpDir.startsWith('/') || outFile == null || !outFile.startsWith('/')) {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')}// hl:fs readFile stops at 10 MiB (lib/export.hl): Show.jsonl (12.4 MB) is cut into chunks first, like migrate.hl doesshows = 0found = {}count = 0for (l of bigLinesOf(oldDir + '/Show.jsonl', tmpDir + '/show', 5000)) {let d = JSON.parse(l)shows = shows + 1if (d.id != null && hlTypeName(d.id) == 'String' && d.id != '') {found[oidOf(&d._id)] = d.idcount = count + 1}}writeFile(outFile, JSON.stringify(found), 420)print('shows=' + shows + ' withShortId=' + count + ' → ' + outFile)
Branches
Latest commits
- 73010cc0HM52: report replace-navigation search draft regressionmre
- 1742e92bstatus: DP64 and HM52 runningmre
- 29ad5b58log: #64 merged, DP64 and HM52 startedmre
- fafddbf9Merge hm64-catalog: tracker#64 catalog from packed entriesmre
- b2e2206dlog: #63 livemre
- 5831e0e0log: HM64 donemre
- 4042b923Flatten catalog membership rows into paired slotsmre
- ea8a759elog: #61 #62 live, DP63 and HM64 startedmre
- 40439456Merge hm63-searchtext: tracker#63 packed search textmre
- b7e6b48ePack normalized search text behind numeric offsetsmre
- b35f53e1log: DP62 stale runtime decisionmre
- f9593602log: Apollo deploy rule correctionmre
- 3c95f7f3log: DP62 and HM63 startedmre
- 9c4397c9mission HM63mre
- 8dfe42c8mission DP62mre
- e347fef4Merge rv44: tracker#61 #62 on Hybriel day44mre
- 8274bcf1log: RV44 done, deploy held for the usage windowmre
- 1ef7a3b1RV44: report day44 gates and migration/restart proofsmre
- a5f62f6cRV44: re-vendor Hybriel set day44 (source 222edef7, bin 4f0f263e)mre
- 6159a248Merge branch 'hm62-personindex' into rv44mre