-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Refactor Files Sources Framework for stronger typing using pydantic models #20728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
davelopez
wants to merge
77
commits into
galaxyproject:dev
Choose a base branch
from
davelopez:refactor_file_sources_framework_configuration
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Refactor Files Sources Framework for stronger typing using pydantic models #20728
davelopez
wants to merge
77
commits into
galaxyproject:dev
from
davelopez:refactor_file_sources_framework_configuration
Conversation
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
For configuration management and validation
To improve initialization and typing
To avoid conflict with User templated file sources configurations for now
Create and validate their configuration before instantiating the plugin.
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt them to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt them to the new framework updates and reduce significantly the passing of user_context to methods.
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
To adapt it to the new framework updates
There is no point in using the resolved config util we have RuntimeContext information to be able to properly evaluate the templates. In these cases, the previous implementation was directly using the templated value anyway because of the same reason.
And fix user_data context handling in file sources
As the TestPosixConfiguredFileSources expects a string as root argument as well as the pydantic model for PosixFilesSource
a542443
to
ef96a9b
Compare
Experimenting with Copilot
Some functions get called before we pass any user context so we cannot access the resolved config values in those cases.
This is to avoid unnecessary confusion with the "writable" status of a file source. The `write_intent` query parameter just signals to the framework that the user is accessing the file source with the intent of writing to it, independently of the "writable" status of the file source.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Followup to #20698 (review)
The idea was to use pydantic models for the configuration properties of the file sources, but I went knee deep into trying to simplify the downstream implementations and reduce the parameter juggling, also making everything as explicit as possible.
I likely went too far, and I expect heavy test fallout until I can get the code to a more stable state 😅
@jmchilton, I would appreciate your input on how to best handle package dependencies and if you like the direction this is going or not. Also, to make the configurations more inline with the templated ones, I was thinking of creating small models with only the minimal settings and then reusing them in both templates and general sources. But I'm not sure where the best place to put them is. Any suggestions?
How to test the changes?
License