Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Fix JSON schema validation to allow copilot-only deploys without requiring externalDatabase
  • Add missing PGDATA env var to copilot PostgreSQL (fixes CrashLoopBackOff with subPath mount)
  • Bump copilot postgres default from 16-alpine to 17-alpine
  • Use configured image for migration init container instead of hardcoded postgres:16-alpine
  • Guard ingress app/realtime rules behind their enabled flags so copilot-only ingress works

Type of Change

  • Bug fix
  • Improvement

Testing

Validated via helm template for standard, copilot-only, and full+copilot scenarios

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 11, 2026 0:57am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

This PR enables copilot-only deployments in the Helm chart by fixing several critical issues:

  • Schema validation fix: Modified values.schema.json to allow copilot-only deployments without requiring externalDatabase when both app and realtime are disabled
  • PostgreSQL crash fix: Added missing PGDATA environment variable to copilot PostgreSQL StatefulSet, which was causing CrashLoopBackOff when using subPath mounts (the main PostgreSQL setup already had this properly configured)
  • Ingress template improvements: Guarded app and realtime ingress rules behind their respective enabled flags so copilot can have its own ingress when app/realtime are disabled
  • Migration job consistency: Replaced hardcoded postgres:16-alpine with the configured copilot PostgreSQL image reference
  • Version upgrade: Bumped default copilot PostgreSQL from 16-alpine to 17-alpine across values files

The changes follow established patterns from the main PostgreSQL setup and enable three deployment scenarios: standard (app+realtime), copilot-only, and full (all services).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes fix real bugs (CrashLoopBackOff, schema validation) and follow existing patterns from the main PostgreSQL setup. The ingress template logic correctly handles conditional rendering, and the migration job now uses consistent image configuration instead of hardcoded values.
  • No files require special attention

Important Files Changed

Filename Overview
helm/sim/values.schema.json Fixed JSON schema validation to allow copilot-only deployments by adding anyOf constraint requiring either app or realtime to be enabled when PostgreSQL is disabled
helm/sim/templates/statefulset-copilot-postgres.yaml Added PGDATA environment variable to fix CrashLoopBackOff when using subPath mount with PostgreSQL
helm/sim/templates/ingress.yaml Guarded app and realtime ingress rules behind their respective enabled flags to support copilot-only deployments
helm/sim/templates/job-copilot-migrations.yaml Replaced hardcoded postgres:16-alpine with configured copilot PostgreSQL image for migration init container

Sequence Diagram

sequenceDiagram
    participant Helm as Helm Chart
    participant Schema as JSON Schema
    participant Ingress as Ingress Resources
    participant Copilot as Copilot Server
    participant Migrations as Migration Job
    participant DB as PostgreSQL

    Note over Helm,Schema: Copilot-Only Deployment Flow
    
    Helm->>Schema: Validate configuration
    Schema->>Schema: Check if app/realtime disabled
    Schema->>Schema: Verify copilot enabled OR externalDatabase
    Schema-->>Helm: Validation passes (copilot-only allowed)
    
    Helm->>DB: Deploy StatefulSet
    Note over DB: PGDATA=/var/lib/postgresql/data/pgdata
    Note over DB: subPath mount: pgdata
    DB->>DB: Initialize with correct data directory
    
    Helm->>Migrations: Create migration job
    Migrations->>DB: Wait for PostgreSQL (pg_isready)
    Note over Migrations: Uses configured postgres:17-alpine image
    DB-->>Migrations: Database ready
    Migrations->>DB: Run migrations
    
    Helm->>Ingress: Create ingress rules
    Note over Ingress: Skip app rules (app.enabled=false)
    Note over Ingress: Skip realtime rules (realtime.enabled=false)
    Ingress->>Copilot: Route only copilot paths
    
    Copilot->>DB: Connect to database
    DB-->>Copilot: Connection established
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1 waleedlatif1 merged commit f8e9614 into staging Feb 11, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/helm branch February 11, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant