Skip to content

Add Control Plane flow to migration example#3

Open
justin808 wants to merge 4 commits intomainfrom
add-cpflow-github-flow
Open

Add Control Plane flow to migration example#3
justin808 wants to merge 4 commits intomainfrom
add-cpflow-github-flow

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Apr 15, 2026

Note

Medium Risk
Adds new Docker build/runtime entrypoint and multiple GitHub Actions workflows that build/push/deploy images with secrets; misconfiguration could affect deployments or accidentally mutate/delete Control Plane resources.

Overview
Adds Control Plane (cpflow) deployment scaffolding: a new .controlplane/ Dockerfile (Ruby + Node, JS deps install, asset precompile), entrypoint/release script (db:prepare), and templates for a Rails workload plus persistent volumes for SQLite and Active Storage.

Introduces reusable GitHub composite actions and workflows to opt-in deploy/delete PR review apps, auto-deploy staging on configured branches, nightly cleanup of stale review apps, and manual promotion from staging to production with basic health checks/rollback support.

Updates the app for SSR/build compatibility by removing mini_racer (relying on Node/ExecJS), adding React on Rails ror_components client/server wrappers, switching react_component calls to props: keyword args (and dropping javascript_pack_tag from application.html.erb), adding config/tailwind.config.js, and tightening the esbuild build script input.

Reviewed by Cursor Bugbot for commit 1e769a0. Bugbot is set up for automated code reviews on this repo. Configure here.

rails db:prepare

echo " -- Finishing entrypoint.sh, executing '$@'"
exec "$@"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing set -e lets failed db:prepare start app

Medium Severity

The entrypoint.sh script is missing set -e, so if rails db:prepare fails, the script silently continues and starts the application via exec "$@" against a potentially unprepared database. The sibling release_script.sh correctly includes set -e for the same operation, suggesting this omission is unintentional.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5b81dc2. Configure here.

Comment thread config/tailwind.config.js
require("@tailwindcss/typography"),
require("daisyui")
]
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tailwind config missing daisyui theme settings

Medium Severity

The new config/tailwind.config.js is used by tailwindcss-rails during rails assets:precompile (including the Docker build), but it's missing the daisyui theme configuration and custom font family (Inter var) present in the root tailwind.config.js. The layout references data-theme="halloween" and the root config explicitly restricts themes to ['bumblebee', 'halloween']. This discrepancy between the two configs can produce different CSS output in production versus development.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5b81dc2. Configure here.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b81dc2383

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .controlplane/Dockerfile
COPY .controlplane/entrypoint.sh ./
ENTRYPOINT ["/app/entrypoint.sh"]

CMD ["rails", "s"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bind Rails server to all interfaces in container

Running rails s without a bind address starts Puma on localhost by default, so the process may only listen on loopback inside the container. In Control Plane/Kubernetes-style networking, external traffic and health checks target the container/pod IP, which can leave the workload unreachable even though the process is running. Use a command that binds to 0.0.0.0 for container deployments.

Useful? React with 👍 / 👎.

Comment on lines +177 to +180
if cpflow exists -a "${APP_NAME}" --org "${CPLN_ORG}"; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail fast when review-app existence check errors

This check treats any non-zero exit from cpflow exists as “app does not exist,” so authentication/API failures are misclassified as a missing app. On pull_request events that path leads to a silent skip (“create with /deploy-review-app”) instead of surfacing the real infrastructure error, which can block automatic redeploys for existing review apps and make failures hard to diagnose.

Useful? React with 👍 / 👎.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Warning

Rate limit exceeded

@justin808 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 0 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 23 minutes and 0 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 415838eb-e981-4722-9313-d5f7845d9797

📥 Commits

Reviewing files that changed from the base of the PR and between 241dd6d and 1e769a0.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (36)
  • .controlplane/Dockerfile
  • .controlplane/controlplane.yml
  • .controlplane/entrypoint.sh
  • .controlplane/readme.md
  • .controlplane/release_script.sh
  • .controlplane/templates/app.yml
  • .controlplane/templates/db.yml
  • .controlplane/templates/rails.yml
  • .controlplane/templates/storage.yml
  • .github/actions/cpflow-build-docker-image/action.yml
  • .github/actions/cpflow-delete-control-plane-app/action.yml
  • .github/actions/cpflow-delete-control-plane-app/delete-app.sh
  • .github/actions/cpflow-setup-environment/action.yml
  • .github/workflows/cpflow-cleanup-stale-review-apps.yml
  • .github/workflows/cpflow-delete-review-app.yml
  • .github/workflows/cpflow-deploy-review-app.yml
  • .github/workflows/cpflow-deploy-staging.yml
  • .github/workflows/cpflow-help-command.yml
  • .github/workflows/cpflow-promote-staging-to-production.yml
  • .github/workflows/cpflow-review-app-help.yml
  • Gemfile
  • README.md
  • app/javascript/src/Navbar/ror_components/Navbar.client.jsx
  • app/javascript/src/Navbar/ror_components/Navbar.server.jsx
  • app/javascript/src/PostsIndex/ror_components/PostsIndex.client.jsx
  • app/javascript/src/PostsIndex/ror_components/PostsIndex.server.jsx
  • app/javascript/src/PostsShow/ror_components/PostsShow.client.jsx
  • app/javascript/src/PostsShow/ror_components/PostsShow.server.jsx
  • app/javascript/src/components/Navbar.jsx
  • app/javascript/src/pages/PostsShow.jsx
  • app/views/layouts/application.html.erb
  • app/views/posts/index.html.erb
  • app/views/posts/show.html.erb
  • config/tailwind.config.js
  • config/webpack/serverWebpackConfig.js
  • package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-cpflow-github-flow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because on-demand usage is turned off. To enable Bugbot Autofix, turn on on-demand usage and set a spend limit in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9238039. Configure here.

echo " -- Preparing database"
rails db:prepare

echo " -- Finishing entrypoint.sh, executing '$*'@'"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entrypoint echo message has stray characters from typo

Low Severity

The echo string '$*'@'" contains a stray @' at the end that produces garbled log output. For example, with the default CMD ["rails", "s"], the container will log -- Finishing entrypoint.sh, executing 'rails s'@' instead of the intended -- Finishing entrypoint.sh, executing 'rails s'. The trailing @' appears to be a typo — the closing portion of the string after $* expansion is malformed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9238039. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant