NangoHQ / nango

A single API for all your integrations.
https://www.nango.dev
Other
4.64k stars 419 forks source link

Broken UI when CI env var is set to false #2717

Open sgrodzicki opened 1 month ago

sgrodzicki commented 1 month ago

I've encountered a bug in Nango where the UI becomes dysfunctional when the CI environment variable is set to false. This issue arises when using Flightcontrol for deployments as it automatically sets this variable to false.

I've identified 3 instances of the CI environment variable within Nango's codebase. However, none of these instances involve a direct comparison of the variable's value. Instead, they merely check for its existence. This approach seems suboptimal, as it could lead to unintended consequences in certain scenarios (like a broken UI).

Steps to Reproduce:

  1. Create a Docker Compose file (see below) that sets the CI environment variable to false for the Nango container.
  2. Start the Nango container using the Docker Compose file (docker-compose up).
  3. Access the Nango UI (http://localhost:3003).
# docker-compose.yaml
services:
  nango-db:
    container_name: nango-db
    image: postgres:16
    environment:
      POSTGRES_USER: nango
      POSTGRES_PASSWORD: nango
      POSTGRES_DB: nango
  nango-server:
    container_name: nango-server
    image: nangohq/nango-server:hosted
    platform: linux/amd64
    environment:
      CI: false # That's breaking the UI
      FLAG_AUTH_ENABLED: false
      NANGO_DASHBOARD_USERNAME: nango
      NANGO_DASHBOARD_PASSWORD: nango
      NANGO_DATABASE_URL: postgres://nango:nango@nango-db:5432/nango
    ports:
      - 3003:3003
    depends_on:
      - nango-db

Expected Behavior:

The Nango UI should function normally regardless of the CI environment variable's value (or at least when it's set to anything but true).

Actual Behavior:

The Nango UI displays errors and becomes unresponsive when CI is set to false.

Proposed Solution:

Implement a more robust check for the CI environment variable, comparing its value to ensure correct behavior.

linear[bot] commented 1 month ago

NAN-1701 Broken UI when CI env var is set to false