Skip to content

[versioned] If user adds new version, remove previous versions of canonical #1105

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

Merged
merged 5 commits into from
Jun 6, 2023

Conversation

mikeland73
Copy link
Contributor

Summary

If there's an existing package with same canonical, remove it. If there's more than one do nothing.

How was it tested?

Need to test this a bit more to ensure no weird side-effects of doing a remove inside an add

On this repo did:

cat devbox.json
devbox add [email protected]
cat devbox.json
devbox add [email protected]
cat devbox.json

@mikeland73 mikeland73 requested review from loreto and savil June 6, 2023 19:22
Copy link
Contributor

@loreto loreto left a comment

Choose a reason for hiding this comment

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

LGTM

@savil
Copy link
Collaborator

savil commented Jun 6, 2023

You could add a testscript unit-test similar to the test plan.

May need to add a custom function (https://github.com/jetpack-io/devbox/blob/8b4a1050ef730cedc400c62a6bf3f71adac9bbb6/testscripts/testrunner/testrunner.go#L70) called json.list.contains and use it as json.list.contains devbox.json packages [email protected] and json.list.contains.not devbox.json packages [email protected]

@mikeland73 mikeland73 merged commit 0e0dae3 into main Jun 6, 2023
@mikeland73 mikeland73 deleted the landau/update-on-conflict branch June 6, 2023 23:20
@savil
Copy link
Collaborator

savil commented Jun 7, 2023

thanks for adding the testscript!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants