tickets
All repositories: gitoria
3.9 KB
// tests/oldstore.hl — the gate's LEGACY FIXTURE for ticket #20: a store as it was BEFORE projects were own// data — projects `{ name, created }`, tickets that name their project by NAME (path '<name>/<number>'),// the old state names, events with free-text authors — written straight into the mpackdb tables, exactly the// record shapes the pre-#20 store.hl wrote. The app's migrate.hl (run at every start) must turn it into// projects with ids, members and the new states.//// TICKETS_STORAGE=/abs/dir bin/hybriel tests/oldstore.hl (writes <dir>/{projects,tickets,events}.db)//// old #1 alpha created T in progress, 3 events (the comment and the state change share one ms)// old #3 alpha (alpha #2) created T+2min awaiting creator, 2 events (a Question ticket → pending)// old #4 alpha (alpha #3) created T+2min open, 1 event// old #2 beta.example.org created T+1min open, 1 event// old #5 beta.example.org created T+4min awaiting creator, 1 event (→ review)// → alpha #1 #2 #3 = old #1 #3 #4; beta.example.org #1 #2 = old #2 #5import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'dir = env('TICKETS_STORAGE')if (dir == null || !dir.startsWith('/')) { hlError('set TICKETS_STORAGE to an ABSOLUTE directory') }projects = new MPackDB(file = dir + '/projects.db', primaryKey = '@id', indexes = ['!name'])tickets = new MPackDB(file = dir + '/tickets.db', primaryKey = '@id', indexes = ['project', 'state', 'source', '!path', '*oldNumber'])events = new MPackDB(file = dir + '/events.db', primaryKey = '@id', indexes = ['@ticket'])if (tickets.count() > 0) { hlError('the fixture store is not empty: ' + dir) }T = 1790000000000M = 60000projects.put({ name = 'alpha' created = T })projects.put({ name = 'beta.example.org' created = T + M })t1 = tickets.put({ project = 'alpha' number = 1 path = 'alpha/1' oldNumber = 1 subject = 'Legacy alpha one' summary = 'first legacy ticket' state = 'in progress' source = '' created = T updated = T + 5 * M events = 3 })t2 = tickets.put({ project = 'beta.example.org' number = 1 path = 'beta.example.org/1' oldNumber = 2 subject = 'Legacy beta one' summary = '' state = 'open' source = '' created = T + M updated = T + M events = 1 })t3 = tickets.put({ project = 'alpha' number = 2 path = 'alpha/2' oldNumber = 3 subject = 'Question: legacy alpha two' summary = 'two' state = 'awaiting creator' source = '' created = T + 2 * M updated = T + 3 * M events = 2 })t4 = tickets.put({ project = 'alpha' number = 3 path = 'alpha/3' oldNumber = 4 subject = 'Legacy alpha three' summary = 'three' state = 'open' source = '' created = T + 2 * M updated = T + 2 * M events = 1 })t5 = tickets.put({ project = 'beta.example.org' number = 2 path = 'beta.example.org/2' oldNumber = 5 subject = 'Legacy beta two' summary = 'b2' state = 'awaiting creator' source = '' created = T + 4 * M updated = T + 4 * M events = 1 })events.put({ ticket = t1 seq = 1 kind = 'created' author = 'creator' text = '' created = T })events.put({ ticket = t2 seq = 1 kind = 'created' author = 'architect' text = '' created = T + M })events.put({ ticket = t3 seq = 1 kind = 'created' author = 'creator' text = '' created = T + 2 * M })events.put({ ticket = t4 seq = 1 kind = 'created' author = 'creator' text = '' created = T + 2 * M })events.put({ ticket = t5 seq = 1 kind = 'created' author = 'creator' text = '' created = T + 4 * M })events.put({ ticket = t3 seq = 2 kind = 'comment' author = 'worker' text = 'legacy comment on two' created = T + 3 * M })events.put({ ticket = t1 seq = 2 kind = 'comment' author = 'worker' text = 'legacy comment on one' created = T + 5 * M })events.put({ ticket = t1 seq = 3 kind = 'state' author = 'worker' text = 'started' from = 'open' to = 'in progress' created = T + 5 * M })console.log('oldstore: ' + projects.count() + ' projects, ' + tickets.count() + ' tickets, ' + events.count() + ' events (' + dir + ')')
Branches
Latest commits
- b03f11b6Tickets conductor: CONDUCTOR.md (project part), short STATUS.md, old STATUS to archive/2026-10-31mre
- a4123831tickets#42: the /connect and /login/callback error pages are app pages: the function routes redirect to /connect/failed/<code> and /login/failed/<code> (components/problem.hl, sentences in lib/problems.hl), htmlPage and its hand-written stylesheet are gone; gate tests/error-pages.mjsmre
- cefc7b4atickets: a startup error prints its message before exit 1 (hybriel#247)mre
- 99bd6570tickets: lib/migrate.hl writes no table of another topic any more: projects.hl rewriteSlug / addProjectNamed / hasMembers, tickets.hl moveToProject / ticketRecords / ticketRecordsOf, events.hl renameStates / eventRecords / eventRecordsOf; the migration calls them (tickets#47)mre
- b57161e3tickets: the markup names its own rules (Style.pMessage, Style.olTickets, ...) instead of hand-written class strings that copy a stylesheet rule; the shared bodies sit in lib/looks.hl (tickets#38)mre
- f767b24dtickets: 111 needless let became plain declarations (3 in ticket.hl, ticket_list.hl, comments.hl and 108 never-reassigned, not captured loop-body ones); the 212 really reassigned lets stay (tickets#44)mre
- 16c0d3b5tickets: the modal window is phone first: the full-screen sheet is the base rule, the centred window sits in the min-width 60rem block (tickets#39)mre
- 090ee809tickets: every component's styles in its own nested Style {} block; styles.hl keeps only the theme inherit, the accent and the site-wide rules (tickets#36)mre
- d395763ftickets: ident-access gate ports 8769/8768 (8797 is taken on loreana)mre
- afb9a403tickets: an ident access key (Authorization: Bearer idt_…) works in the API (ident#27 app side): lib/ident-access.hl copied from components, read keys GET only, ident down 503; gate tests/ident-access-tickets.mjsmre
- 48c1ba79tickets: md-paste-files gate with the file manager casesmre
- f04afc43tickets: MdEditor from components 59704ce (a file manager copy still attaches, pipe rows, tickets#49)mre
- 06599fa0tickets: MdEditor from components b0f1ec2 (a clipboard with text always pastes the text, tickets#49); real Ctrl+V gatemre
- 2e1b116ftickets: re-vendor Hybriel master acaceaf3 (framework ec8d6c1d): plugins/web patch queue while a page is built, anonymous session cookies refresh; gate waits for the comment editors to draw (W174) and clicks the form editor when it stands still; security gate: main's code runs on its own binary, lazy-session cookie checksmre
- 361bc0fetickets: re-vendor Hybriel 7a684920 (WIP, not deployed); on Error exits 1 at startup; migrate passes its log by reference; gate checks follow lazy sessions and the 413 refusalmre
- 8a69999cident#28: /login/callback never signs out the session it finds; a valid code puts the user on the same sessionmre
- 337e9b21tickets#37: a comment's files are open to everyone who can read the commentmre
- 1800600ftickets: write the standby service out in full so the boot gate can read the main servicemre
- 8179d287tickets: standby service on its port plus 10 and a deploy that hands over through it without a gapmre
- 0398145ctickets: the table grid rule is marked functional for check-thememre