╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────╮ │src/event/Issue.zig│ ╰───────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │147 const status_set = try statusSet(DB, status_to_issues, record_to_write.event.status); │ │148 try status_set.put(&order_key); │ │149 │ │150 - var tag_iter = tagIterator(record_to_write.event.tags); │ │151 - while (tag_iter.next()) |tag| { │ │152 - // an over-long tag goes unindexed rather than failing the consume, │ │150 + var label_iter = labelIterator(record_to_write.event.labels); │ │151 + while (label_iter.next()) |label| { │ │152 + // an over-long label goes unindexed rather than failing the consume, │ │153 // which would wedge the branch it arrived on │ │154 - if (tag.len == 0 or tag.len > tag_max_len) continue; │ │155 - var key_buffer: TagStatusKey = undefined; │ │156 - const tag_set_cursor = try tag_to_issues.putCursor(try tagStatusKey(&key_buffer, tag, record_to_write.event.status)); │ │157 - const tag_set = try DB.SortedSet(.read_write).init(tag_set_cursor); │ │158 - try tag_set.put(&order_key); │ │154 + if (label.len == 0 or label.len > label_max_len) continue; │ │155 + var key_buffer: LabelStatusKey = undefined; │ │156 + const label_set_cursor = try label_to_issues.putCursor(try labelStatusKey(&key_buffer, label, record_to_write.event.status));│ │157 + const label_set = try DB.SortedSet(.read_write).init(label_set_cursor); │ │158 + try label_set.put(&order_key); │ │159 } │ │160 } │ │161 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────╮ │175 // trailing ones keep our side) │ │176 pub const Resolve = struct { │ │177 title: ?[]const u8 = null, │ │178 - tags: ?[]const u8 = null, │ │178 + labels: ?[]const u8 = null, │ │179 hunks: []const []const u8 = &.{},│ │180 }; │ │181 │ ╰──────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │183 // conflicted issue — the resolution of its conflict │ │184 pub const Update = union(enum) { │ │185 status: Status, │ │186 - fields: struct { title: []const u8, tags: []const u8, description: []const u8 }, │ │186 + fields: struct { title: []const u8, labels: []const u8, description: []const u8 },│ │187 resolve: Resolve, │ │188 }; │ │189 │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────╮ │216 }, │ │217 .fields => |fields| { │ │218 updated.title = fields.title; │ │219 - updated.tags = fields.tags; │ │219 + updated.labels = fields.labels; │ │220 updated.description = fields.description;│ │221 }, │ │222 .resolve => |resolve| { │ ╰──────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │223 updated = try resolveFields(repo_kind, repo_opts, io, allocator, &arena, repo, id_bytes, issue, resolve);│ │224 - if (!fieldsValid(updated.title, updated.tags)) return error.InvalidFields; │ │224 + if (!fieldsValid(updated.title, updated.labels)) return error.InvalidFields; │ │225 }, │ │226 } │ │227 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │233 }}); │ │234 } │ │235 │ │236 -// the live fields with `resolve` applied: submitted title/tags stand in for the │ │236 +// the live fields with `resolve` applied: submitted title/labels stand in for the│ │237 // live ones, and a conflicted description is reassembled from the hunk │ │238 // resolutions against the conflict entry. the chunking is deterministic: the │ │239 // entry holds immutable slots and any event since would have removed it, so │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │255 │ │256 var updated = live.event; │ │257 if (resolve.title) |title| updated.title = title; │ │258 - if (resolve.tags) |tags| updated.tags = tags; │ │258 + if (resolve.labels) |labels| updated.labels = labels; │ │259 │ │260 var event_db_maybe: ?evt.LocalEventDB(repo_opts.hash) = if (repo_kind == .git) try evt.LocalEventDB(repo_opts.hash).openReadOnly(io, allocator, repo.core.repo_dir) else null;│ │261 defer if (event_db_maybe) |*event_db| event_db.deinit(io, allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │325 return try evt.read(Record, DB, repo_opts.hash, arena, issue_map); │ │326 } │ │327 │ │328 -// remove an issue's order key from its tags' `status` sets, pruning entries │ │328 +// remove an issue's order key from its labels' `status` sets, pruning entries│ │329 // whose set becomes empty │ │330 -fn removeFromTagSets( │ │330 +fn removeFromLabelSets( │ │331 comptime DB: type, │ │332 - tag_to_issues: DB.SortedMap(.read_write), │ │333 - tags: []const u8, │ │332 + label_to_issues: DB.SortedMap(.read_write), │ │333 + labels: []const u8, │ │334 status: Status, │ │335 order_key: []const u8, │ │336 ) !void { │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │337 - var tag_iter = tagIterator(tags); │ │338 - while (tag_iter.next()) |tag| { │ │337 + var label_iter = labelIterator(labels); │ │338 + while (label_iter.next()) |label| { │ │339 // skipped the same way consume skipped it, so it was never indexed │ │340 - if (tag.len == 0 or tag.len > tag_max_len) continue; │ │341 - var key_buffer: TagStatusKey = undefined; │ │342 - const key = try tagStatusKey(&key_buffer, tag, status); │ │343 - const tag_set_cursor = try tag_to_issues.putCursor(key); │ │344 - const tag_set = try DB.SortedSet(.read_write).init(tag_set_cursor); │ │345 - _ = try tag_set.remove(order_key); │ │346 - if (0 == try tag_set.count()) _ = try tag_to_issues.remove(key); │ │340 + if (label.len == 0 or label.len > label_max_len) continue; │ │341 + var key_buffer: LabelStatusKey = undefined; │ │342 + const key = try labelStatusKey(&key_buffer, label, status); │ │343 + const label_set_cursor = try label_to_issues.putCursor(key); │ │344 + const label_set = try DB.SortedSet(.read_write).init(label_set_cursor);│ │345 + _ = try label_set.remove(order_key); │ │346 + if (0 == try label_set.count()) _ = try label_to_issues.remove(key); │ │347 } │ │348 } │ │349 │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────╮ │src/event/Patch.zig│ ╰───────────────────╯ ╭───────────────────────────────────────────────────────╮ │ 9 │ │10 title: []const u8, │ │11 description: []const u8, │ │12 -tags: []const u8, // space-separated │ │12 +labels: []const u8, // space-separated │ │13 source_branch: ?[]const u8 = null, │ │14 target_branch: []const u8, │ │15 target_patch_id: ?[evt.event_id_size * 2]u8 = null,│ ╰───────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