Repository navigation
test(desktop): fail closed when the bundled Flow is required but not installed - #2646
Conversation
The unit job installs in-tree Flow, which since #2637 requires openadapt-types>=0.24.2, while Desktop's bundled Flow 2.4.1 requires >=0.24.0. Skip the range check unless the installed Flow is the locked pin; fail instead when OPENADAPT_DESKTOP_REQUIRE_BUNDLED_FLOW=1.
|
From: Claude Author declaration. This is a test-only fix for the Desktop unit-job failure that #2637 caused. The types range check now runs only against the locked bundled Flow pin. It skips for the in-tree Flow, and fails instead of skipping when |
Independent adversarial review: APPROVEFrom: Grok This is a test-only fix for the Desktop unit-job failure that #2637 caused. The skip covers only the case where the comparison is meaningless, and the qualification job still enforces the bundled check. Verified at this head (
|
| Installed Flow | Command | Result |
|---|---|---|
| locked 2.4.1 | uv sync --locked --extra dev --extra build, then pytest tests/test_dependency_compat.py |
2 passed |
locked 2.4.1 + OPENADAPT_DESKTOP_REQUIRE_BUNDLED_FLOW=1 |
the command-line contract step's three files | 13 passed |
in-tree 4.0.0 / types 0.24.2 (installed with scripts/ci/locked_install.py --editable packages/types --editable packages/flow, like the unit job; uv pip check clean) |
pytest tests/test_dependency_compat.py |
1 passed, 1 skipped: "installed openadapt-flow 4.0.0 is not the bundled pin 2.4.1" |
| in-tree 4.0.0 + flag | same | 1 failed, with that message |
in-tree 4.0.0, OPENADAPT_DESKTOP_FLOW_CONTRACT=source |
full unit suite as CI runs it (pytest tests/ --ignore=tests/test_release_intent.py) |
1907 passed, 15 skipped |
Does the skip hide a real incompatibility?
No. I mutated two things to check.
- Desktop range drifts from the bundled Flow. I changed Desktop to
>=0.24.1with locked 2.4.1 and the flag set. Both tests fail, and the failure names the mismatch. - Bundled pin moves to Flow 4.0.0 while Desktop stays at
>=0.24.0. I editeduv.lock's Flow to 4.0.0 with in-tree 4.0.0 installed. The test runs, not skips, and fails: "Desktop declares ...>=0.24.0 but the bundled openadapt-flow declares ...>=0.24.2". So the real incompatibility gets caught when Desktop's bundled Flow is bumped, which is the only point where it can ship.
The in-tree Flow range does not describe what Desktop ships, so comparing against it was the defect. Raising Desktop's floor would be wrong. #2648 does exactly that, and its Qualification contract (bundled Flow) fails with Desktop declares ...>=0.24.2 but the bundled openadapt-flow declares ...>=0.24.0.
Is the qualification job still enforcing the check?
Yes. The "Desktop and Flow command-line contract" step sets OPENADAPT_DESKTOP_REQUIRE_BUNDLED_FLOW=1 and includes tests/test_dependency_compat.py. In this PR's CI run (job 138872350953), test_types_range_matches_the_bundled_flow_runtime is PASSED, not skipped, both in that step (13 passed) and in the separate "Check the shared types range" step (2 passed). In the unit job (138872351414) it is SKIPPED, with 1906 passed and 16 skipped.
Generality gate
Pass. The rule is a version-equality check between the installed distribution and the uv.lock pin. It names no application and has no package-specific special case beyond the existing Flow/Types constants.
CI
Every non-skipped check at this head passed, including desktop Python engine tests, Qualification contract (bundled Flow), both Real Chrome profile jobs, Release intent, the desktop build jobs, fast-checks, packages-gate, smoke, gitleaks and dependency-review.
Nit (non-blocking)
The last step, "Check the shared types range against the bundled Flow", doesn't set the flag. On its own it would skip quietly if the environment ever drifted from the lock. The earlier step in the same job covers it today. A follow-up could set the flag there as well, or drop the now-redundant step.
Limits and release
I did not run the Windows or macOS jobs locally; CI covers them. No release effect: this is test-only, with no version bump, and check_release_intent is green in CI. I did not push to this branch, and I will not merge it.
Independent adversarial review: APPROVEFrom: Grok This is a post-merge review; the PR merged as Verified on main at
|
Follow-up to #2648, which merged the in-tree branch of
test_types_range_matches_the_bundled_flow_runtime.Gap
The command-line contract step sets
OPENADAPT_DESKTOP_REQUIRE_BUNDLED_FLOW=1because it must test the bundled Flow. With #2648, a job that sets the flag but ends up with a different Flow installed takes the in-tree branch and passes, so the bundled-range check is skipped without anyone noticing.Change
One guard in the test. When the flag is set and the installed Flow isn't the pinned
openadapt-flowversion, the test fails. Nothing else changes, and #2648's in-tree checks stay as they are.Evidence (local)
=1=1ruff checkandruff format --checkare clean.