Skip to content

Commit 2939b02

Browse files
committed
Merge master and address review fixes
2 parents 7a11703 + 5d185bc commit 2939b02

9 files changed

Lines changed: 77 additions & 67 deletions

File tree

.controlplane/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo " -- Waiting for services"
2121
wait_for_service $(echo $DATABASE_URL | sed -e 's|^.*@||' -e 's|/.*$||')
2222
wait_for_service $(echo $REDIS_URL | sed -e 's|redis://||' -e 's|/.*$||')
2323

24-
echo " -- Finishing entrypoint.sh, executing '$*'"
24+
echo " -- Finishing entrypoint.sh, executing '$@'"
2525

2626
# Run the main command
2727
exec "$@"

.github/actions/cpflow-build-docker-image/action.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,25 @@ runs:
3535
- name: Build Docker image
3636
id: build
3737
shell: bash
38+
env:
39+
APP_NAME: ${{ inputs.app_name }}
40+
COMMIT: ${{ inputs.commit }}
41+
DOCKER_BUILD_EXTRA_ARGS: ${{ inputs.docker_build_extra_args }}
42+
DOCKER_BUILD_SSH_KEY: ${{ inputs.docker_build_ssh_key }}
43+
DOCKER_BUILD_SSH_KNOWN_HOSTS: ${{ inputs.docker_build_ssh_known_hosts }}
44+
ORG: ${{ inputs.org }}
45+
PR_NUMBER: ${{ inputs.pr_number }}
3846
run: |
3947
set -euo pipefail
4048
4149
PR_INFO=""
4250
docker_build_args=()
4351
44-
if [[ -n "${{ inputs.pr_number }}" ]]; then
45-
PR_INFO=" for PR #${{ inputs.pr_number }}"
52+
if [[ -n "$PR_NUMBER" ]]; then
53+
PR_INFO=" for PR #${PR_NUMBER}"
4654
fi
4755
48-
if [[ -n "${{ inputs.docker_build_extra_args }}" ]]; then
56+
if [[ -n "$DOCKER_BUILD_EXTRA_ARGS" ]]; then
4957
while IFS= read -r arg; do
5058
arg="${arg%$'\r'}"
5159
[[ -n "${arg}" ]] || continue
@@ -57,17 +65,15 @@ runs:
5765
fi
5866
5967
docker_build_args+=("${arg}")
60-
done <<< "${{ inputs.docker_build_extra_args }}"
68+
done <<< "$DOCKER_BUILD_EXTRA_ARGS"
6169
fi
6270
63-
if [[ -n "${{ inputs.docker_build_ssh_key }}" ]]; then
71+
if [[ -n "$DOCKER_BUILD_SSH_KEY" ]]; then
6472
mkdir -p ~/.ssh
6573
chmod 700 ~/.ssh
6674
67-
if [[ -n "${{ inputs.docker_build_ssh_known_hosts }}" ]]; then
68-
cat <<'EOF' > ~/.ssh/known_hosts
69-
${{ inputs.docker_build_ssh_known_hosts }}
70-
EOF
75+
if [[ -n "$DOCKER_BUILD_SSH_KNOWN_HOSTS" ]]; then
76+
printf '%s\n' "$DOCKER_BUILD_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
7177
else
7278
cat <<'EOF' > ~/.ssh/known_hosts
7379
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
@@ -80,13 +86,14 @@ runs:
8086
8187
eval "$(ssh-agent -s)"
8288
trap 'ssh-agent -k >/dev/null' EXIT
83-
ssh-add - <<< "${{ inputs.docker_build_ssh_key }}"
89+
ssh-add - <<< "$DOCKER_BUILD_SSH_KEY"
90+
unset DOCKER_BUILD_SSH_KEY
8491
docker_build_args+=("--ssh=default")
8592
fi
8693
87-
echo "🏗️ Building Docker image${PR_INFO} (commit ${{ inputs.commit }})..."
88-
cpflow build-image -a "${{ inputs.app_name }}" --commit="${{ inputs.commit }}" --org="${{ inputs.org }}" "${docker_build_args[@]}"
94+
echo "🏗️ Building Docker image${PR_INFO} (commit ${COMMIT})..."
95+
cpflow build-image -a "$APP_NAME" --commit="$COMMIT" --org="$ORG" "${docker_build_args[@]}"
8996
90-
image_tag="${{ inputs.org }}/${{ inputs.app_name }}:${{ inputs.commit }}"
97+
image_tag="${ORG}/${APP_NAME}:${COMMIT}"
9198
echo "image_tag=${image_tag}" >> "$GITHUB_OUTPUT"
92-
echo "✅ Docker image build successful${PR_INFO} (commit ${{ inputs.commit }})"
99+
echo "✅ Docker image build successful${PR_INFO} (commit ${COMMIT})"

