fix: migration script to encode backslashes in existing Doltgres JSONB data #9033
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Cypress | |
| on: | |
| pull_request: | |
| branches: ["*"] | |
| merge_group: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| # Lightweight check on a cheap runner — avoids spinning up expensive service | |
| # containers (Doltgres, Postgres) on ubuntu-32gb just to skip everything. | |
| changeset-check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is_changeset: ${{ steps.check.outputs.is_changeset }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| sparse-checkout: .github/composite-actions/changeset-check | |
| fetch-depth: 1 | |
| - uses: ./.github/composite-actions/changeset-check | |
| id: check | |
| cypress-e2e-run: | |
| needs: changeset-check | |
| if: needs.changeset-check.outputs.is_changeset != 'true' | |
| name: Cypress E2E Tests (run) | |
| runs-on: ubuntu-32gb | |
| timeout-minutes: 30 | |
| services: | |
| doltgres: | |
| image: dolthub/doltgresql:0.55.4 | |
| env: | |
| DOLTGRES_USER: appuser | |
| DOLTGRES_PASSWORD: password | |
| DOLTGRES_DB: inkeep_agents | |
| DOLTGRES_DATA_DIR: /var/lib/doltgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "PGPASSWORD=password psql -h localhost -U appuser -d inkeep_agents -c 'SELECT count(*) FROM dolt_status' || exit 1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| --health-start-period 30s | |
| postgres: | |
| image: postgres:18 | |
| env: | |
| POSTGRES_DB: inkeep_agents | |
| POSTGRES_USER: appuser | |
| POSTGRES_PASSWORD: password | |
| options: >- | |
| --health-cmd "pg_isready -U appuser -d inkeep_agents" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5433:5432 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22.x | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5 | |
| with: | |
| version: 10.33.0 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| # Create necessary directories for postinstall scripts | |
| - name: Prepare directories | |
| run: | | |
| mkdir -p agents-docs/.source | |
| touch agents-docs/.source/index.ts | |
| - name: Setup pnpm cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: ${{ runner.os }}-pnpm-store- | |
| - name: Setup Turborepo cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-turbo- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| HUSKY: 0 | |
| # Clean database files before running tests | |
| - name: Clean database files | |
| run: | | |
| echo "Cleaning up any existing database files..." | |
| find . -name "*.db" -o -name "*.sqlite" | grep -v node_modules | xargs -r rm -f | |
| # Start SpiceDB (needs explicit `serve` subcommand, so can't use service container) | |
| - name: Start SpiceDB | |
| run: | | |
| docker run -d --name spicedb \ | |
| --network host \ | |
| -e SPICEDB_GRPC_PRESHARED_KEY=dev-secret-key \ | |
| -e SPICEDB_DATASTORE_ENGINE=memory \ | |
| -e SPICEDB_HTTP_ENABLED=true \ | |
| authzed/spicedb serve | |
| echo "Waiting for SpiceDB to be ready..." | |
| for i in $(seq 1 30); do | |
| if nc -z 127.0.0.1 50051 2>/dev/null; then | |
| echo "SpiceDB is ready!" | |
| break | |
| fi | |
| echo " Attempt $i/30..." | |
| sleep 1 | |
| done | |
| # Run Cypress E2E tests using composite action | |
| - name: Run Cypress E2E Tests | |
| uses: ./.github/composite-actions/cypress-e2e | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=8192 | |
| TURBO_TELEMETRY_DISABLED: 1 | |
| TURBO_CACHE_DIR: .turbo | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| # Infrastructure config matching GitHub Actions service containers. | |
| # These are NOT secrets — they're identical to .env.example defaults. | |
| # Needed here because the Next.js build step must NOT see runtime | |
| # secrets from $GITHUB_ENV, so only these + ENVIRONMENT are set at | |
| # the calling step level. Auth credentials (BETTER_AUTH_SECRET, | |
| # password, bypass secret) are generated by setup-dev and exported | |
| # selectively to $GITHUB_ENV for runtime steps only. | |
| ENVIRONMENT: test | |
| INKEEP_AGENTS_MANAGE_DATABASE_URL: postgresql://appuser:password@localhost:5432/inkeep_agents | |
| INKEEP_AGENTS_RUN_DATABASE_URL: postgresql://appuser:password@localhost:5433/inkeep_agents | |
| SPICEDB_PRESHARED_KEY: dev-secret-key | |
| OTEL_SDK_DISABLED: true | |
| CYPRESS_NO_COMMAND_LOG: 1 | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| # Gate job: satisfy the required "Cypress E2E Tests" branch-protection check | |
| # even when the heavy job is skipped on changeset PRs. | |
| cypress-e2e: | |
| name: Cypress E2E Tests | |
| needs: [changeset-check, cypress-e2e-run] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check result | |
| run: | | |
| if [ "${{ needs.cypress-e2e-run.result }}" = "failure" ] || [ "${{ needs.cypress-e2e-run.result }}" = "cancelled" ]; then | |
| exit 1 | |
| fi |