Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion migration/saga-handler.allowlist
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packages/github-devloop/departments/rollup_scan/main.lua
packages/github-devloop/departments/sync_conflict/main.lua
packages/github-devloop/departments/sync_scan/main.lua
20 changes: 13 additions & 7 deletions packages/github-devloop/departments/rollup_scan/main.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
local core = require("core")
local saga = require("std.saga")

local M = {}

M.spec = {
local spec = {
consumes = { "devloop_branch_tick" },
produces = { "devloop_rollup_ready", "github-proxy.github_issue_create_request" },
fanout = { "devloop_branch_tick" },
stall_window = "5m",
}

local function done(_event)
return false
end

local function require_repo(repo)
local value = tostring(repo or "")
if value == "" or core.safe_repo(value) ~= value then
Expand Down Expand Up @@ -84,7 +87,7 @@ local function create_rollup_pr(repo, upstream, integration, head_sha, ahead, pu
error("github-devloop: rollup PR create failed: " .. tostring(result.stderr))
end

function pipeline(event)
local function act(event)
core.log_entry("rollup_scan", event, "rollup", event and event.queue or "")
local branches = core.branch_config()
local cfg = core.devloop_config()
Expand Down Expand Up @@ -163,6 +166,9 @@ function pipeline(event)
end)
end

pipeline = core.wrap_pipeline_failure("rollup_scan", pipeline)

return M
return saga.department(spec, {
done = done,
act = act,
wrap = core.wrap_pipeline_failure,
name = "rollup_scan",
})
Loading