-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/mod/modregistry: avoid round trip
There's no need to resolve the name just to fetch the manifest in another round trip when we can fetch the manifest in one request. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I59d07b537d2b969759c919d9c8d11c7bc93a1554 Reviewed-on: https://review-eu.gerrithub.io/c/cue-lang/cue/+/1173533 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
- Loading branch information
Showing
6 changed files
with
17 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ cmp stdout expect-stdout | |
env-fill dockerconfig/badpassword.json | ||
cp dockerconfig/badpassword.json dockerconfig/config.json | ||
! exec cue export . | ||
stderr 'instance: cannot resolve dependencies: example.com/[email protected]: module example.com/[email protected]: error response: 401 Unauthorized: authentication required' | ||
stderr 'instance: cannot resolve dependencies: example.com/[email protected]: module example.com/[email protected]: error response: 401 Unauthorized; body: "invalid credentials' | ||
|
||
-- dockerconfig/config.json -- | ||
{ | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
cmp stderr expect-stderr | ||
|
||
-- expect-stderr -- | ||
instance: cannot resolve dependencies: example.com/[email protected]: module example.com/[email protected]: error response: 404 Not Found: repository name not known to registry | ||
instance: cannot resolve dependencies: example.com/[email protected]: module example.com/[email protected]: module not found | ||
-- main.cue -- | ||
package main | ||
import "example.com/e" | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ env CUE_REGISTRY=$DEBUG_REGISTRY_HOST/something+insecure | |
cmp stderr expect-stderr | ||
|
||
-- expect-stderr -- | ||
instance: cannot resolve dependencies: example.com/[email protected]: module example.com/[email protected]: error response: 404 Not Found: repository name not known to registry | ||
instance: cannot resolve dependencies: example.com/[email protected]: module example.com/[email protected]: 404 Not Found: name unknown: repository name not known to registry | ||
-- main.cue -- | ||
package main | ||
import "example.com/e" | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
-- out/modfetch/error -- | ||
instance: cannot resolve dependencies: [email protected]: module [email protected]: error response: 404 Not Found: repository name not known to registry | ||
instance: cannot resolve dependencies: [email protected]: module [email protected]: 404 Not Found: name unknown: repository name not known to registry | ||
-- cue.mod/module.cue -- | ||
module: "main.org@v0" | ||
|
||
|
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 |
---|---|---|
|
@@ -113,7 +113,7 @@ deps: "bar.com@v0": v: "v0.0.2" // doesn't exist | |
"foo.com/bar/[email protected]", | ||
), nil) | ||
_, err := rs.Graph(ctx) | ||
qt.Assert(t, qt.ErrorMatches(err, `[email protected]: module [email protected]: error response: 404 Not Found: repository name not known to registry`)) | ||
qt.Assert(t, qt.ErrorMatches(err, `[email protected]: module [email protected]: 404 Not Found: name unknown: repository name not known to registry`)) | ||
qt.Assert(t, qt.ErrorAs(err, new(*mvs.BuildListError[module.Version]))) | ||
} | ||
|
||
|