.github/actions/cpflow-delete-control-plane-app/delete-app.sh

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,28 @@ fi
1616

1717
echo "🔍 Checking if application exists: $APP_NAME"
1818
exists_output=""
19-
if ! exists_output="$(cpflow exists -a "$APP_NAME" --org "$CPLN_ORG" 2>&1)"; then
20-
case "$exists_output" in
21-
*"Double check your org"*|*"Unknown API token format"*|*"ERROR"*|*"Error:"*|*"Traceback"*|*"Net::"*)
22-
echo "❌ ERROR: failed to determine whether application exists: $APP_NAME" >&2
23-
printf '%s\n' "$exists_output" >&2
24-
exit 1
25-
;;
26-
esac
27-
28-
if [[ -n "$exists_output" ]]; then
29-
printf '%s\n' "$exists_output"
30-
fi
31-
32-
echo "⚠️ Application does not exist: $APP_NAME"
33-
exit 0
34-
fi
19+
set +e
20+
exists_output="$(cpflow exists -a "$APP_NAME" --org "$CPLN_ORG" 2>&1)"
21+
exists_status=$?
22+
set -e
23+
24+
case "$exists_status" in
25+
0)
26+
;;
27+
3)
28+
if [[ -n "$exists_output" ]]; then
29+
printf '%s\n' "$exists_output"
30+
fi
31+
32+
echo "⚠️ Application does not exist: $APP_NAME"
33+
exit 0
34+
;;
35+
*)
36+
echo "❌ ERROR: failed to determine whether application exists: $APP_NAME" >&2
37+
printf '%s\n' "$exists_output" >&2
38+
exit 1
39+
;;
40+
esac
3541

3642
if [[ -n "$exists_output" ]]; then
3743
printf '%s\n' "$exists_output"

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
66
ruby "3.4.6"
77

88
gem "cpflow", "5.1.1", require: false
9-
gem "react_on_rails", "17.0.0.rc.1"
10-
gem "react_on_rails_pro", "17.0.0.rc.1"
9+
gem "react_on_rails_pro", "17.0.0.rc.2"
1110
gem "shakapacker", "10.1.0"
1211

1312
# Bundle edge Rails instead: gem "rails", github: "rails/rails"

Gemfile.lock

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,22 @@ GEM
346346
erb
347347
psych (>= 4.0.0)
348348
tsort
349-
react_on_rails (17.0.0.rc.1)
349+
react_on_rails (17.0.0.rc.2)
350350
addressable
351351
connection_pool
352352
execjs (~> 2.5)
353353
rails (>= 5.2)
354354
rainbow (~> 3.0)
355355
shakapacker (>= 6.0)
356-
react_on_rails_pro (17.0.0.rc.1)
356+
react_on_rails_pro (17.0.0.rc.2)
357357
addressable
358358
async (>= 2.29)
359359
async-http (~> 0.95)
360360
execjs (~> 2.9)
361361
io-endpoint (~> 0.17.0)
362362
jwt (>= 2.5, < 4)
363363
rainbow
364-
react_on_rails (= 17.0.0.rc.1)
364+
react_on_rails (= 17.0.0.rc.2)
365365
redcarpet (3.6.0)
366366
redis (5.3.0)
367367
redis-client (>= 0.22.0)
@@ -549,8 +549,7 @@ DEPENDENCIES
549549
rails-html-sanitizer
550550
rails_best_practices
551551
rainbow
552-
react_on_rails (= 17.0.0.rc.1)
553-
react_on_rails_pro (= 17.0.0.rc.1)
552+
react_on_rails_pro (= 17.0.0.rc.2)
554553
redcarpet
555554
redis (~> 5.0)
556555
rspec-rails (~> 6.0.0)

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,10 @@ assets_bundler: rspack
184184

185185
### Version Targets
186186

