open_pulls.module
This package holds more than this page lists. See all of its files in its world.
README.md
open_pulls
The open pull requests waiting on the worlds the signed-in account owns or maintains, across all of them.
An editor engine bound to a world reads them every 45 seconds, and sooner when its ZeroMind inbox brings a contribution. While any wait, it keeps one notice standing in the editor's notification bell: how many are open, how many come from other people, how long ago the oldest was opened and which worlds hold them. The notice is posted again whenever a pull request opens, merges or closes, and its button opens the ZeroMind panel's list of them, where each opens to its description and diff and the person hands one or all of them to DotBot.
local OpenPulls = require("@builtin::modules.open_pulls")
local waiting = OpenPulls.read() -- what ZeroMind states now
local summary = OpenPulls.summarize(waiting, os.time(), world.guid())
print(summary.count, summary.others, summary.oldestAt)
print(OpenPulls.live():current().summary) -- what the engine read last
OpenPulls.hand(waiting.pulls, { approveEachMerge = true }) -- DotBot reviews each; every merge waits for the person's yes
OpenPulls.hand first has the engine hold the merge of each pull request handed with approveEachMerge, and of each one on a world the person maintains without owning it: until the engine stops, a merge of one of those asks the person in the engine's confirmation dialog, DotBot's own merge included, and a no leaves it open. trusted.call("zeromind.engage.mergeHeld", guid, number) answers whether one is held.
OpenPulls.handPrompt(pulls, opts) is the task DotBot is handed: for each pull request, read the whole change, check it for anything unsafe, try it, run its package's tests and check that a fresh install still loads, then merge it into main, close it with a polite comment saying why, or comment asking its author for what is missing. OpenPulls.handed() lists the ones handed in this engine, and OpenPulls.onChange(fn) is told each read that differs from the one before it.
The zeromind.pullsWaiting tool reads the same list, and the zm pull request tools (zm.prView, zm.prMerge, zm.prClose, zm.prComment, zm.prReview) act on each one.