-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
lake update
from unsupported manifest versions (#3149)
If the current manifest is from unsupported (or has errors), a bare `lake update` will now discard it and create a new one from scratch rather than erroring and requiring you to manually delete the manifest. Lake will produce warnings noting it is ignoring such invalid manifests.
- Loading branch information
Showing
4 changed files
with
72 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{"version": 4, | ||
"packagesDir": "lake-packages", | ||
"packages": | ||
[{"git": | ||
{"url": "bar", | ||
"subDir?": null, | ||
"rev": "253735aaee71d8bb0f29ae5cfc3ce086a4b9e64f", | ||
"name": "bar", | ||
"inputRev?": null}}, | ||
{"path": {"opts": {}, "name": "foo", "inherited": false, "dir": "./foo"}}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,29 +21,48 @@ git config user.name test | |
git config user.email [email protected] | ||
git add --all | ||
git commit -m "initial commit" | ||
REV=`git rev-parse HEAD` | ||
GIT_REV=`git rev-parse HEAD` | ||
popd | ||
|
||
LOCKED_REV='0538596b94a0510f55dc820cabd3bde41ad93c3e' | ||
|
||
# --- | ||
# Test manifest manually upgrades from unsupported versions | ||
# --- | ||
|
||
# Test loading of a V4 manifest fails | ||
cp lake-manifest-v4.json lake-manifest.json | ||
($LAKE resolve-deps 2>&1 && exit 1 || true) | grep "incompatible manifest version '4'" | ||
|
||
# Test package update fails as well | ||
($LAKE update bar 2>&1 && exit 1 || true) | grep "incompatible manifest version '4'" | ||
|
||
# Test bare update produces the expected V7 manifest | ||
$LAKE update | ||
sed_i "s/$GIT_REV/$LOCKED_REV/g" lake-manifest.json | ||
diff --strip-trailing-cr lake-manifest-v7.json lake-manifest.json | ||
rm -rf .lake | ||
|
||
# --- | ||
# Test manifest properly upgrades from supported versions | ||
# Test manifest automatically upgrades from supported versions | ||
# --- | ||
|
||
# Test successful loading of a V5 manifest | ||
cp lake-manifest-v5.json lake-manifest.json | ||
sed_i "s/253735aaee71d8bb0f29ae5cfc3ce086a4b9e64f/$REV/g" lake-manifest.json | ||
sed_i "s/253735aaee71d8bb0f29ae5cfc3ce086a4b9e64f/$GIT_REV/g" lake-manifest.json | ||
$LAKE resolve-deps | ||
|
||
# Test update produces the expected V7 manifest | ||
$LAKE update | ||
sed_i "s/$REV/0538596b94a0510f55dc820cabd3bde41ad93c3e/g" lake-manifest.json | ||
sed_i "s/$GIT_REV/$LOCKED_REV/g" lake-manifest.json | ||
diff --strip-trailing-cr lake-manifest-v7.json lake-manifest.json | ||
|
||
# Test successful loading of a V6 manifest | ||
cp lake-manifest-v6.json lake-manifest.json | ||
sed_i "s/dab525a78710d185f3d23622b143bdd837e44ab0/$REV/g" lake-manifest.json | ||
sed_i "s/dab525a78710d185f3d23622b143bdd837e44ab0/$GIT_REV/g" lake-manifest.json | ||
$LAKE resolve-deps | ||
|
||
# Test update produces the expected V7 manifest | ||
$LAKE update | ||
sed_i "s/$REV/0538596b94a0510f55dc820cabd3bde41ad93c3e/g" lake-manifest.json | ||
sed_i "s/$GIT_REV/$LOCKED_REV/g" lake-manifest.json | ||
diff --strip-trailing-cr lake-manifest-v7.json lake-manifest.json |