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,2 +1 @@
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/sync_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_sync_conflict" },
fanout = { "devloop_branch_tick" },
stall_window = "10m",
}

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 @@ -167,7 +170,7 @@ local function fast_forward_sync(repo, upstream, integration, upstream_sha, inte
end)
end

function pipeline(event)
local function act(event)
core.log_entry("sync_scan", event, "branch-sync", event and event.queue or "")
local branches = core.branch_config()
local cfg = core.devloop_config()
Expand Down Expand Up @@ -218,6 +221,9 @@ function pipeline(event)
end)
end

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

return M
return saga.department(spec, {
done = done,
act = act,
wrap = core.wrap_pipeline_failure,
name = "sync_scan",
})
5 changes: 4 additions & 1 deletion scripts/ratchet_migration_slicer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,10 @@ def test_current_repo_parents_print_dry_run_bodies(self) -> None:
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn(f"- ratchet: `{ratchet}`", result.stdout)
self.assertIn("- migration_kind: `allowlist`", result.stdout)
self.assertRegex(result.stdout, r"- selected_count: [02]")
# selected_count = min(slice_size=2, remaining_count); as a ratchet is
# drained toward zero its remaining count can be 1 (< slice_size), so the
# dry-run selects 1 site. Accept 0-2 instead of hard-coding 0 or 2.
self.assertRegex(result.stdout, r"- selected_count: [0-2]\b")
self.assertIn("## Acceptance Criteria", result.stdout)

def test_current_repo_ratchets_print_json_schema(self) -> None:
Expand Down
Loading