Skip to content

Add Control Plane flow to open flights demo#3

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

Add Control Plane flow to open flights demo#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

Summary

  • add the shared cpflow review-app, staging, and production-promotion GitHub Actions scaffolding
  • add repo-specific Control Plane config/docs for the open-flights Postgres deployment flow
  • fix clean-clone deployability issues by checking in the generated SSR registry and removing the duplicate javascript_pack_tag that broke / in production

Validation

  • docker build -t rof-cpflow-test -f .controlplane/Dockerfile .
  • mise exec ruby@3.4.6 -- ruby /Users/justin/codex/control-plane-flow/cpflow config -a react-on-rails-open-flights-example-staging
  • mise exec ruby@3.4.6 -- ruby -e 'require "yaml"; Dir.glob("{.controlplane,.github}/**/*.{yml,yaml}").sort.each { |path| YAML.safe_load_file(path, aliases: true); puts path }'
  • release-phase + runtime smoke with Docker/Postgres: GET / => 200, GET /api/v1/airlines => 200
  • Linux containerized test run with Postgres: bundle exec rspec --format progress (5 examples, 0 failures, 1 pending)

Note

Medium Risk
Introduces new deployment infrastructure (Docker build, multi-environment Control Plane config, and GitHub Actions for review/staging/production promotion), which could affect build/deploy behavior if misconfigured. App runtime changes are small but touch asset/SSR build and layout JS tags.

Overview
Adds Control Plane deployment support via new .controlplane scaffolding: a Docker build that bundles Node + Ruby, installs JS deps conditionally, precompiles assets, runs db:prepare on boot/release, and templates for a Rails workload plus a stateful Postgres workload.

Introduces GitHub Actions workflows and composite actions to automate opt-in review apps (/deploy-review-app + /delete-review-app), scheduled cleanup of stale review apps, automatic staging deploys on push, and manual staging→production promotion with health check, rollback, and GitHub release creation.

Fixes deployability issues by checking in the generated SSR registry (app/javascript/generated/server-bundle-generated.js), adjusting .gitignore to keep it tracked, removing a duplicate javascript_pack_tag from the layout, and minor dependency hygiene (moves a Babel plugin to devDependencies and updates Gemfile.lock).

Reviewed by Cursor Bugbot for commit 37660ad. Bugbot is set up for automated code reviews on this repo. 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: 4431305c22

ℹ️ 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".

# Runs before the main command

echo " -- Preparing database"
rails db:prepare
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 Abort startup when database preparation fails

entrypoint.sh runs rails db:prepare before booting the server, but the script never enables set -e (or checks the exit code), so a failed migration/DB connection still falls through to exec "$@". In production this can start the web process in a broken state (or with schema drift) instead of failing fast and letting the platform retry/rollback, which makes bad deploys harder to detect and recover from.

Useful? React with 👍 / 👎.

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.

Entrypoint missing set -e silently swallows database failures

Medium Severity

entrypoint.sh lacks set -e, so a failing rails db:prepare (e.g. Postgres not yet reachable) is silently ignored and the container proceeds to exec "$@", starting the Rails server against an unprepared database. The sibling release_script.sh correctly includes set -e, making this omission look unintentional. Users would see 500 errors on every database-dependent request while the container appears healthy.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4431305. Configure here.

# Runs before the main command

echo " -- Preparing database"
rails db:prepare
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 duplicates release script's database preparation step

Low Severity

entrypoint.sh runs rails db:prepare unconditionally as the Docker ENTRYPOINT, meaning it executes before every container command — including the release script, which itself also runs db:prepare. This results in db:prepare running twice during the release phase (entrypoint then release script) and a third time when the web container starts, adding unnecessary startup latency per deploy.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4431305. Configure here.


concurrency:
group: cpflow-review-app-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
cancel-in-progress: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Workflow-level concurrency cancels deploys on any PR comment

Medium Severity

The concurrency block with cancel-in-progress: true is at the workflow level, but the /deploy-review-app command check is at the job level if. Since the workflow triggers on all issue_comment created events, any ordinary comment on a PR (e.g. "LGTM") creates a workflow run that enters the concurrency group and cancels an in-progress deployment for that PR — even though the new run's job is immediately skipped. This silently kills active review app deployments.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4431305. Configure here.

@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 22 minutes and 59 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 22 minutes and 59 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: 971d25a5-8c27-47e5-b914-23d5ad4ae125

📥 Commits

Reviewing files that changed from the base of the PR and between 2faad72 and 37660ad.

⛔ Files ignored due to path filters (2)
  • Gemfile.lock is excluded by !**/*.lock
  • app/javascript/generated/server-bundle-generated.js is excluded by !**/generated/**
📒 Files selected for processing (23)
  • .controlplane/Dockerfile
  • .controlplane/controlplane.yml
  • .controlplane/entrypoint.sh
  • .controlplane/readme.md
  • .controlplane/release_script.sh
  • .controlplane/templates/app.yml
  • .controlplane/templates/postgres.yml
  • .controlplane/templates/rails.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
  • .gitignore
  • README.md
  • app/views/layouts/application.html.erb
  • 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 4 total unresolved issues (including 3 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 6328657. 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.

Stray characters in entrypoint echo output

Low Severity

The echo on line 7 contains a stray @' at the end of the format string. The value '$*'@' produces garbled output like executing 'rails s'@' instead of the intended executing 'rails s'. The trailing @' appears to be an accidental insertion.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6328657. 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