Skip to content
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

unify the logic how the provided template data is stored #456

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/foxops/engine/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async def initialize_incarnation(
template_repository=template_repository,
template_repository_version=template_repository_version,
template_repository_version_hash=template_repository_version_hash,
template_data=template_data_model.model_dump(exclude_defaults=True),
template_data=template_data,
template_data_full=full_template_data,
)
incarnation_state.save(incarnation_root_dir / ".fengine.yaml")
Expand Down
2 changes: 1 addition & 1 deletion src/foxops/services/change.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async def create_incarnation(
commit_sha=commit_sha,
requested_version_hash=incarnation_state.template_repository_version_hash,
requested_version=template_repository_version,
requested_data=json.dumps(template_data),
requested_data=json.dumps(incarnation_state.template_data),
template_data_full=json.dumps(incarnation_state.template_data_full),
)

Expand Down
4 changes: 2 additions & 2 deletions tests/engine/test_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,5 @@ async def test_initialize_template_adds_additional_variables_to_state(tmp_path):

# THEN
assert incarnation_state is not None
assert "additional_variable_1" not in incarnation_state.template_data
assert "additional_variable_2" not in incarnation_state.template_data
assert "additional_variable_1" in incarnation_state.template_data
assert "additional_variable_2" in incarnation_state.template_data
Loading