Enforce warning-free production releases

2e1c9240d0b1 · Christopher David · · parent e0970e772fc8

Enforce warning-free production releases

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 Dockerfile
  • modified docs/operations/release-deployment-fallbacks.md
  • modified lib/openagents/forge/gate_receipt.ex
  • modified lib/openagents/forge/rolling_replacement.ex
  • modified ops/ci/gate.sh
  • modified test/openagents/forge/gate_receipt_test.exs

Diff

6 files changed, +19 -9

Dockerfile modified +1 -1

@@ -49,7 +49,7 @@ COPY lib lib

49 49
COPY rel rel
50 50
51 51
# Compile the release
52
RUN mix compile
52
RUN mix compile --warnings-as-errors
53 53
54 54
COPY assets assets
55 55
docs/operations/release-deployment-fallbacks.md modified +2 -2

@@ -36,8 +36,8 @@ OPENAGENTS_RELEASE_SMOKE_DATABASE_URL='ecto://USER:PASSWORD@HOST/DATABASE' \

36 36
ops/ci/gate.sh
37 37
```
38 38
39
The gate requires a clean worktree. It runs warning-free compilation,
40
`mix precommit`, distributed tests, browser tests, the direct transaction,
39
The gate requires a clean worktree. It runs warning-free test and production
40
compilation, `mix precommit`, distributed tests, browser tests, the direct transaction,
41 41
forward and reverse relup proofs, interrupted-install recovery, rolling
42 42
replacement tests, repository contracts, and packaged release startup. It
43 43
writes a content-free receipt to
lib/openagents/forge/gate_receipt.ex modified +1

@@ -14,6 +14,7 @@ defmodule OpenAgents.Forge.GateReceipt do

14 14
  @maximum_bytes 65_536
15 15
  @required_stages ~w(
16 16
    compile
17
    production_compile
17 18
    precommit
18 19
    cluster
19 20
    javascript
lib/openagents/forge/rolling_replacement.ex modified +11 -5

@@ -213,18 +213,24 @@ defmodule OpenAgents.Forge.RollingReplacement do

213 213
214 214
  defp do_poll(function, attempts, interval) do
215 215
    case function.() do
216
      :ok -> :ok
217
      :retry -> wait(interval) && do_poll(function, attempts - 1, interval)
218
      {:error, _reason} = error -> error
216
      :ok ->
217
        :ok
218
219
      :retry ->
220
        wait(interval)
221
        do_poll(function, attempts - 1, interval)
222
223
      {:error, _reason} = error ->
224
        error
219 225
    end
220 226
  end
221 227
222
  defp wait(0), do: true
228
  defp wait(0), do: :ok
223 229
224 230
  defp wait(milliseconds) do
225 231
    receive do
226 232
    after
227
      milliseconds -> true
233
      milliseconds -> :ok
228 234
    end
229 235
  end
230 236
ops/ci/gate.sh modified +3 -1

@@ -4,7 +4,7 @@ set -eu

4 4
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
5 5
repo_root=$(CDPATH= cd -- "$script_dir/../.." && pwd)
6 6
receipt_root="$repo_root/.git/openagents/release-gate-receipts"
7
required_stages='compile precommit cluster javascript direct_transaction relup version_chain interrupted_install rolling_replacement contracts release_smoke'
7
required_stages='compile production_compile precommit cluster javascript direct_transaction relup version_chain interrupted_install rolling_replacement contracts release_smoke'
8 8
mode=${1:-run}
9 9
10 10
if [ ! -d "$repo_root/.git" ]; then

@@ -111,6 +111,7 @@ run_stage() {

111 111
cd "$repo_root"
112 112
113 113
run_stage compile env MIX_ENV=test mix compile --warnings-as-errors
114
run_stage production_compile env MIX_ENV=prod mix compile --warnings-as-errors
114 115
run_stage precommit env MIX_ENV=test mix precommit
115 116
run_stage cluster env MIX_ENV=test mix test --warnings-as-errors --only cluster
116 117
run_stage javascript npm --prefix assets test

@@ -162,6 +163,7 @@ cat >"$receipt_temp" <<EOF

162 163
  "automatic_retries": 0,
163 164
  "stages": {
164 165
    "compile": {"status": "passed", "duration_seconds": $compile_duration_seconds},
166
    "production_compile": {"status": "passed", "duration_seconds": $production_compile_duration_seconds},
165 167
    "precommit": {"status": "passed", "duration_seconds": $precommit_duration_seconds},
166 168
    "cluster": {"status": "passed", "duration_seconds": $cluster_duration_seconds},
167 169
    "javascript": {"status": "passed", "duration_seconds": $javascript_duration_seconds},
test/openagents/forge/gate_receipt_test.exs modified +1

@@ -6,6 +6,7 @@ defmodule OpenAgents.Forge.GateReceiptTest do

6 6
  @sha String.duplicate("a", 40)
7 7
  @stages ~w(
8 8
    compile
9
    production_compile
9 10
    precommit
10 11
    cluster
11 12
    javascript

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