Repository navigation
test(download): cover release URL, status error redaction, private fallthrough - #1694
Conversation
✅ Deploy Preview for devsydev canceled.
|
✅ Deploy Preview for images-devsy-sh canceled.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Release URLs and HTTP errors pkg/download/download_fetch_test.go |
Tests cover latest and tagged release URLs, status error messages with and without response bodies, and credential redaction in errors returned by File. |
Private-release fetch fallthrough pkg/download/download_fetch_test.go |
Tests verify that public assets and non-release paths skip credential resolution, while resolver errors and empty credentials call the resolver once. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Merge Risk: 
Minimal · up to 8dba0
-
No merge-blocking issue is established by this review; the change is ready for normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description clearly explains the test coverage, motivation, known unfixed bug, validation results, and remaining coverage gaps. It does not include the template's explicit type-of-change, AI-assistance, checklist, or issue-reference sections, but the main required change and verification details are present.
-
-
Finishing Touches
-
✨ Simplify code
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
@coderabbitai review |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
Summary
Adds
pkg/download/download_fetch_test.go(183 lines, test-only, 1 file). Table tests for:releaseURL(latest and tagged release).HTTPStatusError.Error(with body, without body, userinfo redacted).Fileerror path against anhttptestserver: 403 response, credentials must not appear in the error.fetchGithubPrivateReleasefall-through: 200 skips the resolver, non-GitHub path skips it, resolver error and empty credential fall through.Why
pkg/downloadwas 15.3% covered. Userinfo in download URLs must not reach error text, since errors are logged. Mutation check: removingsanitizeURLfromHTTPStatusError.Errorturns both redaction tests red; reverted afterwards.Found bug (not fixed here)
releaseURLdouble-escapes tags containing/.release/1.0yields.../releases/tags/release%252F1.0:url.PathEscapeproduces%2F, thenurl.URL.String()escapes the%. The slash case is left out of this PR because it is test-only and would be red. Needs a product fix inpkg/download/download.go.Validation
go test -race -count=3 ./pkg/download/...: ok.mise run cli:format: clean.mise run cli:lint:ci: 0 issues.mise run cli:test(go run ./hack/ci unit): fails inhack/sign_commit(temp repo commit exits 128 under globalcommit.gpgsign=true),pkg/agent/deliveryandpkg/driver/microsandbox(cancellation timing). None importpkg/download. Not re-run on main.CodeRabbit CLI
coderabbit review --agent --fresh --committed: completed, 0 findings, 1 file reviewed.Auto-merge
Not enabled. Draft only; not for merge until reviewed.
Next
Fix
releaseURLtag escaping, then add the slash-tag case. HTTP paths ingithubAPIGetJSON,fetchGithubReleaseAssetID, anddownloadGithubAssetstay untested: they call the shared client and hardcodeapi.github.com, so a seam is needed.Summary by CodeRabbit