Improve update checker: cache, parallelism, and credential suppression#286
Merged
Improve update checker: cache, parallelism, and credential suppression#286
Conversation
) - Respect 24-hour cache in sync/doctor/hook instead of always hitting network; check-updates (explicit) still forces fresh - Parallelize git ls-remote calls with DispatchQueue.concurrentPerform - Suppress keychain/credential prompts via GIT_TERMINAL_PROMPT=0 and GIT_ASKPASS="" - Show detailed per-pack output with SHA diffs and "up to date" message
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.
Context
Closes #275.
The update checker added in #273 always forces a live network check at the end of
mcs syncandmcs doctor, making them slow. Additionally,git ls-remotecan trigger macOS Keychain credential prompts, and pack checks run serially.Changes
performCheck()now respects a 24-hour cache by default. Onlymcs check-updates(explicit user invocation) forces a fresh network check viaforceRefresh: true. Replaced theisHookparameter withforceRefreshto separate cache policy from output formatting.checkPackUpdates()usesDispatchQueue.concurrentPerformto rungit ls-remotecalls concurrently instead of serially. Usesnonisolated(unsafe)pre-sized array for Swift 6 strict concurrency compliance.git ls-remotecalls now passGIT_TERMINAL_PROMPT=0andGIT_ASKPASS=""to prevent Keychain/askpass popups during read-only checks.mcs check-updatesshows "Everything is up to date." when no updates are found. Hook output stays simple.Test plan
swift test --filter MCSTests.UpdateChecker— 31 tests pass (1 new + 2 updated)swift test— full suite (867 tests) passesmcs synctwice — second run should be fast (cached)mcs check-updates— should always show fresh results