Skip to content

Commit 8266366

Browse files
authored
Preserve review-app renderer startup grace (#785)
1 parent 5ea9901 commit 8266366

2 files changed

Lines changed: 46 additions & 7 deletions

File tree

.controlplane/templates/node-renderer.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ spec:
3333
# The React on Rails Pro Node Renderer speaks cleartext HTTP/2 (h2c).
3434
# Rails/Thruster stays `http`; this renderer port intentionally differs.
3535
protocol: http2
36-
startupProbe:
37-
tcpSocket:
38-
port: 3800
39-
# Give the boot seed enough room for Rails boot plus previous-bundle
40-
# fetches; readiness still waits for the renderer port before Rails rolls.
41-
failureThreshold: 60
42-
periodSeconds: 2
4336
readinessProbe:
4437
tcpSocket:
4538
port: 3800
@@ -48,6 +41,7 @@ spec:
4841
livenessProbe:
4942
tcpSocket:
5043
port: 3800
44+
initialDelaySeconds: 120
5145
failureThreshold: 3
5246
periodSeconds: 10
5347
defaultOptions:

bin/test-cpflow-github-flow

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,51 @@ fi
1212
echo "==> cpflow github-flow-readiness"
1313
"${cpflow_cmd[@]}" github-flow-readiness
1414

15+
echo "==> check node renderer probe template"
16+
ruby <<'RUBY'
17+
require "yaml"
18+
19+
template = File.read(".controlplane/templates/node-renderer.yml")
20+
rendered = template.gsub(/\{\{[A-Z_]+\}\}/, "template-placeholder")
21+
container = YAML.safe_load(rendered).fetch("spec").fetch("containers").fetch(0)
22+
23+
expected_args = [
24+
"bash",
25+
"-lc",
26+
<<~'SHELL',
27+
# The rake task warns and continues on bundle fetch misses so rollout
28+
# does not wedge; unexpected task failures still stop the shell.
29+
set -e
30+
bundle exec rake react_on_rails_pro:pre_seed_renderer_cache
31+
exec yarn node-renderer
32+
SHELL
33+
]
34+
expected_ports = [{ "number" => 3800, "protocol" => "http2" }]
35+
expected_readiness_probe = {
36+
"tcpSocket" => { "port" => 3800 },
37+
"failureThreshold" => 3,
38+
"periodSeconds" => 5,
39+
}
40+
expected_liveness_probe = {
41+
"tcpSocket" => { "port" => 3800 },
42+
"failureThreshold" => 3,
43+
"periodSeconds" => 10,
44+
"initialDelaySeconds" => 120,
45+
}
46+
47+
failures = []
48+
failures << "unsupported startupProbe is present" if container.key?("startupProbe")
49+
failures << "command changed" if container.key?("command")
50+
failures << "args changed" unless container.fetch("args") == expected_args
51+
failures << "image changed" unless container.fetch("image") == "template-placeholder"
52+
failures << "ports changed" unless container.fetch("ports") == expected_ports
53+
failures << "readinessProbe changed" unless container.fetch("readinessProbe") == expected_readiness_probe
54+
failures << "livenessProbe grace or thresholds changed" unless container.fetch("livenessProbe") == expected_liveness_probe
55+
56+
abort failures.join("\n") unless failures.empty?
57+
puts "node renderer template preserves supported probe grace and stable runtime settings"
58+
RUBY
59+
1560
echo "==> parse generated GitHub Actions YAML"
1661
ruby <<'RUBY'
1762
require "yaml"

0 commit comments

Comments
 (0)