Add server default result storage config surface#21532
Open
Add server default result storage config surface#21532
Conversation
6c84fc6 to
18d2756
Compare
desertaxle
reviewed
Apr 14, 2026
| class ServerDefaultResultStorage(PrefectBaseModel): | ||
| """Server-side default result storage configuration.""" | ||
|
|
||
| default_result_storage_block_id: Optional[UUID] = Field( |
Member
There was a problem hiding this comment.
Why is this optional? Should it be required since you're also including an endpoint for deletion?
| ) -> bool: | ||
| query = sa.delete(db.Configuration).where(db.Configuration.key == key) | ||
| result = await session.execute(query) | ||
| db.queries.clear_configuration_value_cache_for_key(key=key) |
Member
There was a problem hiding this comment.
I was looking into this configuration cache, and it looks like it's in memory. We might want to make that configurable because changes to the default storage might not propagate in multi-server environments. That feels like a follow-up PR, though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR adds the OSS config surface for a server-level default result storage setting.
What changed
ServerDefaultResultStorageschema for representing the configured block document id/admin/storageread, update, and clear endpointswrite-pathserver.models.storage_defaultsmodule instead of leaving that logic inline in the routeui-v2OpenAPI client for the new admin surfaceWhy this is a separate slice
This PR only adds the configuration surface for storing a server default result storage block. It does not change runtime result-storage resolution yet.
That separation keeps the persisted setting and API contract reviewable on their own before the follow-up runtime behavior work lands.
This still matches the Cloud backend split: Cloud has a separate
storage_defaultsmodel module too, but its propagation and materialization logic lives in later slices. OSS is intentionally stopping at the persisted setting and API contract in this first PR.Generated client note
ui-v2/src/api/prefect.tsincludes the expected/admin/storageadditions for this feature.It also still includes the unrelated
IntervalSchedule.intervalchange fromnumbertonumber | string. I reproduced that by runningnpm run service-syncon a cleanorigin/mainworktree, so it appears to be existing generator drift rather than a storage-defaults-specific change.Verification
uv run pyright --ignoreexternal --verifytypes prefectuv run pytest tests/server/api/test_admin.py tests/server/models/test_storage_defaults.py tests/client/test_prefect_client.py -k 'server_default_result_storage'uv run pytest tests/server/models/test_configuration.py tests/server/models/test_storage_defaults.pyuv run ruff check src/prefect/server/api/admin.py src/prefect/server/models/__init__.py src/prefect/server/models/configuration.py src/prefect/server/models/storage_defaults.py tests/server/api/test_admin.py tests/server/models/test_configuration.py tests/server/models/test_storage_defaults.py tests/client/test_prefect_client.pymypyandSync UI v2 OpenAPI