Skip to content

[FIX]: Conditional proxy setup for frontend development#1386

Merged
jaseemjaskp merged 1 commit into
mainfrom
fix/frontend-dev-setup
Jun 30, 2025
Merged

[FIX]: Conditional proxy setup for frontend development#1386
jaseemjaskp merged 1 commit into
mainfrom
fix/frontend-dev-setup

Conversation

@jaseemjaskp

Copy link
Copy Markdown
Contributor

Summary

This PR fixes an issue in the frontend development setup where the proxy middleware would attempt to initialize even when no backend URL is configured, potentially causing development server startup issues.

Changes

  • Modified to conditionally set up the proxy middleware only if environment variable is provided and not empty
  • Added validation to check if the environment variable exists and is not just whitespace

Motivation

The previous implementation would always attempt to create a proxy middleware regardless of whether a backend URL was configured. This could lead to:

  • Development server startup issues when is not set
  • Potential proxy configuration errors in development environments where backend is not available
  • Better separation of concerns between frontend-only development and full-stack development

Related Issues

This change improves the frontend development experience by making the proxy setup more robust and conditional.

Testing

  • Tested with set - proxy works as expected
  • Tested without - no proxy is created, frontend starts without issues
  • Tested with empty - no proxy is created

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • Code follows the project's style guidelines
  • Self-review of the code has been performed
  • Changes have been tested locally
  • No breaking changes introduced
  • Frontend development setup works with and without backend URL configuration

@github-actions

Copy link
Copy Markdown
Contributor
filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_for\_sidecar}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_sidecar\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{11}}$$ $$\textcolor{#23d18b}{\tt{11}}$$

@sonarqubecloud

Copy link
Copy Markdown

@jaseemjaskp jaseemjaskp changed the title Fix: Conditional proxy setup for frontend development [FIX]: Conditional proxy setup for frontend development Jun 27, 2025
@jaseemjaskp jaseemjaskp merged commit eeb23e3 into main Jun 30, 2025
6 checks passed
@jaseemjaskp jaseemjaskp deleted the fix/frontend-dev-setup branch June 30, 2025 06:43
pk-zipstack pushed a commit that referenced this pull request Aug 20, 2025
Only set up proxy if backend URL env var exists
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.

3 participants