Run mirror repair independently of deploys

9763bf75da3a · AtlantisPleb · · parent 67f140a95349

Run mirror repair independently of deploys

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified lib/openagents/forge/supervisor.ex
  • added test/openagents/forge/supervisor_test.exs

Diff

2 files changed, +25 -3

lib/openagents/forge/supervisor.ex modified +3 -3

@@ -11,7 +11,8 @@ defmodule OpenAgents.Forge.Supervisor do

11 11
  def init(_init_arg) do
12 12
    children =
13 13
      [
14
        {Task.Supervisor, name: OpenAgents.Forge.TaskSupervisor}
14
        {Task.Supervisor, name: OpenAgents.Forge.TaskSupervisor},
15
        {OpenAgents.Forge.MirrorWatch, []}
15 16
      ] ++ repository_children() ++ deploy_lane_children()
16 17
17 18
    Supervisor.init(children, strategy: :one_for_one)

@@ -35,8 +36,7 @@ defmodule OpenAgents.Forge.Supervisor do

35 36
      [
36 37
        {OpenAgents.Forge.Builder, []},
37 38
        {OpenAgents.Forge.HotLoader, []},
38
        {OpenAgents.Forge.Janitor, []},
39
        {OpenAgents.Forge.MirrorWatch, []}
39
        {OpenAgents.Forge.Janitor, []}
40 40
      ]
41 41
    else
42 42
      []
test/openagents/forge/supervisor_test.exs added +22

@@ -0,0 +1,22 @@

1
defmodule OpenAgents.Forge.SupervisorTest do
2
  use ExUnit.Case, async: false
3
4
  alias OpenAgents.Forge.{Builder, MirrorWatch, Supervisor}
5
6
  test "starts mirror drift repair while the deploy lane is fenced" do
7
    previous = Application.get_env(:openagents, :forge_deploy_lane_enabled)
8
    Application.put_env(:openagents, :forge_deploy_lane_enabled, false)
9
10
    on_exit(fn ->
11
      if is_nil(previous) do
12
        Application.delete_env(:openagents, :forge_deploy_lane_enabled)
13
      else
14
        Application.put_env(:openagents, :forge_deploy_lane_enabled, previous)
15
      end
16
    end)
17
18
    assert {:ok, {_flags, child_specs}} = Supervisor.init([])
19
    assert Enum.any?(child_specs, &(&1.id == MirrorWatch))
20
    refute Enum.any?(child_specs, &(&1.id == Builder))
21
  end
22
end

This page updates live while a promote is in flight · changelog