Repository navigation
180 lines (169 loc) · 8.02 KB
/
Copy pathe2e-deploy.yml
File metadata and controls
180 lines (169 loc) · 8.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: E2E deploy
# Deploys examples/storefront-auth and examples/orm-demo to real Prisma
# Cloud, verifies each round trip, then destroys them. Requires repo secret
# PRISMA_SERVICE_TOKEN and repo variable PRISMA_WORKSPACE_ID.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
# Every job here creates a fresh per-run Project, and a new Project needs a region.
PRISMA_REGION: us-east-1
# Fixed group (not per-ref): only one real-cloud deploy runs at a time.
# cancel-in-progress stays false so a kill mid-deploy/destroy can't orphan resources.
concurrency:
group: e2e-deploy
cancel-in-progress: false
jobs:
deploy:
name: Deploy, verify, destroy
runs-on: ubuntu-latest
timeout-minutes: 7
# Secrets aren't available on forked-PR runs; skip rather than fail loudly.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
PRISMA_SERVICE_TOKEN: ${{ secrets.PRISMA_SERVICE_TOKEN }}
PRISMA_WORKSPACE_ID: ${{ vars.PRISMA_WORKSPACE_ID }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: ./.github/actions/deploy-verify-destroy
with:
working-directory: examples/storefront-auth
build-filter: '@prisma/example-storefront-auth...'
stack-name: storefront-auth-ci-${{ github.run_id }}
verify-command: bun scripts/e2e-verify.ts
platform-variables: AUTH_SIGNING_SECRET
deploy-orm-demo:
name: Deploy, verify, destroy (orm-demo)
runs-on: ubuntu-latest
# Not a data dependency — runs after storefront so the two deploys never
# hold projects/databases concurrently (workspace DB-quota headroom).
needs: deploy
timeout-minutes: 5
# Secrets aren't available on forked-PR runs; skip rather than fail loudly.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
PRISMA_SERVICE_TOKEN: ${{ secrets.PRISMA_SERVICE_TOKEN }}
PRISMA_WORKSPACE_ID: ${{ vars.PRISMA_WORKSPACE_ID }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: ./.github/actions/deploy-verify-destroy
with:
working-directory: examples/orm-demo
build-filter: '@prisma/example-orm-demo...'
stack-name: orm-demo-ci-${{ github.run_id }}
verify-command: bun scripts/e2e-verify.ts
destroy-label: 'orm-demo '
sweep-prefixes: storefront-auth orm-demo hello canary bucket
deploy-bucket:
name: Deploy, verify, destroy (bucket)
runs-on: ubuntu-latest
needs: deploy-orm-demo
timeout-minutes: 5
# Secrets aren't available on forked-PR runs; skip rather than fail loudly.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
PRISMA_SERVICE_TOKEN: ${{ secrets.PRISMA_SERVICE_TOKEN }}
PRISMA_WORKSPACE_ID: ${{ vars.PRISMA_WORKSPACE_ID }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: ./.github/actions/deploy-verify-destroy
with:
working-directory: examples/bucket
build-filter: '@prisma/example-bucket...'
stack-name: bucket-ci-${{ github.run_id }}
verify-command: bun scripts/e2e-verify.ts
destroy-label: 'bucket '
sweep-prefixes: storefront-auth orm-demo hello canary bucket
cold-connect-canary:
name: Cold-connect canary (FT-5226)
runs-on: ubuntu-latest
# Runs after both deploys so it never holds a database concurrently with
# them (workspace DB-quota headroom). Fails when PPg no longer rejects a
# database's first connection — the signal to remove withConnectionRetry.
needs: deploy-bucket
# Samples are spaced 60s apart so each one meets a genuinely cold database
# (see SAMPLE_INTERVAL_MS in the script for why back-to-back sampling
# produced a false bug-gone verdict). Most runs still finish in a couple of
# minutes because the loop stops at the first rejection, which is the
# normal outcome today; only a fully clean run pays all 13 intervals. The
# script's own MAX_RUN_MS (15 min) stops it and still reports, so this is
# headroom for that self-imposed stop, not the primary mechanism.
timeout-minutes: 20
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
PRISMA_SERVICE_TOKEN: ${{ secrets.PRISMA_SERVICE_TOKEN }}
PRISMA_WORKSPACE_ID: ${{ vars.PRISMA_WORKSPACE_ID }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: ./.github/actions/setup
- run: pnpm install --frozen-lockfile
- run: bun scripts/cold-connect-canary.ts
cold-start-canary:
name: Cold-start canary (PRO-217)
runs-on: ubuntu-latest
# After the FT-5226 canary for the same quota-serialization reason as the
# deploys. Fails when the ingress no longer closes first-touch connections
# to a booting instance — the signal to remove the streams client's
# IDEMPOTENT_BACKOFF (the PRO-219 compensation) and this canary. The bug
# being PRESENT is today's normal and passes.
#
# Runtime: the script spaces its samples 60s apart and stops at the first
# close (see cold-start-canary.ts), so a normal run — the bug is live
# today — finishes quickly: four live runs of this version of the script
# all closed on the very first sample, one measured (via `time`) at
# 96.86s end to end. The worst case is a run that never sees a close and
# has to collect MIN_HELD_SAMPLES_FOR_BUG_GONE (14) confirmed cold-start
# holds to justify a bug-gone verdict: at roughly 85s per sample (60s
# spacing plus ~21-25s of create/upload/start/promote/touch/log-read, per
# those same live runs), 14 samples is about 20 minutes, plus this job's
# own install/build/deploy/destroy/sweep steps. cold-start-canary.ts's own
# MAX_RUN_MS (20 minutes) stops the sampling loop and reports whatever it
# has collected before that point, so the 30-minute timeout here is
# headroom for the script to reach that self-imposed stop and still exit
# cleanly — not the primary mechanism.
needs: cold-connect-canary
timeout-minutes: 30
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
PRISMA_SERVICE_TOKEN: ${{ secrets.PRISMA_SERVICE_TOKEN }}
PRISMA_WORKSPACE_ID: ${{ vars.PRISMA_WORKSPACE_ID }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: ./.github/actions/deploy-verify-destroy
with:
working-directory: examples/streams
build-filter: '@prisma/example-streams...'
stack-name: streams-canary-ci-${{ github.run_id }}
verify-command: bun "${{ github.workspace }}/scripts/cold-start-canary.ts"
destroy-label: 'streams-canary '
sweep-prefixes: storefront-auth orm-demo hello canary streams-canary bucket resolver
logical-id-resolution:
name: Logical-id resolution
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
PRISMA_SERVICE_TOKEN: ${{ secrets.PRISMA_SERVICE_TOKEN }}
PRISMA_WORKSPACE_ID: ${{ vars.PRISMA_WORKSPACE_ID }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: ./.github/actions/setup
- run: pnpm install --frozen-lockfile
- run: pnpm turbo run build --filter '@internal/lowering^...'
- run: bun scripts/logical-id-resolution.ts