refactor(ci): replace Docker with uv pip install in migration-test workflow - #230
Merged
Conversation
CSS class selectors (.react-flow, [class*='react-flow']) are brittle across ReactFlow version bumps. Replaced with a URL assertion (flow_id in URL) which is version-independent and verifies the page actually loaded the correct flow without redirecting to home or login. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… (visible) The previous selector body > * resolved to the <noscript> element first, which is never visible when JS is enabled — causing a timeout every run. Switch to body > div with state=attached so the check passes as soon as the React root div is present in the DOM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rkflow Switch from pulling and running Docker containers to installing Langflow directly via uv into a single .venv, avoiding container recreation on every run. Langflow now runs as a background process with a PID file; nightly version is resolved from PyPI at runtime. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Refactors the migration-test GitHub Actions workflow to run Langflow directly via uv (no Docker) and adjusts the UI migration test’s “editor loaded” assertion to be less coupled to ReactFlow internals.
Changes:
- Replace Docker pulls/runs with
uv pip install+uv run langflow(latest then nightly) and manage the server via a PID file. - Resolve “nightly” at runtime using the PyPI JSON API and record
/tmp/*-digest.txtaslangflow==<version>. - Update UI migration test to validate flow navigation by URL + basic DOM attachment rather than ReactFlow selectors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
tests/github-workflows/migration/test_ui_migration.py |
Loosens UI assertion from ReactFlow selectors to URL + DOM presence checks. |
.github/workflows/migration-test.yml |
Replaces Docker-based Langflow runs with uv-based installs/runs and PyPI-driven nightly resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Verify the flow editor loaded: check the URL still contains the flow_id | ||
| # (not redirected to home/login) and that the page has interactive content. | ||
| # Avoids coupling to ReactFlow's internal CSS class names which change across versions. | ||
| expect(self.page).to_have_url(re.compile(self.flow_id), timeout=20_000) |
Comment on lines
+60
to
+67
| # Verify the flow editor loaded: check the URL still contains the flow_id | ||
| # (not redirected to home/login) and that the page has interactive content. | ||
| # Avoids coupling to ReactFlow's internal CSS class names which change across versions. | ||
| expect(self.page).to_have_url(re.compile(self.flow_id), timeout=20_000) | ||
|
|
||
| # Also verify the React app div is in the DOM (not a blank/loading screen). | ||
| # Uses state="attached" to avoid matching the invisible <noscript> sibling. | ||
| self.page.wait_for_selector("body > div", state="attached", timeout=10_000) |
|
|
||
| # Also verify the React app div is in the DOM (not a blank/loading screen). | ||
| # Uses state="attached" to avoid matching the invisible <noscript> sibling. | ||
| self.page.wait_for_selector("body > div", state="attached", timeout=10_000) |
Comment on lines
+63
to
+64
| - name: Create virtual environment | ||
| run: uv venv .venv |
| docker pull langflowai/langflow:latest | ||
| docker inspect langflowai/langflow:latest --format='{{index .RepoDigests 0}}' > /tmp/latest-digest.txt | ||
| echo "Latest digest: $(cat /tmp/latest-digest.txt)" | ||
| uv pip install langflow |
| -e LANGFLOW_STORE=false \ | ||
| -e LANGFLOW_SECRET_KEY="$LANGFLOW_SECRET_KEY" \ | ||
| langflowai/langflow:latest | ||
| uv run langflow run --host 0.0.0.0 --port "$LANGFLOW_PORT" \ |
| - name: Save latest container logs | ||
| if: always() | ||
| run: docker logs langflow > /tmp/langflow-latest.log 2>&1 || true | ||
| - name: Stop Langflow latest |
| # Fixed key shared by both containers so credentials encrypted by latest | ||
| # can be decrypted by nightly after DB migration. | ||
| LANGFLOW_SECRET_KEY: "migration-test-fixed-secret-32chars!!" | ||
| LANGFLOW_DATABASE_URL: "postgresql://langflow:langflow_test_pw@localhost:5432/langflow" |
| docker inspect langflowai/langflow:latest --format='{{index .RepoDigests 0}}' > /tmp/latest-digest.txt | ||
| echo "Latest digest: $(cat /tmp/latest-digest.txt)" | ||
| uv pip install langflow | ||
| LATEST_VERSION=$(uv pip show langflow | grep ^Version | awk '{print $2}') |
Comment on lines
+108
to
+115
| import urllib.request, json | ||
| data = json.loads(urllib.request.urlopen("https://pypi.org/pypi/langflow/json").read()) | ||
| pre = [ | ||
| v for v in data["releases"] | ||
| if data["releases"][v] and any(c in v for c in ("dev", "a", "b", "rc")) | ||
| ] | ||
| pre.sort(key=lambda v: data["releases"][v][0]["upload_time"]) | ||
| print(pre[-1] if pre else "") |
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docker pull/docker run/docker stop/docker rmsteps from the migration test workflowuv pip installinto a single.venvcreated once per run/tmp/langflow.pid)env:blockTest plan
workflow_dispatchand confirm both phases start Langflow cleanly against PostgreSQL/tmp/latest-digest.txtand/tmp/nightly-digest.txtare written aslangflow==<version>so the report generates correctly🤖 Generated with Claude Code