[release/9.4] Share more package checking code between CLI and app host #10381
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.
Backport of #10372 to release/9.4
/cc @davidfowl @JamesNK
Customer Impact
We have inconsistencies in update notification logic between the CLI and app host, which could result in missing update prompts. This change ensures both the CLI and app host use the same logic for checking package updates, leading to more reliable and predictable notifications and a consistent user experience.
Testing
Unit and integration tests were updated and/or added to cover the unified package checking logic. Manual verification was performed to ensure both the CLI and app host now provide consistent update notifications for various test scenarios.
Risk
Low to moderate. The change refactors and centralizes existing logic, reducing duplication but affecting both the CLI and app host. There is some risk of introducing subtle differences or regressions if edge cases are not covered, but overall, the risk is mitigated by automated and manual testing.
Regression?
No known regressions are expected. The refactoring addresses an existing inconsistency, so it should reduce the likelihood of future regressions in update notification logic by having a single source of truth.