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

Create a preliminary internal v2 lockfile schema but enforce v1 #412

Merged
merged 9 commits into from
May 24, 2023

Conversation

maresb
Copy link
Contributor

@maresb maresb commented May 21, 2023

As described in #411, the merge of #389 broke parsing of lockfiles for the conda-lock install command due to a schema change.

In this PR I create explicit v1 and v2 schema, the v2 being preliminary. The only difference between the two is that v2 omits the optional from packages. There is no loss of information thanks to the invariant optional = category != "main". Thus it's easy to convert between v1 and v2, and the corresponding functions are added here.

The combination of #389 and this PR should be a pure refactor, as input and output are done exclusively with the v1 schema.

This sets us up to make the schema modifiable, as there are some changes I'd like to make. (RFC coming soon...)

Before I consider this to be closing for #411, I want to add tests for conda-lock install. I merged #411 because the tests were green, despite the breakage, so I'd like to avoid this happening in the future.

@maresb maresb requested a review from a team as a code owner May 21, 2023 19:12
@netlify
Copy link

netlify bot commented May 21, 2023

Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit 7a9a707
🔍 Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/646a6d13b63c6d000839efd4
😎 Deploy Preview https://deploy-preview-412--conda-lock.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@maresb
Copy link
Contributor Author

maresb commented May 21, 2023

@srilman, I'd appreciate a review on this if you get the chance. Also, I'm going to try to rebase #390 on this soon.

@maresb
Copy link
Contributor Author

maresb commented May 21, 2023

I'm trying to update my #410 which rebases #390 so that the previous logic is reproduced. It it much trickier than I hoped. It's more of a logic puzzle than I can solve for tonight.

My goal would be to adjust #390 so that categories is not a set but a list. And that list should have the property that its first (or last) element should be the category selected previously.

This way, lockfile conversion would work as follows:

  • v1 → v2, categories = [category]
  • v2 → v1, category = categories[0]

@maresb
Copy link
Contributor Author

maresb commented May 24, 2023

I don't like having a broken main, so I'm going to merge this. We can revert as needed.

@maresb maresb merged commit 1b5e0ab into conda:main May 24, 2023
11 checks passed
@maresb maresb deleted the fix-411 branch May 24, 2023 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant