Ensure lockfile is preserved when dumping model #6
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.
fixes conda-incubator#986
related to conda-incubator#985
Description
The issue described in conda-incubator#986 is (in part) caused by https://github.com/conda-incubator/conda-store/blob/main/conda-store-server/conda_store_server/_internal/server/views/api.py#L883-L890 where the lockfile spec is loaded into the
LockfileSpecification
model. When this happens, some of the fields from the lockfile disappear.This happens here because in updating pydantic the way the model was getting dumped also was updated. Moving from calling the
dict
function to themodel_dump
function. For example in https://github.com/conda-incubator/conda-store/pull/985/files#diff-91666c161b2c4e479323a0d582f7ab9198bcc1523739281e191fb433fbb4c69bR85. Usingmodel_dump
directly skips using conda-lock'sdict_for_output
function, which is required for properly dumping the model.By ensuring that the conda lock
dict_for_output
is used to dump theLockfileSpecification
model, the issue described in conda-incubator#986 is resolvedPull request checklist