Skip to content

Commit ac8eeed

Browse files
committed
ci: drop the migration paths-filter gate (out of scope)
Revert the detect-migrations gate carried over from the closed CI PR; we are fixing the connection failure at its source (migrate.ts connection retry) rather than gating db:migrate, which the reviewers correctly noted could leave a previously-merged migration unapplied after a failed deploy.
1 parent 80348ca commit ac8eeed

2 files changed

Lines changed: 1 addition & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,15 @@ jobs:
4949
# Run database migrations before images are pushed: the ECR push triggers
5050
# CodePipeline, so migrating first guarantees the schema is in place before
5151
# the new app version deploys (replaces the removed ECS migration sidecar)
52-
# Detect whether this push actually changed any migration files, so the
53-
# migrate job below can skip connecting to the production/staging database on
54-
# merges that touch no schema (a no-op db:migrate otherwise dials the DB and
55-
# fails any time it is at its connection limit).
56-
detect-migrations:
57-
name: Detect Migration Changes
58-
runs-on: blacksmith-4vcpu-ubuntu-2404
59-
if: >-
60-
github.event_name == 'push' &&
61-
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
62-
outputs:
63-
migrations_changed: ${{ steps.filter.outputs.migrations }}
64-
steps:
65-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
66-
with:
67-
fetch-depth: 2 # Need the previous commit to diff migration paths
68-
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4
69-
id: filter
70-
with:
71-
filters: |
72-
migrations:
73-
- 'packages/db/migrations/**'
74-
75-
# The job always runs on push to main/staging so downstream build/deploy jobs
76-
# that `need` it are never skipped; the actual db:migrate step is gated on
77-
# detect-migrations inside the reusable workflow.
7852
migrate:
7953
name: Migrate DB
80-
needs: [test-build, detect-migrations]
54+
needs: [test-build]
8155
if: >-
8256
github.event_name == 'push' &&
8357
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
8458
uses: ./.github/workflows/migrations.yml
8559
with:
8660
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}
87-
migrations_changed: ${{ needs.detect-migrations.outputs.migrations_changed }}
8861
secrets: inherit
8962

9063
# Same ordering for dev (schema push before the dev image lands in ECR)

.github/workflows/migrations.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ on:
77
description: Target environment (production, staging, or dev)
88
required: true
99
type: string
10-
migrations_changed:
11-
description: >-
12-
Whether this push changed migration files. When 'false' the versioned
13-
apply step is skipped. Defaults to 'true' so manual dispatch and any
14-
omitted/unknown value always applies migrations (never silently skip).
15-
required: false
16-
type: string
17-
default: 'true'
1810
workflow_dispatch:
1911
inputs:
2012
environment:
@@ -69,7 +61,6 @@ jobs:
6961
DATABASE_URL: ${{ inputs.environment == 'production' && secrets.DATABASE_URL || inputs.environment == 'staging' && secrets.STAGING_DATABASE_URL || inputs.environment == 'dev' && secrets.DEV_DATABASE_URL || '' }}
7062
MIGRATION_DATABASE_URL: ${{ inputs.environment == 'production' && secrets.MIGRATION_DATABASE_URL || inputs.environment == 'staging' && secrets.STAGING_MIGRATION_DATABASE_URL || '' }}
7163
ENVIRONMENT: ${{ inputs.environment }}
72-
MIGRATIONS_CHANGED: ${{ inputs.migrations_changed }}
7364
run: |
7465
if [ -z "$DATABASE_URL" ]; then
7566
echo "ERROR: no database URL secret resolved for environment '${ENVIRONMENT}'" >&2
@@ -79,8 +70,6 @@ jobs:
7970
if [ "${ENVIRONMENT}" = "dev" ]; then
8071
echo "Dev environment — pushing schema directly (db:push)"
8172
bun run db:push --force
82-
elif [ "${MIGRATIONS_CHANGED}" = "false" ]; then
83-
echo "No migration files changed in this push — skipping db:migrate (nothing to apply)."
8473
else
8574
echo "Applying versioned migrations (db:migrate)"
8675
bun run ./scripts/migrate.ts

0 commit comments

Comments
 (0)