Skip to content

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
wants to merge 77 commits into
base: dev
Choose a base branch
from

Conversation

davelopez
Copy link
Contributor

@davelopez davelopez commented Aug 1, 2025

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?

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@davelopez davelopez added kind/refactoring cleanup or refactoring of existing code, no functional changes area/backend labels Aug 1, 2025
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
@davelopez davelopez force-pushed the refactor_file_sources_framework_configuration branch from a542443 to ef96a9b Compare August 7, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants