Skip to content

Commit 48626f6

Browse files
authored
Update cpflow GitHub Actions to 5.0.4 (#750)
1 parent 678592c commit 48626f6

13 files changed

Lines changed: 84 additions & 35 deletions

.controlplane/docs/testing-cpflow-github-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ bin/conductor-exec bin/test-cpflow-github-flow ruby /path/to/control-plane-flow/
3030
```
3131

3232
Leave `CPFLOW_VERSION` unset while testing a commit SHA. After the upstream gem
33-
and tag ship, repin wrappers to the release tag, such as `v5.0.1`.
33+
and tag ship, repin wrappers to the release tag, such as `v5.0.4`.
3434

3535
## Review App Canary
3636

.controlplane/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ Keep the reusable-workflow mechanics in the upstream
524524
For this repo, the update loop is:
525525

526526
1. Generate from the desired `cpflow` release with `--staging-branch master`.
527-
2. Keep generated refs on a release tag such as `v5.0.1`. Use a full upstream
527+
2. Keep generated refs on a release tag such as `v5.0.4`. Use a full upstream
528528
commit SHA only for short-lived downstream testing of an unreleased upstream
529529
PR, and leave `CPFLOW_VERSION` unset in that case.
530530
3. Keep app names and GitHub settings aligned with `.controlplane/controlplane.yml`.

.controlplane/shakacode-team.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Advanced optional settings are documented upstream in the
7979
[`control-plane-flow` CI automation guide](https://github.com/shakacode/control-plane-flow/blob/main/docs/ci-automation.md).
8080

8181
Current workflow wrappers are pinned to the upstream `control-plane-flow`
82-
release tag `v5.0.1`. Keep release tags as the steady-state configuration; use
82+
release tag `v5.0.4`. Keep release tags as the steady-state configuration; use
8383
a full commit SHA only for short-lived upstream PR testing.
8484

8585
If staging moves off `master`, update both `STAGING_APP_BRANCH` and the branch
@@ -90,7 +90,7 @@ filter in `.github/workflows/cpflow-deploy-staging.yml`.
9090
When the upstream `control-plane-flow` repo changes the generated GitHub Actions
9191
flow, regenerate from the target `cpflow` version with `--staging-branch master`,
9292
review the diff, and validate with `bin/test-cpflow-github-flow` plus the normal
93-
CI checks. Stable automation should use release tags such as `v5.0.1`, not
93+
CI checks. Stable automation should use release tags such as `v5.0.4`, not
9494
`main` or a feature branch.
9595

9696
See [readme.md](readme.md) and

.github/cpflow-help.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
These commands are generated by [cpflow](https://github.com/shakacode/control-plane-flow).
44
For full setup, version-pinning, and troubleshooting details, see the upstream
5-
[CI automation guide](https://github.com/shakacode/control-plane-flow/blob/v5.0.1/docs/ci-automation.md).
5+
[CI automation guide](https://github.com/shakacode/control-plane-flow/blob/v5.0.4/docs/ci-automation.md).
66

77
## Pull Request Commands
88

@@ -45,10 +45,17 @@ Before the first staging deploy, bootstrap the persistent staging app once:
4545
cpflow setup-app -a "$STAGING_APP_NAME" --org "$CPLN_ORG_STAGING" --skip-post-creation-hook
4646
```
4747

48-
`setup-app` creates the app identity, app secret dictionary, app secret policy,
49-
policy binding, and template resources. For later template updates on an
50-
existing persistent app, use `cpflow apply-template` and make sure the app
51-
identity has `reveal` permission on the app secret policy.
48+
`setup-app` reads `.controlplane/controlplane.yml`'s `setup_app_templates` and
49+
creates the app identity, app secret dictionary, app secret policy, policy
50+
binding, and template resources. Use `--skip-post-creation-hook` so first-time
51+
bootstrap does not try to run database setup before an image exists. For later
52+
template updates on an existing persistent app, use `cpflow apply-template`
53+
with the same template list and make sure the app identity has `reveal`
54+
permission on the app secret policy.
55+
56+
Review apps are temporary and are created by the `+review-app-deploy` workflow,
57+
but staging and production are persistent apps and should be bootstrapped
58+
explicitly.
5259

5360
Production promotion is part of the generated flow, but keep it protected:
5461

@@ -69,17 +76,32 @@ production org, using production-only secrets and values.
6976
## Version Locking
7077

7178
Generated wrappers pin Control Plane Flow once with the reusable workflow
72-
`uses:` ref, for example `@v5.0.1`. For stable releases, this ref should be a
73-
release tag. The upstream reusable workflow automatically
79+
`uses:` ref, for example `@v5.0.4`. For stable releases,
80+
this ref should be a release tag. The upstream reusable workflow automatically
7481
loads its matching shared actions from GitHub's workflow context, so downstream
7582
wrappers should not pass a duplicate Control Plane Flow ref input. If your
7683
generated wrappers still include a `with:` block whose only purpose is to repeat
7784
the same ref, regenerate them with a newer `cpflow`.
7885

7986
Leave `CPFLOW_VERSION` unset so the workflow builds cpflow from the same
8087
checked-out upstream source. If you set `CPFLOW_VERSION`, it must match the
81-
release tag, for example `CPFLOW_VERSION=5.0.1` with a wrapper pinned to
82-
`uses: ...@v5.0.1`.
88+
release tag, for example `CPFLOW_VERSION=5.0.4` with a wrapper pinned to
89+
`uses: ...@v5.0.4`.
90+
91+
After updating the `cpflow` gem in this repo, update the generated wrappers in
92+
the same PR:
93+
94+
```sh
95+
cpflow update-github-actions
96+
bin/test-cpflow-github-flow
97+
```
98+
99+
If `cpflow` is bundled by the app, use:
100+
101+
```sh
102+
bundle exec cpflow update-github-actions
103+
bin/test-cpflow-github-flow bundle exec cpflow
104+
```
83105

84106
Do not leave downstream apps pinned to a moving branch such as `main`. For a
85107
short-lived test of an unreleased upstream PR, pin to a full 40-character commit

.github/workflows/cpflow-cleanup-stale-review-apps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ jobs:
1212
cleanup:
1313
# Cleanup targets the current inferred review-app prefix. If you changed
1414
# naming conventions, manually delete review apps under the old prefix.
15-
uses: shakacode/control-plane-flow/.github/workflows/cpflow-cleanup-stale-review-apps.yml@v5.0.1
15+
uses: shakacode/control-plane-flow/.github/workflows/cpflow-cleanup-stale-review-apps.yml@v5.0.4
1616
secrets:
1717
CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ jobs:
3131
github.event_name == 'workflow_dispatch'
3232
# This `if:` mirrors the upstream job guard to avoid a billable workflow_call
3333
# when the event does not match. Keep both conditions in sync.
34-
uses: shakacode/control-plane-flow/.github/workflows/cpflow-delete-review-app.yml@v5.0.1
34+
uses: shakacode/control-plane-flow/.github/workflows/cpflow-delete-review-app.yml@v5.0.4
3535
secrets:
3636
CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
github.event.issue.pull_request &&
3131
contains(fromJson('["+review-app-deploy","+review-app-deploy\n","+review-app-deploy\r\n"]'), github.event.comment.body) &&
3232
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
33-
uses: shakacode/control-plane-flow/.github/workflows/cpflow-deploy-review-app.yml@v5.0.1
33+
uses: shakacode/control-plane-flow/.github/workflows/cpflow-deploy-review-app.yml@v5.0.4
3434
secrets:
3535
CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}
3636
DOCKER_BUILD_SSH_KEY: ${{ secrets.DOCKER_BUILD_SSH_KEY }}

