feat(install): Add support for historical manifests by git history#87
Open
yashwant86 wants to merge 48 commits intomasterfrom
Open
feat(install): Add support for historical manifests by git history#87yashwant86 wants to merge 48 commits intomasterfrom
yashwant86 wants to merge 48 commits intomasterfrom
Conversation
- 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
…idance and fallback mechanisms
…calManifestFromDB for exact version matching
…r improved data handling and output
…Write-ManifestToUserCache helper function
…tching version via h'^/h with validated fallback
…improved manifest retrieval
…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>
…e default downloader (ScoopInstaller#6538)
…lt downloader fails (ScoopInstaller#6539)
…variables (ScoopInstaller#6460) Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
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.
Mirror of ScoopInstaller#6370