You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[lockfile] add lockfile.Tidy and call from ensurePackagesAreInstalled (#1109)
## Summary
Problem:
if I change devbox.json from [email protected] to [email protected], and do devbox install,
I still see the [email protected] in the devbox.lock (in addition to the new
[email protected])
This PR ensures that when we update installed packages, we also update
the lockfile
to have the set of packages that match those of the devbox.json config.
implementation note: I needed to rename lockfile.Packages to a different
name
since devboxProject is embedded in the lockfile.File struct and we have
a name
conflict.
Fixes#1095
## How was it tested?
- [x] will add a testscript unit test that matches the steps below:
```
# initial devbox.lock file
(devbox) savil@Savil-Srivastavas-MacBook-Pro ~/c/j/devbox (savil/update-lockfile-v2)> cat devbox.lock
{
"lockfile_version": "1",
"packages": {
"[email protected]": {
"last_modified": "2023-03-31T22:52:29Z",
"resolved": "github:NixOS/nixpkgs/242246ee1e58f54d2322227fc5eef53b4a616a31#actionlint",
"version": "1.6.23"
},
"[email protected]": {
"last_modified": "2023-05-01T16:53:22Z",
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#go",
"version": "1.20.3"
},
"[email protected]": {
"last_modified": "2023-05-01T16:53:22Z",
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#golangci-lint",
"version": "1.52.2"
}
}
}
# edit the [email protected] to be [email protected]⏎
(devbox) savil@Savil-Srivastavas-MacBook-Pro ~/c/j/devbox (savil/update-lockfile-v2)> vim devbox.json
(devbox) savil@Savil-Srivastavas-MacBook-Pro ~/c/j/devbox (savil/update-lockfile-v2)> devbox install
Ensuring packages are installed.
Finished installing packages.
(devbox) savil@Savil-Srivastavas-MacBook-Pro ~/c/j/devbox (savil/update-lockfile-v2)> cat devbox.lock
{
"lockfile_version": "1",
"packages": {
"[email protected]": {
"last_modified": "2023-03-31T22:52:29Z",
"resolved": "github:NixOS/nixpkgs/242246ee1e58f54d2322227fc5eef53b4a616a31#actionlint",
"version": "1.6.23"
},
"[email protected]": {
"last_modified": "2023-05-01T16:53:22Z",
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#go_1_19",
"version": "1.19.8"
},
"[email protected]": {
"last_modified": "2023-05-01T16:53:22Z",
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#golangci-lint",
"version": "1.52.2"
}
}
}⏎
# Notice that the older [email protected] is now gone
```
0 commit comments