187-
- `react_on_rails` gem: `17.0.0.rc.1`
188-
- `react-on-rails` npm package: `17.0.0-rc.1`
189-
- `react_on_rails_pro` gem: `17.0.0.rc.1`
190-
- `react-on-rails-pro` npm package: `17.0.0-rc.1`
191-
- `react-on-rails-pro-node-renderer` npm package: `17.0.0-rc.1`
192-
- `react-on-rails-rsc` npm package: `19.0.5-rc.5`
187+
- `react_on_rails_pro` gem: `17.0.0.rc.2`
188+
- `react-on-rails-pro` npm package: `17.0.0-rc.2`
189+
- `react-on-rails-pro-node-renderer` npm package: `17.0.0-rc.2`
190+
- `react-on-rails-rsc` npm package: `19.0.5-rc.7`
193191
- `shakapacker` gem/npm package: `10.1.0`
194192
- `@rspack/core` and `@rspack/cli`: `2.0.0-beta.7`
195193
- `react`: `~19.0.4` (minimum for React Server Components)

config/initializers/react_on_rails.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
# Build commands
1010
# Direct shakapacker invocations need generated ReScript and locale files first.
1111
config.build_test_command =
12-
"yarn res:build && RAILS_ENV=test bin/rails react_on_rails:locale && RAILS_ENV=test bin/shakapacker"
12+
"yarn res:build && RAILS_ENV=test bin/rails react_on_rails:locale && " \
13+
"RAILS_ENV=test bin/rails react_on_rails:generate_packs && RAILS_ENV=test bin/shakapacker"
1314
config.build_production_command =
1415
"yarn res:build && RAILS_ENV=production NODE_ENV=production bin/rails react_on_rails:locale && " \
16+
"RAILS_ENV=production NODE_ENV=production bin/rails react_on_rails:generate_packs && " \
1517
"RAILS_ENV=production NODE_ENV=production bin/shakapacker"
1618

1719
# This is the file used for server rendering of React when using `(prerender: true)`

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test": "yarn build:test && yarn lint && yarn jest",
3030
"test:client": "yarn jest",
3131
"build:test": "rm -rf public/packs-test && yarn res:build && RAILS_ENV=test NODE_ENV=test bundle exec rails react_on_rails:locale && RAILS_ENV=test NODE_ENV=test bundle exec rake react_on_rails:generate_packs && RAILS_ENV=test NODE_ENV=test bin/shakapacker",
32-
"build:dev": "rm -rf public/packs && yarn res:build && RAILS_ENV=development NODE_ENV=development bundle exec rails react_on_rails:locale && RAILS_ENV=development NODE_ENV=development bin/shakapacker",
32+
"build:dev": "rm -rf public/packs && yarn res:build && RAILS_ENV=development NODE_ENV=development bundle exec rails react_on_rails:locale && RAILS_ENV=development NODE_ENV=development bundle exec rake react_on_rails:generate_packs && RAILS_ENV=development NODE_ENV=development bin/shakapacker",
3333
"build:clean": "rm -rf public/packs || true",
3434
"node-renderer": "node renderer/node-renderer.js"
3535
},
@@ -82,10 +82,9 @@
8282
"react-dom": "~19.0.4",
8383
"react-error-boundary": "^4.1.2",
8484
"react-intl": "^6.4.4",
85-
"react-on-rails": "17.0.0-rc.1",
86-
"react-on-rails-pro": "17.0.0-rc.1",
87-
"react-on-rails-pro-node-renderer": "17.0.0-rc.1",
88-
"react-on-rails-rsc": "19.0.5-rc.5",
85+
"react-on-rails-pro": "17.0.0-rc.2",
86+
"react-on-rails-pro-node-renderer": "17.0.0-rc.2",
87+
"react-on-rails-rsc": "19.0.5-rc.7",
8988
"react-redux": "^8.1.0",
9089
"react-router": "^6.13.0",
9190
"react-router-dom": "^6.13.0",

yarn.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8759,10 +8759,10 @@ react-is@^18.0.0, react-is@^18.3.1:
87598759
resolved "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz"
87608760
integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==
87618761

8762-
react-on-rails-pro-node-renderer@17.0.0-rc.1:
8763-
version "17.0.0-rc.1"
8764-
resolved "https://registry.npmjs.org/react-on-rails-pro-node-renderer/-/react-on-rails-pro-node-renderer-17.0.0-rc.1.tgz#817b3b6e13ffa52e50bc0830eb1136027ea301f2"
8765-
integrity sha512-suh7KVh7zPG0/pctY/BBRlWOV0hucR6elKlpZ6Pgy5lF1cAL3fqgv+hZco6Wr94ZfrfG64UQ5zFdqlnpT7fkMA==
8762+
react-on-rails-pro-node-renderer@17.0.0-rc.2:
8763+
version "17.0.0-rc.2"
8764+
resolved "https://registry.npmjs.org/react-on-rails-pro-node-renderer/-/react-on-rails-pro-node-renderer-17.0.0-rc.2.tgz#9598de1e981fc18c6790aec95c9a8d6503d0d6b0"
8765+
integrity sha512-5dGh259JpGVIaSkTNHz2RLruSahKynGOW/hj8I70AzgE+LnM3hZuXc3WveCjzZl8vQShpGlxgRQxPoOZh9fyQQ==
87668766
dependencies:
87678767
"@fastify/formbody" "^7.4.0 || ^8.0.2"
87688768
"@fastify/multipart" "^8.3.1 || ^9.0.3"
@@ -8772,26 +8772,26 @@ react-on-rails-pro-node-renderer@17.0.0-rc.1:
87728772
lockfile "^1.0.4"
87738773
pino "^9.14.0 || ^10.1.0"
87748774

