Permit multiple urls to fetchurl. - #230
Open
Abdiramen wants to merge 8 commits into
Open
Conversation
Abdiramen
force-pushed
the
oz/fetch_urls
branch
2 times, most recently
from
July 3, 2026 14:02
f364872 to
e536cb4
Compare
zombiezen
reviewed
Jul 4, 2026
zombiezen
reviewed
Jul 8, 2026
| return fmt.Errorf("missing url environment variable") | ||
| } | ||
|
|
||
| var err error |
Member
There was a problem hiding this comment.
You can use the new internal/multierror package to collect all the errors to report.
| expectBuildFail bool | ||
| }{ | ||
| { | ||
| name: "FetchSingularUrl", |
Member
There was a problem hiding this comment.
nit: (here and elsewhere) https://go.dev/wiki/CodeReviewComments#initialisms
Comment on lines
+1275
to
+1281
| if err != nil && test.expectBuildFail { | ||
| return | ||
| } | ||
| if err != nil { | ||
| gotLog, _ := backendtest.ReadLog(ctx, client, realizeResponse.BuildID, drvPath) | ||
| t.Fatalf("build drv: %v\nlog:\n%s", err, gotLog) | ||
| } |
Member
There was a problem hiding this comment.
It would still be good to show the log anyway.
Suggested change
| if err != nil && test.expectBuildFail { | |
| return | |
| } | |
| if err != nil { | |
| gotLog, _ := backendtest.ReadLog(ctx, client, realizeResponse.BuildID, drvPath) | |
| t.Fatalf("build drv: %v\nlog:\n%s", err, gotLog) | |
| } | |
| if err != nil { | |
| gotLog, _ := backendtest.ReadLog(ctx, client, realizeResponse.BuildID, drvPath) | |
| t.Logf("build drv: %v\nlog:\n%s", err, gotLog) | |
| if !test.expectBuildFail { | |
| t.Fail() | |
| } | |
| return | |
| } |
| error("Either url or urls must be set") | ||
| end | ||
|
|
||
| local name |
Member
There was a problem hiding this comment.
For clarity, let's grab args.name first and then check the fallback. It was a little hard to see that behavior on first read.
Suggested change
| local name | |
| local name = args.name | |
| if not name then |
Comment on lines
+26
to
+30
| if args.url == nil then | ||
| name = args.name or baseNameOf(args.urls[1]) | ||
| else | ||
| name = args.name or baseNameOf(args.url) | ||
| end |
Member
There was a problem hiding this comment.
Similarly, for clarity, let's flip this condition.
Suggested change
| if args.url == nil then | |
| name = args.name or baseNameOf(args.urls[1]) | |
| else | |
| name = args.name or baseNameOf(args.url) | |
| end | |
| if args.url then | |
| name = baseNameOf(args.url) | |
| else | |
| name = baseNameOf(args.urls[1]) | |
| end |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #68