Skip to content

refactor(ci): replace Docker with uv pip install in migration-test workflow - #230

Merged
lice-reis merged 3 commits into
mainfrom
fix/migration-ui-url-check
May 18, 2026
Merged

refactor(ci): replace Docker with uv pip install in migration-test workflow#230
lice-reis merged 3 commits into
mainfrom
fix/migration-ui-url-check

Conversation

@lice-reis

Copy link
Copy Markdown
Collaborator

Summary

  • Removes all docker pull / docker run / docker stop / docker rm steps from the migration test workflow
  • Installs Langflow directly via uv pip install into a single .venv created once per run
  • Langflow runs as a background process managed by a PID file (/tmp/langflow.pid)
  • Nightly version is resolved at runtime by querying the PyPI JSON API for the latest pre-release
  • All Langflow env vars (database URL, auth, secret key) moved to the workflow-level env: block

Test plan

  • Trigger the workflow manually via workflow_dispatch and confirm both phases start Langflow cleanly against PostgreSQL
  • Confirm /tmp/latest-digest.txt and /tmp/nightly-digest.txt are written as langflow==<version> so the report generates correctly
  • Confirm the nightly version step fails loudly if no pre-release is found on PyPI

🤖 Generated with Claude Code

lice-reis and others added 3 commits May 11, 2026 16:18
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>
@lice-reis
lice-reis requested a review from Copilot May 18, 2026 13:16
@lice-reis
lice-reis merged commit 0b866d1 into main May 18, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.txt as langflow==<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 "")
@Victor-w-Madeira
Victor-w-Madeira deleted the fix/migration-ui-url-check branch May 18, 2026 19:21
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.

2 participants