Skip to content

fix(scoop-info): Don't treat a folder with the app's name as its source - #6774

Open
candygoogy wants to merge 4 commits into
ScoopInstaller:developfrom
candygoogy:fix/info-source-folder
Open

candygoogy wants to merge 4 commits into
ScoopInstaller:developfrom
candygoogy:fix/info-source-folder

Conversation

@candygoogy

@candygoogy candygoogy commented Oct 6, 2026 •

Copy link
Copy Markdown

Description

scoop info now only treats its argument as a local manifest (standalone source) when it is a file, by using Test-Path -PathType Leaf for the standalone check. URLs and paths to manifest files work as before.

Motivation and Context

scoop info <app> uses Test-Path $original_app to detect a local manifest. Test-Path is also true for a folder, so a folder with the app's name in the current directory made the app "standalone" and its path was shown as the source, even though the manifest came from a bucket.

Closes #6764

How Has This Been Tested?

On Windows 11 with SCOOP and XDG_CONFIG_HOME pointing to a test folder, a local bucket main with demo.json, in Windows PowerShell 5.1 and PowerShell 7:

Command Before After
scoop info demo Source: main Source: main
scoop info demo, with an empty demo folder in the current directory Source: ...\demo (the folder) Source: main
scoop info <path>\standalone-demo.json Source: the manifest file Source: the manifest file

Added test/Scoop-Info.Tests.ps1 with tests for the source of a bucket app, the same app with a same-named folder in the current directory, and a local manifest file. The folder test fails without the fix.

./test/bin/test.ps1 gives the same results as on develop in both shells apart from the new tests: 164 passed, and the 19 failures are the Decompression tests, which need 7-Zip, lessmsi and innounp locally. The linter passes.

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no blocking issues were found.

Summary

scoop info now requires a local file before treating an argument as a standalone source.

  • scoop info shows the bucket when a same-named folder exists.

Reviews (5) · Last reviewed commit: "test(scoop-info): Tag the Source tests a..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5dd03a61-8612-4f14-a0a6-4a5853a08b63
📥 Commits

Reviewing files that changed from the base of the PR and between 30fffd0 and 8675fcf.

📒 Files selected for processing (1)
  • test/Scoop-Info.Tests.ps1

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


Summary by CodeRabbit

  • Bug Fixes
    • Folders named after an app are no longer mistakenly treated as the app’s source.

Walkthrough

scoop-info now treats a local path as a standalone source only if it is a file. URL and UNC-path detection remains unchanged. Tests cover bucket app source reporting, including when a matching local folder exists, and local manifest source reporting. The changelog documents the fix.

Changes

Source detection

Layer / File(s) Summary
Local file check
libexec/scoop-info.ps1, test/Scoop-Info.Tests.ps1, CHANGELOG.md
Standalone detection now requires a local leaf file. Tests verify the reported source for bucket apps and local manifests. The changelog records the fix.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 8675f

The change stops a same-named folder from overriding the source shown by scoop info, while URLs and manifest file paths behave as before. No merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning For #6764, libexec/scoop-info.ps1 now treats only leaf paths as standalone. The new tests cover the bucket source, a same-named folder, and a local manifest file. The check does not validate that a … Validate the local file extension and manifest schema before treating it as a standalone source. Add tests for invalid local files as well as the same-named folder case.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The code change, regression tests, and changelog entry all address #6764. The PR introduces no demonstrated unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Title check ✅ Passed The title clearly summarizes the main change: folders named after an app are no longer treated as its source by scoop info.
Description check ✅ Passed The description explains the folder-versus-manifest behavior, the motivation, and the reported tests. It is directly related to the changeset.
Full details: Linked Issues check

Explanation

For #6764, libexec/scoop-info.ps1 now treats only leaf paths as standalone. The new tests cover the bucket source, a same-named folder, and a local manifest file. The check does not validate that a local file has a .json extension or a valid manifest schema, which the issue requires before treating a local path as an app source.

  • Fix all pre-merge checks with AI
  • Autopilot · 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread libexec/scoop-info.ps1 Resolved
@candygoogy

Copy link
Copy Markdown
Author

Added test/Scoop-Info.Tests.ps1: a bucket app shows its bucket, the same app with a same-named folder in the current directory still shows the bucket (this one fails without the fix), and a local manifest file still shows the file.

@candygoogy
candygoogy force-pushed the fix/info-source-folder branch from 8675fcf to 4b44d4a Compare October 18, 2026 07:17
Comment thread test/Scoop-Info.Tests.ps1 Resolved
`scoop info <app>` treated the argument as a local manifest whenever
`Test-Path` found it, which is also true for a folder. Running it in a
directory that contains a folder with the app's name showed that folder
as the source. A local manifest is always a file, so check for a file.
@candygoogy
candygoogy force-pushed the fix/info-source-folder branch from 0149774 to d93ebd1 Compare November 8, 2026 08:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant