|
1 | | -# Control Plane GitHub Flow |
| 1 | +# Review app help |
| 2 | + |
| 3 | +You asked for review app help. These commands are generated by [cpflow](https://github.com/shakacode/control-plane-flow). |
2 | 4 |
|
3 | 5 | ## PR commands |
4 | 6 |
|
5 | | -`/deploy-review-app` |
| 7 | +`+review-app-deploy` |
6 | 8 | - Creates the review app if it does not exist |
7 | 9 | - Builds the PR commit image |
8 | 10 | - Deploys the image and comments with the review URL |
9 | | -- Comment body must be exactly `/deploy-review-app` — no surrounding text, trailing whitespace, or trailing newline. The trigger uses an exact-equality match, so a comment like `please /deploy-review-app now` or `/deploy-review-app ` (with a trailing space) silently no-ops. |
| 11 | +- Comment body must be exactly `+review-app-deploy`, with no surrounding text or trailing spaces. A single trailing newline from GitHub's comment editor is accepted. Comments like `please +review-app-deploy now` or `+review-app-deploy ` (with a trailing space) silently no-op. |
10 | 12 |
|
11 | | -`/delete-review-app` |
| 13 | +`+review-app-delete` |
12 | 14 | - Deletes the review app when the PR is done |
13 | 15 | - This also runs automatically when the PR closes |
14 | | -- Same exact-match rule as `/deploy-review-app`: the comment body must be exactly `/delete-review-app`. |
| 16 | +- Comment body must be exactly `+review-app-delete`, with no surrounding text or trailing spaces. A single trailing newline from GitHub's comment editor is accepted. Same command-match rule as `+review-app-deploy`. |
| 17 | + |
| 18 | +`+review-app-help` |
| 19 | +- Posts this message on the PR. |
| 20 | +- Comment body must be exactly `+review-app-help`, with no surrounding text or trailing spaces. A single trailing newline from GitHub's comment editor is accepted. Same command-match rule as `+review-app-deploy`. |
| 21 | + |
| 22 | +## Workflow behavior |
| 23 | + |
| 24 | +- Review apps are opt-in and created with `+review-app-deploy` |
| 25 | +- New commits redeploy existing review apps automatically |
| 26 | +- Pushes to the staging branch deploy staging automatically |
| 27 | +- Promotion to production is manual via the Actions tab |
| 28 | +- A nightly workflow removes stale review apps |
| 29 | + |
| 30 | +<details> |
| 31 | +<summary>Advanced: GitHub Actions secrets and variables</summary> |
15 | 32 |
|
16 | | -## Repository secrets |
| 33 | +### GitHub Actions secrets |
17 | 34 |
|
18 | 35 | | Name | Required | Notes | |
19 | 36 | | --- | --- | --- | |
20 | | -| `CPLN_TOKEN_STAGING` | yes | Service-account token scoped to the staging org. | |
21 | | -| `CPLN_TOKEN_PRODUCTION` | yes (for promote) | Service-account token scoped to the production org. | |
| 37 | +| `CPLN_TOKEN_STAGING` | yes | Service-account token scoped to the staging Control Plane org on controlplane.com. | |
| 38 | +| `CPLN_TOKEN_PRODUCTION` | yes (for promote) | Service-account token scoped to the production Control Plane org on controlplane.com. | |
22 | 39 | | `DOCKER_BUILD_SSH_KEY` | optional | Private SSH key used when Docker builds fetch private deps via `RUN --mount=type=ssh`. | |
23 | 40 |
|
24 | | -## Repository variables |
| 41 | +### GitHub Actions variables |
25 | 42 |
|
26 | 43 | | Name | Required | Notes | |
27 | 44 | | --- | --- | --- | |
28 | | -| `CPLN_ORG_STAGING` | yes | Control Plane org for staging and review apps. | |
29 | | -| `CPLN_ORG_PRODUCTION` | yes (for promote) | Control Plane org for production. | |
| 45 | +| `CPLN_ORG_STAGING` | yes | Control Plane org on controlplane.com for staging and review apps. | |
| 46 | +| `CPLN_ORG_PRODUCTION` | yes (for promote) | Control Plane org on controlplane.com for production. | |
30 | 47 | | `STAGING_APP_NAME` | yes | App name in `controlplane.yml` used as the staging deploy target. | |
31 | 48 | | `PRODUCTION_APP_NAME` | yes (for promote) | App name in `controlplane.yml` used as the production deploy target. | |
32 | 49 | | `REVIEW_APP_PREFIX` | yes | Prefix for per-PR review app names (e.g. `review-app`). | |
|
35 | 52 | | `DOCKER_BUILD_EXTRA_ARGS` | optional | Newline-delimited extra docker build tokens (e.g. `--build-arg=FOO=bar`). | |
36 | 53 | | `DOCKER_BUILD_SSH_KNOWN_HOSTS` | optional | SSH known_hosts entries when SSH build hosts are not GitHub.com. | |
37 | 54 | | `HEALTH_CHECK_ACCEPTED_STATUSES` | optional | Space-separated HTTP statuses considered healthy on promote (default `200 301 302`). | |
38 | | -| `HEALTH_CHECK_RETRIES` / `HEALTH_CHECK_INTERVAL` | optional | Production health polling controls; defaults to `24` retries and `15` seconds. | |
39 | | -| `ROLLBACK_READINESS_RETRIES` / `ROLLBACK_READINESS_INTERVAL` | optional | Post-rollback health polling controls; defaults to `24` retries and `15` seconds. | |
40 | 55 | | `CPLN_CLI_VERSION` | optional | Pin a specific `@controlplane/cli` version; falls back to the action default when unset. | |
41 | 56 | | `CPFLOW_VERSION` | optional | Pin a specific cpflow gem version; falls back to the generated default when unset. | |
42 | 57 |
|
43 | | -## Workflow behavior |
| 58 | +</details> |
44 | 59 |
|
45 | | -- Review apps are opt-in and created with `/deploy-review-app` |
46 | | -- New commits redeploy existing review apps automatically |
47 | | -- Slash command workflows run from the default branch until merged. Test PR-branch edits with `gh workflow run cpflow-deploy-review-app.yml --ref <branch> -f pr_number=<pr-number>`. |
48 | | -- Pushes to the staging branch deploy staging automatically |
49 | | -- Promotion to production is manual via the Actions tab |
50 | | -- A nightly workflow removes stale review apps |
| 60 | +<details> |
| 61 | +<summary>Advanced: testing changes to generated workflows</summary> |
| 62 | + |
| 63 | +When iterating on the generated workflow YAML on a PR branch, comment-triggered runs (`+review-app-deploy`, `+review-app-delete`, `+review-app-help`) execute the workflow code from the repository's default branch — not your PR branch. To exercise the PR-branch workflow code before merging, dispatch the workflow manually with `gh`: |
| 64 | + |
| 65 | +```sh |
| 66 | +gh workflow run cpflow-deploy-review-app.yml --ref <your-pr-branch> -f pr_number=<pr-number> |
| 67 | +gh workflow run cpflow-delete-review-app.yml --ref <your-pr-branch> -f pr_number=<pr-number> |
| 68 | +gh workflow run cpflow-help-command.yml --ref <your-pr-branch> -f pr_number=<pr-number> |
| 69 | +``` |
| 70 | + |
| 71 | +`workflow_dispatch` runs use the workflow file from the `--ref` you pass, so this is the supported way to test PR-branch workflow edits before merge. After merge, comment triggers go back to running the default-branch workflow code as usual. |
| 72 | + |
| 73 | +</details> |
0 commit comments