Skip to content

Commit c795fe6

Browse files
JacobCoffeeclaude
andcommitted
Seed 15 pipeline runs over 90 days with 2 failures
Spreads deploys across 90 days so 7d/30d/90d range filters show different data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4402f91 commit c795fe6

1 file changed

Lines changed: 39 additions & 24 deletions

File tree

cabotage/scripts/seed_localdev.py

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -365,43 +365,58 @@ def seed():
365365
else:
366366
configs_web_staging = list(web_staging.configurations)
367367

368-
# Images for Web/Production (3 images, spread over 72h)
368+
# Pipeline runs for Web/Production — 15 deploys spread over 90 days
369369
if web_prod.images.count() == 0:
370-
_make_image(app_web, web_prod, build_ref="main", processes=WEB_PROCESSES,
371-
age_hours=72, duration_secs=65)
372-
_make_image(app_web, web_prod, build_ref="main", processes=WEB_PROCESSES,
373-
age_hours=48, duration_secs=52)
374-
latest_web_prod_img = _make_image(
375-
app_web, web_prod, build_ref="main", processes=WEB_PROCESSES,
376-
age_hours=6, duration_secs=38,
377-
)
370+
_pipeline_runs = [
371+
# (age_days, img_dur, rel_dur, dep_dur, error)
372+
(85, 72, 14, 32, False),
373+
(75, 68, 12, 28, False),
374+
(65, 58, 11, 25, True), # failed deploy
375+
(55, 61, 13, 30, False),
376+
(45, 55, 10, 22, False),
377+
(38, 50, 9, 27, False),
378+
(30, 48, 11, 24, False),
379+
(22, 45, 8, 20, False),
380+
(18, 52, 12, 26, True), # failed deploy
381+
(14, 42, 9, 21, False),
382+
(10, 40, 8, 19, False),
383+
(7, 44, 10, 23, False),
384+
(4, 39, 7, 18, False),
385+
(2, 41, 9, 20, False),
386+
(0.25, 38, 8, 17, False), # 6 hours ago
387+
]
388+
for age_d, i_dur, r_dur, d_dur, err in _pipeline_runs:
389+
age_h = age_d * 24
390+
img = _make_image(app_web, web_prod, build_ref="main",
391+
processes=WEB_PROCESSES,
392+
age_hours=age_h, duration_secs=i_dur)
393+
rel = _make_release(app_web, web_prod, img, configs_web_prod,
394+
age_hours=age_h - 0.5, duration_secs=r_dur)
395+
_make_deployment(app_web, web_prod, rel,
396+
complete=not err, age_hours=age_h - 1,
397+
duration_secs=d_dur)
398+
if err:
399+
# Mark the deployment as errored
400+
dep = web_prod.deployments.order_by(
401+
Deployment.created.desc()).first()
402+
dep.error = True
403+
dep.error_detail = "Readiness probe failed"
404+
latest_web_prod_img = web_prod.images.filter_by(built=True).order_by(
405+
Image.version.desc()).first()
406+
latest_web_prod_rel = web_prod.releases.filter_by(built=True).order_by(
407+
Release.version.desc()).first()
378408
else:
379409
latest_web_prod_img = (
380410
web_prod.images.filter_by(built=True)
381411
.order_by(Image.version.desc())
382412
.first()
383413
)
384-
385-
# Releases for Web/Production (2 releases)
386-
if web_prod.releases.count() == 0:
387-
_make_release(app_web, web_prod, latest_web_prod_img, configs_web_prod,
388-
age_hours=47, duration_secs=15)
389-
latest_web_prod_rel = _make_release(
390-
app_web, web_prod, latest_web_prod_img, configs_web_prod,
391-
age_hours=5, duration_secs=10,
392-
)
393-
else:
394414
latest_web_prod_rel = (
395415
web_prod.releases.filter_by(built=True)
396416
.order_by(Release.version.desc())
397417
.first()
398418
)
399419

400-
# Deployment for Web/Production
401-
if web_prod.deployments.count() == 0:
402-
_make_deployment(app_web, web_prod, latest_web_prod_rel, complete=True,
403-
age_hours=5, duration_secs=25)
404-
405420
# Process counts for Web/Production
406421
web_prod.process_counts = {"web": 2, "worker": 1}
407422

0 commit comments

Comments
 (0)