Skip to content

Centralize work-pool result storage eligibility#21044

Draft
zzstoatzz wants to merge 4 commits intomainfrom
codex/oss-7740-unified-result-storage-resolution
Draft

Centralize work-pool result storage eligibility#21044
zzstoatzz wants to merge 4 commits intomainfrom
codex/oss-7740-unified-result-storage-resolution

Conversation

@zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Mar 9, 2026

this PR centralizes the rule that decides when a work-pool result storage default is allowed to apply for ad-hoc submission.

This is a small phase-1 Storage Defaults cleanup. Work-pool result storage is the only partial default layer we have today, and the project needs its precedence rule to be predictable before we add workspace or server defaults.

details
  • adds a private helper in prefect.results for one shared question: does this flow already have result storage configured in a way that works for remote result retrieval?
  • uses that helper from both ad-hoc submission paths: InfrastructureBoundFlow.submit_to_work_pool() and BaseWorker._submit_adhoc_run()
  • keeps the actual work-pool override behavior explicit in those callsites instead of introducing a generic source-selection abstraction
  • adds focused tests for the helper and preserves the existing behavior tests for both submission entrypoints

Why this matters for the project:

  • explicit flow-level storage still wins
  • the work-pool default remains the next lower-precedence option in these ad-hoc submission paths
  • the rule for when work-pool storage is allowed to step in now lives in one place instead of two copies

Tests:

  • uv run pytest tests/results/test_result_store.py -k "RemoteResultStorageConfiguration or update_for_flow"
  • uv run pytest tests/test_infrastructure_bound_flow.py -k "test_submit_uses_work_pool_result_storage_block or test_submit_to_work_pool_does_not_override_explicit_flow_result_storage"
  • uv run pytest tests/workers/test_base_worker.py -k "test_submit_uses_work_pool_result_storage_block or test_submit_does_not_override_explicit_flow_result_storage"
  • uv run ruff check src/prefect/results.py src/prefect/flows.py src/prefect/workers/base.py tests/results/test_result_store.py

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 9, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing codex/oss-7740-unified-result-storage-resolution (c98f8fe) with main (d1d0f4d)

Open in CodSpeed

@zzstoatzz zzstoatzz changed the title Unify flow result storage precedence selection Centralize work-pool result storage eligibility Mar 9, 2026
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.

1 participant