Skip to content

Commit 8b4be0c

Browse files
committed
Update cpflow review app guidance
1 parent 0e5f9e9 commit 8b4be0c

14 files changed

Lines changed: 137 additions & 113 deletions

File tree

.controlplane/readme.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,13 @@ This repo now uses the shared `cpflow-*` GitHub Actions scaffolding:
124124
- `.github/workflows/cpflow-promote-staging-to-production.yml`
125125
- `.github/workflows/cpflow-cleanup-stale-review-apps.yml`
126126

127+
The legacy workflows in this branch keep their help text inline instead of using
128+
the newer generated `.github/cpflow-help.md` file. The local setup action
129+
installs `cpflow` 5.1.1 by default.
130+
127131
Behavior:
128132

129-
- comment `/deploy-review-app` on a PR to create or update a review app
133+
- comment `+review-app-deploy` on a PR to create or update a review app
130134
- later pushes to that PR auto-redeploy the existing review app
131135
- pushes to `master` auto-deploy staging unless `STAGING_APP_BRANCH` overrides it
132136
- production promotion happens manually from the Actions tab
@@ -158,10 +162,19 @@ Optional variables:
158162

159163
Operational notes:
160164

161-
- `/deploy-review-app` and `/delete-review-app` only run for trusted commenters (`OWNER`, `MEMBER`, `COLLABORATOR`)
165+
- `+review-app-deploy`, `+review-app-delete`, and `+review-app-help` only run for trusted commenters (`OWNER`, `MEMBER`, `COLLABORATOR`)
162166
- fork PRs still receive help comments, but review app deploys are skipped because the workflow builds Docker images with repository secrets
163167
- PR pushes do not auto-create review apps; the first deploy remains opt-in
164168

169+
Secret grant notes for `cpflow` 5.1.1:
170+
171+
- this repo keeps the app secret dictionary and policy placeholders,
172+
`{{APP_SECRETS}}` and `{{APP_SECRETS_POLICY}}`
173+
- `shared_secret_grants` is only for a separate shared org-level dictionary
174+
referenced from templates with `{{SHARED_SECRET_<NAME>}}`
175+
- do not add `shared_secret_grants` here unless the app/workload templates start
176+
referencing such a shared dictionary
177+
165178
## HTTP/2 and Thruster Configuration
166179

