From d7663c9fa5de229f56d6634202167564cf44bc69 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Fri, 17 Jul 2026 19:57:40 -1000 Subject: [PATCH] Fix review app startup checks without dropping grace --- .controlplane/templates/node-renderer.yml | 8 +--- bin/test-cpflow-github-flow | 45 +++++++++++++++++++++++ 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/.controlplane/templates/node-renderer.yml b/.controlplane/templates/node-renderer.yml index bf5f8473..424dfdf8 100644 --- a/.controlplane/templates/node-renderer.yml +++ b/.controlplane/templates/node-renderer.yml @@ -33,13 +33,6 @@ spec: # The React on Rails Pro Node Renderer speaks cleartext HTTP/2 (h2c). # Rails/Thruster stays `http`; this renderer port intentionally differs. protocol: http2 - startupProbe: - tcpSocket: - port: 3800 - # Give the boot seed enough room for Rails boot plus previous-bundle - # fetches; readiness still waits for the renderer port before Rails rolls. - failureThreshold: 60 - periodSeconds: 2 readinessProbe: tcpSocket: port: 3800 @@ -48,6 +41,7 @@ spec: livenessProbe: tcpSocket: port: 3800 + initialDelaySeconds: 120 failureThreshold: 3 periodSeconds: 10 defaultOptions: diff --git a/bin/test-cpflow-github-flow b/bin/test-cpflow-github-flow index 70c8c07a..e902642f 100755 --- a/bin/test-cpflow-github-flow +++ b/bin/test-cpflow-github-flow @@ -12,6 +12,51 @@ fi echo "==> cpflow github-flow-readiness" "${cpflow_cmd[@]}" github-flow-readiness +echo "==> check node renderer probe template" +ruby <<'RUBY' +require "yaml" + +template = File.read(".controlplane/templates/node-renderer.yml") +rendered = template.gsub(/\{\{[A-Z_]+\}\}/, "template-placeholder") +container = YAML.safe_load(rendered).fetch("spec").fetch("containers").fetch(0) + +expected_args = [ + "bash", + "-lc", + <<~'SHELL', + # The rake task warns and continues on bundle fetch misses so rollout + # does not wedge; unexpected task failures still stop the shell. + set -e + bundle exec rake react_on_rails_pro:pre_seed_renderer_cache + exec yarn node-renderer + SHELL +] +expected_ports = [{ "number" => 3800, "protocol" => "http2" }] +expected_readiness_probe = { + "tcpSocket" => { "port" => 3800 }, + "failureThreshold" => 3, + "periodSeconds" => 5, +} +expected_liveness_probe = { + "tcpSocket" => { "port" => 3800 }, + "failureThreshold" => 3, + "periodSeconds" => 10, + "initialDelaySeconds" => 120, +} + +failures = [] +failures << "unsupported startupProbe is present" if container.key?("startupProbe") +failures << "command changed" if container.key?("command") +failures << "args changed" unless container.fetch("args") == expected_args +failures << "image changed" unless container.fetch("image") == "template-placeholder" +failures << "ports changed" unless container.fetch("ports") == expected_ports +failures << "readinessProbe changed" unless container.fetch("readinessProbe") == expected_readiness_probe +failures << "livenessProbe grace or thresholds changed" unless container.fetch("livenessProbe") == expected_liveness_probe + +abort failures.join("\n") unless failures.empty? +puts "node renderer template preserves supported probe grace and stable runtime settings" +RUBY + echo "==> parse generated GitHub Actions YAML" ruby <<'RUBY' require "yaml"