Files
langflow/.github
vjgit96 cb7b838d45 feat: Add DB migration validation workflow for nightly builds (#13249)
* feat: Add DB migration validation workflow for nightly builds (LE-1259)

- Implements automated DB migration testing for nightly builds
- Tests two scenarios: pip/venv and Docker Compose migrations
- Validates migration from stable to nightly versions
- Verifies data persistence (witness flows) across migrations
- Integrated into nightly_build.yml workflow
- Includes Slack notifications for migration test results

This addresses the critical blocker identified by QA team for ensuring
safe database migrations in production deployments.

* docs: Add DB migration validation documentation

- Comprehensive guide for LE-1259 implementation
- Detailed test scenarios and execution details
- Environment configuration and success criteria
- Monitoring and troubleshooting guidelines
- Placed in docs/docs/Deployment/ for easy access

* fix: address PR review comments for DB migration validation

- Use actual nightly tag from create-nightly-tag output instead of hardcoded :latest
- Wire POSTGRES_VERSION env var into postgres service image tag
- Remove unnecessary checkout steps from both migration jobs
- Update step name from 'Create witness flow and credentials' to 'Create witness flow'
- Add -f flag to curl commands for fail-fast behavior
- Add flow creation verification with error handling
- Fix version extraction logic to properly test nightly build instead of PyPI latest
- Remove deprecated docker-compose version field
- Remove duplicate Slack notification job (consolidated in nightly_build.yml)

Addresses all 9 issues identified by @ogabrielluiz in PR review

* docs: remove implementation summary from user-facing docs

Per @ogabrielluiz review feedback, this file reads as an implementation
summary (Jira ticket, branch name, 'Next Steps', 'Files Changed: 2')
rather than user-facing documentation. The Deployment section is for
end-user docs, and this content is better suited for the PR description.

Also not added to sidebars.js, so would be an orphan page.

* fix(workflows): address 6 issues from Gabriel's second review of DB migration validation

Fixes all remaining issues identified in PR #13249 review:

1. Remove schedule trigger - only works on default branch, would cause duplicate runs
2. Fix postgres service image - hardcode to postgres:16 (env context not available in services)
3. Add curl fail-fast flags - use -fsSL for immediate failure on errors
4. Add flow ID verification - check witness data creation succeeded before proceeding
5. Remove orphaned Slack JSON - cleanup leftover from removed notify-results job
6. Fix version extraction - strip 'v' prefix for pip install (${VERSION#v})
7. Fix Docker image reference in nightly_build.yml - pass full image path with tag
8. Fix success notification - check migration validation didn't fail

All changes validated locally:
- YAML syntax validation passed
- Docker Compose config validated
- Tag manipulation logic tested (v prefix handling)
- Curl command structure verified
- Test credentials marked with pragma allowlist secret comments

Related: LE-1259, PR #13249
Depends on: PR #13212 (Docker volume permissions fix)

* fix(ci): address all PR review blockers for DB migration validation workflow

- Add auto_login token auth to all 4 API call sites (Create/Verify witness in both jobs)
- Add credential witness (POST /api/v1/variables/ with type: Credential) to prove
  encrypted-column migrations ran correctly
- Verify witness variable persists after upgrade in both jobs
- Strip 'v' prefix from nightly Docker tag before docker-compose sed replacement
- Fix langflow.__version__ crash - use importlib.metadata instead
- Remove deprecated 'version: 3.8' from inline docker-compose YAML
- Remove bogus LANGFLOW_SUPERUSER/LANGFLOW_SUPERUSER_PASSWORD env vars
- Remove LANGFLOW_SKIP_AUTH_AUTO_LOGIN (only works on nightly, not stable images)
- Fix shellcheck SC2016/SC2102 issues flagged by actionlint
- Mark test credential values with pragma allowlist secret (false positives)
- Update .secrets.baseline with known false positives in new workflow file

* fix(ci): remove duplicate db-migration-validation job after merge

* fix(ci): include default_fields in witness variable payloads

* fix(ci): handle compressed API responses in witness verification

* fix(ci): uninstall stable langflow before installing nightly in pip-venv job

langflow and langflow-nightly both own the same site-packages/langflow/
namespace via a shared langflow-base dependency. Without an explicit
uninstall, the stable copy wins at runtime and python -m langflow still
boots the old version - meaning no nightly migration is exercised and
the test produces a false positive.

Explicitly uninstall langflow + langflow-base before the nightly install
so the namespace is fully handed over to the nightly package.

---------

Co-authored-by: Eric Hare <ericrhare@gmail.com>
2026-05-28 14:26:31 -07:00
..