╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───╮ │src/push.zig│ ╰────────────╯ ╭──────────────────────────────────────────────────────╮ │119 writer: *std.Io.Writer, │ │120 options: xit.net_server_receive_pack.Options,│ │121 author: ?evt.CommitAuthor, │ │122 - users_dir: []const u8, │ │122 + server: evt.Host.Server, │ │123 error_writer: *std.Io.Writer, │ │124 sess: ?*ssh.SessionCtx, │ │125 ) !void { │ ╰──────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────╮ │143 options: xit.net_server_receive_pack.Options, │ │144 author: ?evt.CommitAuthor, │ │145 response: *xit.net_server_receive_pack.Response,│ │146 - users_dir: []const u8, │ │146 + server: evt.Host.Server, │ │147 error_writer: *std.Io.Writer, │ │148 sideband: *progress.Sideband, │ │149 │ ╰─────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │163 // transaction and must commit regardless. │ │164 if (null != try rf.readRecur(.xit, repo_opts, state.readOnly(), ctx.io, .{ .ref = evt.events_ref })) { │ │165 _ = try evt.consumeInTransaction(.repo, .xit, repo_opts, state, &ctx.core.db, &moment, ctx.io, ctx.allocator, evt.events_ref); │ │166 - try pch.detectMerged(repo_opts, state, &ctx.core.db, &moment, ctx.io, ctx.allocator, ctx.users_dir, ctx.updates.items.items, ctx.error_writer); │ │166 + try pch.detectMerged(repo_opts, state, &ctx.core.db, &moment, ctx.io, ctx.allocator, ctx.server.users_dir, ctx.updates.items.items, ctx.error_writer); │ │167 │ │168 // the revisions the pushed branches cause belong to the push │ │169 - _ = try pch.refreshBranchesInTransaction(.{ .server = .{ .users_dir = ctx.users_dir } }, repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.updates.items.items, null, ctx.sideband);│ │169 + _ = try pch.refreshBranchesInTransaction(.{ .server = ctx.server }, repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.updates.items.items, null, ctx.sideband); │ │170 } │ │171 │ │172 if (ctx.sideband.gone) return error.ClientGone; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────╮ │199 .options = options, │ │200 .author = author, │ │201 .response = &response, │ │202 - .users_dir = users_dir, │ │202 + .server = server, │ │203 .error_writer = error_writer,│ │204 .sideband = &sideband, │ │205 }, │ ╰──────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │210 if (err == error.CancelTransaction) return; │ │211 return err; │ │212 }; │ │213 - evt.bumpRepoActivityAt(io, allocator, users_dir, repo.core.work_path); │ │213 + evt.bumpRepoActivityAt(io, allocator, server, repo.core.work_path); │ │214 │ │215 - pch.refreshBranches(.{ .server = .{ .users_dir = users_dir } }, .xit, repo_opts, io, allocator, repo, updates.items.items, &sideband) catch |err| {│ │215 + pch.refreshBranches(.{ .server = server }, .xit, repo_opts, io, allocator, repo, updates.items.items, &sideband) catch |err| { │ │216 serve_common.logError(io, error_writer, "failed to refresh branch patches: {s}\n", .{@errorName(err)}); │ │217 - pch.refreshOpenMergeability(repo_opts, io, allocator, repo, users_dir, null, &sideband); │ │217 + pch.refreshOpenMergeability(repo_opts, io, allocator, repo, server.users_dir, null, &sideband); │ │218 }; │ │219 try response.finish(writer, null); │ │220 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────╮ │225 allocator: std.mem.Allocator, │ │226 fork_repo: *rp.Repo(.xit, repo_opts), │ │227 target_repo: *rp.Repo(.xit, repo_opts),│ │228 - users_dir: []const u8, │ │228 + server: evt.Host.Server, │ │229 id: *const [evt.event_id_size * 2]u8, │ │230 author: evt.CommitAuthor, │ │231 timestamp: u64, │ ╰────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │417 } │ │418 var patch = published_patch.event; │ │419 patch.revision = selected; │ │420 - evt.consume(.{ .server = .{ .users_dir = users_dir } }, .repo, .xit, repo_opts, io, allocator, target_repo, evt.events_ref, &.{.{│ │420 + evt.consume(.{ .server = server }, .repo, .xit, repo_opts, io, allocator, target_repo, evt.events_ref, &.{.{ │ │421 .id = id.*, │ │422 .timestamp = timestamp, │ │423 .author = author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │430 refreshed = true; │ │431 } │ │432 │ │433 - if (!refreshed) pch.refreshMergeability(repo_opts, io, allocator, target_repo, users_dir, patch_id); │ │433 + if (!refreshed) pch.refreshMergeability(repo_opts, io, allocator, target_repo, server.users_dir, patch_id);│ │434 sideband.run(io, .{ .complete_one = .writing_patch }) catch {}; │ │435 sideband.run(io, .{ .end = .writing_patch }) catch {}; │ │436 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────╮ │src/serve.zig│ ╰─────────────╯ ╭────────────────────────────────────────────────────╮ │ 8 const serve_ssh = @import("./serve_ssh.zig"); │ │ 9 const serve_http = @import("./serve_http.zig"); │ │10 const evt = @import("./event.zig"); │ │11 +const notify = @import("./notify.zig"); │ │12 │ │13 pub const Options = struct { │ │14 http_listen: ?[]const u8 = "127.0.0.1:8080",│ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │82 }; │ │83 defer admin_repo.deinit(io, allocator); │ │84 } │ │85 + │ │86 + // the repos the notify worker has yet to look at │ │87 + var dirty_repos: notify.DirtyRepos = .{ .allocator = allocator };│ │88 + defer dirty_repos.deinit(); │ │89 │ │90 // create http listener │ │91 │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