Skip to content

feat(seeder): Add configurable variables for data seed#383

Merged
MarekSuchanek merged 1 commit into
developfrom
feature/seed-vars
Apr 24, 2026
Merged

feat(seeder): Add configurable variables for data seed#383
MarekSuchanek merged 1 commit into
developfrom
feature/seed-vars

Conversation

@MarekSuchanek
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support in dsw-data-seeder for configurable placeholder variables (and named UUID placeholders) that can be substituted into seed SQL scripts, with configuration exposed via recipe JSON and app config.

Changes:

  • Extend seed recipe format to support uuids.names and variables (placeholder + values).
  • Add variable/UUID placeholder replacement logic to SeedRecipe and wire recipe loading to merge configured variables.
  • Introduce seed configuration section (job timeout + variables) and add cast_dict helper in dsw-config.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/dsw-data-seeder/example/example.seed.json Updates example recipe with named UUIDs and variable placeholders/values.
packages/dsw-data-seeder/dsw/data_seeder/seeder.py Implements variable replacement + named UUIDs; updates recipe loading and queue timeout config lookup.
packages/dsw-data-seeder/dsw/data_seeder/config.py Renames/introduces seed config keys/model and adds variables config key.
packages/dsw-data-seeder/config.example.yml Documents new seed config section (jobTimeout + variables).
packages/dsw-config/dsw/config/keys.py Adds cast_dict convenience caster.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/dsw-data-seeder/dsw/data_seeder/config.py Outdated
Comment thread packages/dsw-data-seeder/dsw/data_seeder/config.py Outdated
Comment thread packages/dsw-data-seeder/dsw/data_seeder/seeder.py
Comment thread packages/dsw-data-seeder/dsw/data_seeder/seeder.py Outdated
Comment thread packages/dsw-data-seeder/config.example.yml
Comment thread packages/dsw-data-seeder/dsw/data_seeder/seeder.py Outdated
@MarekSuchanek
Copy link
Copy Markdown
Member Author

@copilot can you review again?

Copy link
Copy Markdown

Copilot AI commented Apr 24, 2026

@copilot can you review again?

Reviewed and addressed the remaining unresolved issue: seed.variables could be None when the config key used cast_optional_dict, causing AttributeError on .copy() in seeder.py even with the contextlib.suppress(ContextNotInitializedError) guard in place. Fixed in fe996ef by changing the config key to use cast_dict instead of cast_optional_dict, ensuring variables is always a dict (empty {} when not configured) — consistent with the SeedConfig.variables: dict type annotation.

@MarekSuchanek MarekSuchanek merged commit 592076f into develop Apr 24, 2026
27 checks passed
@MarekSuchanek MarekSuchanek deleted the feature/seed-vars branch April 24, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants