Repository navigation
feat(projects): persist typed project configuration - #15273
ogabrielluiz wants to merge 3 commits into
Conversation
Pre-merge checks:
|
| Check name | Status | Explanation |
|---|---|---|
| Test Coverage For New Implementations | PR #15273 (langflow-ai/langflow, author ogabrielluiz) adds typed project configuration. I fetched the PR head (b3340e2) and base (cb3bfa4) and diffed them. The diff touches 20 files: 14 source and mi… |
|
| Test Quality And Coverage | The PR (#15273, author ogabrielluiz) adds typed project configuration. The checkout is a single squashed commit with no base history, so the exact patch could not be isolated. The assessment therefore… |
|
| Excessive Mock Usage Warning | The PR adds tests that use few or no mocks, so the excessive-mock condition does not apply. I fetched the PR head branch review/harness-a02-project-types (b3340e2) and diffed it from merge-base 41… |
Full details: Test Coverage For New Implementations
-
Explanation
PR
#15273(langflow-ai/langflow, author ogabrielluiz) adds typed project configuration. I fetched the PR head (b3340e2) and base (cb3bfa4) and diffed them. The diff touches 20 files: 14 source and migration files, and 6 test files. The test files are src/backend/tests/unit/api/v1/test_projects.py (+344), src/backend/tests/unit/api/v1/test_project_types.py (+101), src/backend/tests/unit/api/v1/test_export_secret_sanitization.py, src/backend/tests/unit/api/v1/test_migration_pause.py, src/lfx/tests/unit/projects/test_project_types.py (+259), and src/lfx/tests/unit/projects/init.py. Criterion 1 and 3 (tests for new functionality): The new behavior has matching tests. - Project create, PATCH, PUT/upsert, and explicit-null clearing of project_config and project_type are tested (test_create_project_defaults_project_type_to_flows, test_create_project_persists_explicit_project_type, test_patch_project_clears_project_config_with_explicit_null, test_upsert_project_updates_project_type, test_patch_project_rejects_explicit_null_project_type). - Unknown-type rejection (validate_project_type) is tested by test_project_type_rejects_unknown_values. - The ZIP export and import path is tested end to end by test_project_type_survives_zip_round_trip, test_zip_import_falls_back_on_unknown_project_type, and test_zip_import_ignores_malformed_project_config. These cover _imported_project_type and imported_project_config. - The lfx registry, schema, and builtins are tested in TestRegistry, TestSections, TestWriteThroughTargetsAreReal, TestStandaloneImport, and TestFieldSerialisation. - The API routes are tested, including authentication. - Gap: the new Alembic migration b8e1c47d3f56 and its merge revisions have no dedicated unit test in this PR. The PR description says Postgres migration suites were run outside this diff, so I cannot confirm that coverage here. The check asks for integration tests only "where appropriate", so I did not treat this as a failure. Criterion 2 (regression tests for bug fixes): The change is a feature. The tests include regression-style cases, such as the malformed project_config that previously returned 500, and the unknown project_type fallback on import. Criterion 4 (naming): New test files follow test*.py for the backend and lfx Python suites. No frontend test files are in the diff. Criterion 5 (non-placeholder tests): I read the bodies of several new tests. They assert status codes, persisted values, and round-trip contents, and they use real fixtures and requests. None are placeholders. Overall, the PR includes meaningful tests for its new functionality. The only gap is the lack of a dedicated migration test in this diff.
Full details: Test Quality And Coverage
-
Explanation
The PR (
#15273, author ogabrielluiz) adds typed project configuration. The checkout is a single squashed commit with no base history, so the exact patch could not be isolated. The assessment therefore rests on the feature tests present in the tree, which target the new behavior. Evidence: - Main functionality covered.src/backend/tests/unit/api/v1/test_projects.py(about lines 2919-3248) tests: - default typeflowson create; - explicitproject_typeandproject_configpersisted on POST, re-read with GET; - PATCH and PUT re-typing, with persistence re-checked by GET; - explicit-null clearing ofproject_config, versus omitted fields left unchanged; - ZIP export and import round trip, including the reservedproject.metamember; - a flow named "project" surviving the round trip; - malformedproject_configin an upload degrading to none. - Success and error paths for endpoints. Error cases include unknown and emptyproject_typeon create and PATCH (422), and explicit nullproject_typeon PATCH (422). Unknown types in an uploaded ZIP fall back toflows.src/backend/tests/unit/api/v1/test_project_types.pycoversGET /api/v1/projects/typesfor success (200), authentication refusal (401/403), route ordering against/{project_id}, and the form contents. - Behavioral depth. Assertions check stored values and response shapes, not only status codes. For example,test_the_form_carries_the_sections_it_should_be_grouped_intoandtest_the_harness_form_can_be_saved_as_a_project_configcheck field data and a save-back round trip. - Shared vocabulary.src/lfx/tests/unit/projects/test_project_types.pyhas 31 test functions for the registry,ProjectTypeandProjectTypeField. It covers duplicate registration, unknown-name errors, section ordering, and import without Langflow. - Async pattern.asyncio_mode = "auto"is set in the backend and lfx pyproject files. The tests useasync defwithAsyncClientandlogged_in_headers, which follows the pytest project pattern. - Frontend. The tree contains no frontend source referencing project types, so Jest and Playwright tests were not required for this layer. Gaps (minor, not failure conditions of this check): - No test targets theb8e1c47d3f56migration itself. Only generic migration tests exist undertests/test_migrationsandtests/unit/utils/test_migration.py. - Test coverage of the migration merge revisions was not confirmed. Overall, the tests check real behavior across create, update, round trip and rejection, and they follow the project's pytest and async conventions.
Full details: Excessive Mock Usage Warning
-
Explanation
The PR adds tests that use few or no mocks, so the excessive-mock condition does not apply. I fetched the PR head branch
review/harness-a02-project-types(b3340e2) and diffed it from merge-base 4176f2f to find the test changes: -src/lfx/tests/unit/projects/test_project_types.py(new, 259 lines): unit tests on realProjectType,ProjectTypeField, registry andStrInputobjects. Nounittest.mock,MagicMockorpatchappears. The only fixtures are plain setup helpers, one of which clears the registry. One test (TestStandaloneImport) temporarily wrapsbuiltins.__import__to confirmlfx.projectsimports without Langflow. This is a single, deliberate import guard that matches the test's purpose, not a mock that hides core logic. -src/backend/tests/unit/api/v1/test_project_types.py(new, 101 lines): uses the realAsyncClientandlogged_in_headersfixtures against the API. No mock objects. -src/backend/tests/unit/api/v1/test_projects.py(+344 lines in four hunks): the new tests call the HTTP API throughclient. Thepatchmatches in the added lines are HTTP PATCH requests, not mocks. TheMagicMock/AsyncMock/patchusage at lines 5 and 51–106 predates this PR and is not in the diff. -test_export_secret_sanitization.pyandtest_migration_pause.pyadd no mock usage. The new tests exercise real objects and real API routes, and they use integration-style checks such as the write-through target validation against real components. No test in the diff hides core logic behind a mock. No recommendation is needed.
Full details: Test File Naming And Structure
-
Explanation
I could not inspect the changed test files for PR
#15273(langflow-ai/langflow, author ogabrielluiz, base review/harness-a01-lfx-projects, head review/harness-a02-project-types). The local checkout is detached at b3340e2 on main, with only two commits. The head branch, base branch, and the commits named in the PR description (b8e1c47d3f56, e4b7c1d9a203, c5d2a8f1e374, 3bc9ffdf2521, f60d176) are all absent. Without the patch, I cannot tell which test files this PR adds or modifies. The PR description says the change touches about 715 test lines. The main tree does contain src/backend/tests/unit/api/v1/test_projects.py and test_project_types.py. I did not treat them as PR evidence, because they may predate this PR and the decision contract bars attributing the whole tree to the PR. The check's criteria (file naming, Jest/Playwright locations, integration markers, descriptive test names, setup/teardown, and positive/negative coverage) cannot be assessed against the PR's actual test changes. Metadata that was verified: the provider-reported primary author is ogabrielluiz (authorStatus: verified). This does not bear on the test-structure criteria.Resolution
Make the PR head and base branches (review/harness-a02-project-types and review/harness-a01-lfx-projects, or commits b8e1c47d3f56 through the merge revisions) available in the checkout. Then re-run this check against the PR's added and modified test files. The check should confirm: backend tests are test_*.py with pytest structure; frontend unit tests are *.test.ts(x) under src/frontend/src; Playwright tests are *.spec.ts under src/frontend/tests; integration tests are marked and placed in the correct directories; test names describe behavior; and edge and error cases are covered.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
|
✅ Migration Validation Passed All migrations follow the Expand-Contract pattern correctly. |
3fbb769 to
eb0f92f
Compare
Projects keep their type and configuration through API operations and ZIP round trips.
b8e1c47d3f56adds the folder columns.Merge revisions
e4b7c1d9a203,c5d2a8f1e374and3bc9ffdf2521join the project-type migration with the release-1.14.0 heads, so there is one Alembic head. No existing migration was re-parented.This is layer 2 of 40 in stack #16628 and builds on #15272. It changes 627 source lines and 715 test lines, plus 4 lines in generated files (component index, starter projects, locales, secrets baseline).
The stack is rebased onto release-1.14.0 at
f60d17696c. Ruff, Biome and the detect-secrets hook pass on every layer. Before the Run Flow refactor, the stack tip passed lfx (12,942 tests), jest (9,788), and the Postgres migration, concurrency and background execution suites, and the backend unit suite failed only on tests that also fail on the base. After the refactor, the lfx suite and the backend api, agentic and base suites ran again at the tip. Three new lfx failures were fixed and rerun. The only other new failures, intest_files.py, also fail on the base.Still a draft. Live provider calls and a deployed topology were not tested.