fix(scoop-download): Fix incorrect download success state#6473
fix(scoop-download): Fix incorrect download success state#6473niheaven merged 1 commit intoScoopInstaller:developfrom
Conversation
WalkthroughDeduplicates input apps, adds a per-app failure flag ($dl_failure) and labeled outer loop, sets the flag on hash-check failure, and gates per-app success messages so success prints only when no per-app download/hash failure occurred. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant Script as scoop-download.ps1
participant Remote as Remote URL(s)
participant Cache as Local cache / Hasher
User->>Script: run "scoop download <apps>"
Script->>Script: dedupe apps
loop per app (app_loop)
Script->>Remote: attempt download from URL 1..N
alt download fails
Script->>Script: log error, set dl_failure = true
Script-->>Script: continue app_loop
else download succeeds
Script->>Cache: verify hash
alt hash mismatch or verify error
Script->>Cache: purge invalid cache
Script->>Script: log error/warning, set dl_failure = true
Script-->>Script: continue app_loop
else hash OK
Script->>Script: mark app as successful
end
end
Script->>User: if not dl_failure, print per-app success
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
libexec/scoop-download.ps1 (1)
60-60: Loop label is unnecessary with the proposed inner-loop control.If you stop using continue app_loop (see suggestions below), drop the label for clarity.
-:app_loop foreach ($curr_app in $apps) { +foreach ($curr_app in $apps) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
libexec/scoop-download.ps1(4 hunks)
6b950be to
070699e
Compare
070699e to
a1c6c4b
Compare
Description
Motivation and Context
scoop download: Incorrect Success Prompt Logic #6413.The
scoop downloadcommand has the following problems:changes
This PR makes the following changes:
Checklist:
developbranch.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.