╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────╮ │ 9 pub const User = @import("event/User.zig"); │ │10 pub const Repo = @import("event/Repo.zig"); │ │11 pub const Issue = @import("event/Issue.zig"); │ │12 +pub const Comment = @import("event/Comment.zig");│ │13 │ │14 pub const event_id_size: usize = 16; │ │15 │ ╰─────────────────────────────────────────────────────╯ ╭────────────────────────────────────────╮ │52 user, │ │53 repo, │ │54 issue, │ │55 + comment, │ │56 }; │ │57 │ │58 // a null payload deletes the record│ ╰────────────────────────────────────────╯ ╭────────────────────────────────────╮ │60 user: ?User, │ │61 repo: ?Repo, │ │62 issue: ?Issue, │ │63 + comment: ?Comment, │ │64 }; │ │65 │ │66 pub const EventWithId = struct {│ ╰────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │112 else │ │113 null, │ │114 }, │ │115 + .comment => .{ │ │116 + .comment = if (json_event.data) |value| │ │117 + try std.json.parseFromValueLeaky(Comment, arena.allocator(), value, .{ .ignore_unknown_fields = true })│ │118 + else │ │119 + null, │ │120 + }, │ │121 }, │ │122 }; │ │123 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │631 } else null; │ │632 try Issue.consume(DB, repo_opts.hash, haxy_moment, &current_event_id, record_maybe, &arena, &repo_event_oid); │ │633 }, │ │634 + .comment => |event_maybe| { │ │635 + const record_maybe: ?Comment.Record = if (event_maybe) |event| .{ │ │636 + .event = event, │ │637 + .author_email = authorEmail(commit_object.content.commit.metadata.author orelse ""), │ │638 + .created_ts = created_ts, │ │639 + } else null; │ │640 + try Comment.consume(DB, repo_opts.hash, haxy_moment, &current_event_id, record_maybe, &arena, &repo_event_oid);│ │641 + }, │ │642 } │ │643 } │ │644 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