Skip to content

feat(install): Add support for historical manifests by git history#87

Open
yashwant86 wants to merge 48 commits intomasterfrom
pr-6370
Open

feat(install): Add support for historical manifests by git history#87
yashwant86 wants to merge 48 commits intomasterfrom
pr-6370

Conversation

@yashwant86
Copy link
Copy Markdown

Lutra-Fs and others added 30 commits May 26, 2025 20:48
- Implemented try-catch block in `install_app` function to handle installation failures and provide informative error messages.
- Added `Get-HistoricalManifest` function to search for specific app versions in git history, enhancing version management during installation.
- Updated `generate_user_manifest` to utilize historical manifests as a fallback when autoupdate fails.
- Enhanced documentation in `scoop-config.ps1` to clarify the use of git history for version installation.
- Add Get-RelativePathCompat function that falls back to Uri-based implementation for PowerShell 5.x
- Replace direct GetRelativePath call with compatible wrapper
- Ensures historical manifest feature works across all PowerShell versions
- Add Get-HistoricalManifestFromDB function to search SQLite cache first
- Modify Get-HistoricalManifest to use SQLite before falling back to git history
- Implement best version matching for SQLite database results
- Add conditional database import to ensure functions are available
- Improve user messages to indicate whether cache or git history is used

This addresses @niheaven's suggestion to use SQLite for faster historical version searches, significantly reducing performance bottlenecks when searching for approximate versions.
- Fix code style issues to pass tests
- Maintain existing functionality without changes
- Change '3.7.x' to '3.12.x' to match the command 'python@3.12'
- Addresses GitHub Copilot's documentation consistency feedback
- Use Out-UTF8File instead of Set-Content with UTF8Encoding for PowerShell 5
- Add version checks to use appropriate encoding methods
- Fixes 'Cannot bind parameter Encoding' error in Windows PowerShell 5
- Ensures historical manifest search works on all PowerShell versions
- Fix git show command returning arrays instead of strings
- Join array elements with newlines to create proper JSON content
- Remove misleading PowerShell 5 specific comments
- Fixes historical manifest search in both PowerShell 5 and 7
- Remove git history fallback logic from install_app function
- Move git history concerns to manifest layer where they belong
- Improve separation of concerns and reduce coupling
- Update tests to reflect the cleaner design
- Merge git history tests into Scoop-Install.Tests.ps1 for consistency

This follows the 'Pull complexity downward' principle by keeping
installation logic focused on installation, while manifest resolution
handles all version fallback strategies internally.
The try-catch block addition was a general error handling improvement
that belongs in a separate PR, not in this git history feature PR.
… test expectations

- Add missing psmodules.ps1 import to Install tests
- Fix architecture parameter validation (x64 -> 64bit)
- Add null/empty bucket parameter handling in Get-HistoricalManifestFromDB
- Fix file format issues (add missing newlines, remove trailing whitespace)
- Update JSON parsing tests to match actual implementation behavior
- Fix path separator normalization in Get-RelativePathCompat test
- Remove invalid error handling tests for non-existent try-catch blocks
- Reduce test failures from 11 to 4, with remaining issues being mock-related

All fixes respect existing codebase behavior and design decisions.
- Keep only exact match logic (lines 177-189)
- Return null immediately when no exact match found (line 193)
- Remove trailing whitespace from manifest.ps1
- Function now only supports exact version matches, no compatibility matching
…calManifestFromDB for exact version matching
…tching version via h'^/h with validated fallback
z-Fng and others added 18 commits September 24, 2025 14:45
…dating (ScoopInstaller#6454)

Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
…output (ScoopInstaller#6449)

Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
Co-authored-by: z-Fng <54583083+z-Fng@users.noreply.github.com>
…variables (ScoopInstaller#6460)

Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
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.

7 participants