167180
This application uses [Thruster](https://github.com/basecamp/thruster), a zero-config HTTP/2 proxy from Basecamp, for optimized performance on Control Plane.

.controlplane/shakacode-team.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Deployments are handled by Control Plane configuration in this repo and GitHub Actions.
66

77
### Review Apps
8-
- Add a comment `/deploy-review-app` to any PR to deploy a review app
8+
- Add a comment `+review-app-deploy` to any PR to deploy a review app
99

1010
### Staging Environment
1111
- **Automatic**: Any merge to the `master` branch automatically deploys to staging

.controlplane/templates/org.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Org level secrets are used to store sensitive information that is
2-
# shared across multiple apps in the same organization. This is
3-
# useful for storing things like API keys, database credentials, and
4-
# other sensitive information that is shared across multiple apps
5-
# in the same organization.
1+
# App secret dictionaries store sensitive information for apps in the
2+
# organization. This template keeps the cpflow app-secret placeholders
3+
# {{APP_SECRETS}} and {{APP_SECRETS_POLICY}}.
4+
#
5+
# cpflow 5.1.1 shared_secret_grants are only for a separate shared
6+
# org-level dictionary referenced from app/workload templates with
7+
# {{SHARED_SECRET_<NAME>}}.
68

79
# This is how you apply this once (not during CI)
810
# cpl apply-template secrets -a qa-react-webpack-rails-tutorial --org shakacode-open-source-examples-staging
@@ -15,7 +17,7 @@ data:
1517

1618
---
1719

18-
# Policy is needed to allow identities to access secrets
20+
# App secret policy grants app identities reveal access to this dictionary.
1921
kind: policy
2022
name: {{APP_SECRETS_POLICY}}
2123
targetKind: secret

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ runs:
6666
6767
if [[ -n "${{ inputs.docker_build_ssh_known_hosts }}" ]]; then
6868
cat <<'EOF' > ~/.ssh/known_hosts
69-
${{ inputs.docker_build_ssh_known_hosts }}
70-
EOF
69+
${{ inputs.docker_build_ssh_known_hosts }}
70+
EOF
7171
else
7272
cat <<'EOF' > ~/.ssh/known_hosts
73-
github.com ssh-ed25519 AAAAC3NzaC1lZDI1N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ABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
76+
EOF
7777
fi
7878
7979
chmod 600 ~/.ssh/known_hosts

.github/actions/cpflow-setup-environment/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inputs:
1919
cpflow_version:
2020
description: cpflow gem version
2121
required: false
22-
default: "4.2.0"
22+
default: "5.1.1"
2323

2424
runs:
2525
using: composite

.github/workflows/cpflow-delete-review-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
if: |
3333
(github.event_name == 'issue_comment' &&
3434
github.event.issue.pull_request &&
35-
github.event.comment.body == '/delete-review-app' &&
35+
contains(fromJson('["+review-app-delete","+review-app-delete\n","+review-app-delete\r\n"]'), github.event.comment.body) &&
3636
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
3737
(github.event_name == 'pull_request_target' && github.event.action == 'closed') ||
3838
github.event_name == 'workflow_dispatch'

.github/workflows/cpflow-deploy-review-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
github.event_name == 'workflow_dispatch' ||
3939
(github.event_name == 'issue_comment' &&
4040
github.event.issue.pull_request &&
41-
github.event.comment.body == '/deploy-review-app' &&
41+
contains(fromJson('["+review-app-deploy","+review-app-deploy\n","+review-app-deploy\r\n"]'), github.event.comment.body) &&
4242
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
4343
runs-on: ubuntu-latest
4444

@@ -186,7 +186,7 @@ jobs:
186186
run: |
187187
{
188188
echo "Review app ${APP_NAME} does not exist yet."
189-
echo "Create it with a PR comment that is exactly /deploy-review-app."
189+
echo "Create it with +review-app-deploy as the PR comment body."
190190
} >> "$GITHUB_STEP_SUMMARY"
191191
192192
- name: Setup review app if it does not exist yet

.github/workflows/cpflow-help-command.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
if: |
2020
(github.event_name == 'issue_comment' &&
2121
github.event.issue.pull_request &&
22-
github.event.comment.body == '/help' &&
22+
contains(fromJson('["+review-app-help","+review-app-help\n","+review-app-help\r\n"]'), github.event.comment.body) &&
2323
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
2424
github.event_name == 'workflow_dispatch'
2525
runs-on: ubuntu-latest
@@ -34,15 +34,18 @@ jobs:
3434
"",
3535
"## PR commands",
3636
"",
37-
"`/deploy-review-app`",
37+
"`+review-app-deploy`",
3838
"- Creates the review app if it does not exist",
3939
"- Builds the PR commit image",
4040
"- Deploys the image and comments with the review URL",
4141
"",
42-
"`/delete-review-app`",
42+
"`+review-app-delete`",
4343
"- Deletes the review app when the PR is done",
4444
"- This also runs automatically when the PR closes",
4545
"",
46+
"`+review-app-help`",
47+
"- Shows this help message",
48+
"",
4649
"## Repository secrets",
4750
"",
4851
"- `CPLN_TOKEN_STAGING`",
@@ -61,9 +64,15 @@ jobs:
6164
"- `DOCKER_BUILD_EXTRA_ARGS` (optional Docker build flags)",
6265
"- `DOCKER_BUILD_SSH_KNOWN_HOSTS` (optional when SSH build hosts are not GitHub.com)",
6366
"",
67+
"## App secrets and shared grants",
68+
"",
69+
"- This repo keeps the app secret dictionary/policy pattern generated from `{{APP_SECRETS}}` and `{{APP_SECRETS_POLICY}}`",
70+
"- `shared_secret_grants` is only for a separate shared org-level dictionary referenced from templates with `{{SHARED_SECRET_<NAME>}}`",
71+
"- Do not add `shared_secret_grants` unless app templates actually reference that shared dictionary",
72+
"",
6473
"## Workflow behavior",
6574
"",
66-
"- Review apps are opt-in and created with `/deploy-review-app`",
75+
"- Review apps are opt-in and created with `+review-app-deploy`",
6776
"- New commits redeploy existing review apps automatically",
6877
"- Pushes to the staging branch deploy staging automatically",
6978
"- Promotion to production is manual via the Actions tab",

.github/workflows/cpflow-review-app-help.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
const body = [
2020
"# Control Plane review app commands",
2121
"",
22-
"`/deploy-review-app`",
22+
"`+review-app-deploy`",
2323
"Create the review app or redeploy the PR branch to it.",
2424
"",
25-
"`/delete-review-app`",
25+
"`+review-app-delete`",
2626
"Delete the review app and its temporary resources.",
2727
"",
28-
"`/help`",
28+
"`+review-app-help`",
2929
"Show the required GitHub variables, secrets, and workflow behavior."
3030
].join("\n");
3131

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

66
ruby "3.4.6"
77

8-
gem "react_on_rails", "16.6.0.rc.0"
8+
gem "react_on_rails", "17.0.0.rc.1"
99
gem "shakapacker", "10.0.0.rc.0"
1010

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

0 commit comments

Comments
 (0)