.github/workflows/cpflow-deploy-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616

1717
jobs:
1818
deploy-staging:
19-
uses: shakacode/control-plane-flow/.github/workflows/cpflow-deploy-staging.yml@v5.0.1
19+
uses: shakacode/control-plane-flow/.github/workflows/cpflow-deploy-staging.yml@v5.0.4
2020
with:
2121
staging_app_branch_default: "master"
2222
secrets:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
contains(fromJson('["+review-app-help","+review-app-help\n","+review-app-help\r\n"]'), github.event.comment.body) &&
2424
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
2525
github.event_name == 'workflow_dispatch'
26-
uses: shakacode/control-plane-flow/.github/workflows/cpflow-help-command.yml@v5.0.1
26+
uses: shakacode/control-plane-flow/.github/workflows/cpflow-help-command.yml@v5.0.4

.github/workflows/cpflow-promote-staging-to-production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
jobs:
1717
promote-to-production:
1818
if: github.event.inputs.confirm_promotion == 'promote'
19-
uses: shakacode/control-plane-flow/.github/workflows/cpflow-promote-staging-to-production.yml@v5.0.1
19+
uses: shakacode/control-plane-flow/.github/workflows/cpflow-promote-staging-to-production.yml@v5.0.4
2020
with:
2121
# Keep CPLN_TOKEN_PRODUCTION as a secret on this protected GitHub
2222
# Environment. The caller passes the environment name, the upstream

0 commit comments

Comments
 (0)