8775-
react-on-rails-pro@17.0.0-rc.1:
8776-
version "17.0.0-rc.1"
8777-
resolved "https://registry.npmjs.org/react-on-rails-pro/-/react-on-rails-pro-17.0.0-rc.1.tgz#b06d4155baeaf0e5fb26024dc5c55b6063163f91"
8778-
integrity sha512-O2c1PFbcdRgpp4LbtxlMZSCZPXt+DmPV/ugAlXSZWDKK9bSuGZpxHjgpFm2lWlEFkXy5Lh4bhsBRaA42K9MEFw==
8775+
react-on-rails-pro@17.0.0-rc.2:
8776+
version "17.0.0-rc.2"
8777+
resolved "https://registry.npmjs.org/react-on-rails-pro/-/react-on-rails-pro-17.0.0-rc.2.tgz#f5cca27b4123dc8786e225a1ff429212ff260b32"
8778+
integrity sha512-gfB6qUEOQ8ANHFKqQahyS/0NfagdyZ1JgNMVK9O+t863GiMZPnVZa2YVoi/NjHmV6HaRQ3JnODQM3GHbP9s4aQ==
87798779
dependencies:
8780-
react-on-rails "17.0.0-rc.1"
8780+
react-on-rails "17.0.0-rc.2"
87818781

8782-
react-on-rails-rsc@19.0.5-rc.5:
8783-
version "19.0.5-rc.5"
8784-
resolved "https://registry.npmjs.org/react-on-rails-rsc/-/react-on-rails-rsc-19.0.5-rc.5.tgz#2dc1dd30764be9b879a951ecc4d2e921af95952e"
8785-
integrity sha512-NTe3g34iR0ya8XFUpwbqE37ff4x5YGZEGowWGbY4o/wqNPykICDH5Nsd7MjqUSwun5NYqI92FHKHSEhpHgPq2A==
8782+
react-on-rails-rsc@19.0.5-rc.7:
8783+
version "19.0.5-rc.7"
8784+
resolved "https://registry.npmjs.org/react-on-rails-rsc/-/react-on-rails-rsc-19.0.5-rc.7.tgz#cbca0fcec9eb4b82b2faa9cf3c6fbfedd4ecf9b6"
8785+
integrity sha512-cyQwZm7YW9FS0PEgwael5P9S5HsNeHwhnMm10ScgepZTv38dOeidf+gWf9x+z6w0wrgJ92aExZ8uLjCgpImxcQ==
87868786
dependencies:
87878787
acorn-loose "^8.3.0"
87888788
neo-async "^2.6.1"
87898789
webpack-sources "^3.2.0"
87908790

8791-
react-on-rails@17.0.0-rc.1:
8792-
version "17.0.0-rc.1"
8793-
resolved "https://registry.npmjs.org/react-on-rails/-/react-on-rails-17.0.0-rc.1.tgz#5c13081957612e3cb176674217efbc6785ecb362"
8794-
integrity sha512-TLR+LdpdefizXIDR7PUnXL3bUa38hex24AiuMxrrdY2w2ju8GGAKFNZM/6mTc+FatO1Y1MEoPnsRuabtXt8nVQ==
8791+
react-on-rails@17.0.0-rc.2:
8792+
version "17.0.0-rc.2"
8793+
resolved "https://registry.npmjs.org/react-on-rails/-/react-on-rails-17.0.0-rc.2.tgz#faa6cb6eccb8ac9a129c9d124bf833c90ba5d395"
8794+
integrity sha512-Ix3v9k7p/K6lI7fHl/NivIlu/pr3USGdGYANKMltkOluGsshQnUL9Cz7Oj6/LI8l8Rmp9IJwN5QdigMr+Ssqjg==
87958795

87968796
react-proxy@^1.1.7:
87978797
version "1.1.8"

0 commit comments

Comments
 (0)