Skip to content

fix(upgrade): check extension version before calling gotoAgentMode#1021

Open
frankliu20 wants to merge 2 commits into
microsoft:mainfrom
frankliu20:fix/check-extension-version-before-gotoAgentMode
Open

fix(upgrade): check extension version before calling gotoAgentMode#1021
frankliu20 wants to merge 2 commits into
microsoft:mainfrom
frankliu20:fix/check-extension-version-before-gotoAgentMode

Conversation

@frankliu20
Copy link
Copy Markdown
Contributor

@frankliu20 frankliu20 commented May 27, 2026

This pull request introduces improvements to the upgrade notification and extension management experience for Java modernization. The changes make notification messages and button text dynamically reflect the actual extension installation state (not installed, outdated, or up-to-date), enhance extension version checks, and add robust telemetry and testing. This results in clearer user guidance and better reliability when upgrading Java runtimes or fixing vulnerabilities.

Notification and Message Improvements

  • Notification messages and action button text now change based on whether the "App Modernization" extension is not installed, outdated, or up-to-date, providing users with more accurate and actionable prompts. (src/upgrade/display/notificationManager.ts [1] [2] [3] [4]; src/upgrade/utility.ts [5] [6] [7] [8]
  • Refactored notification content construction into pure functions for easier testing and maintenance. (src/upgrade/display/notificationManager.ts src/upgrade/display/notificationManager.tsR32-R86)

Extension Version Handling and Validation

  • Introduced a minimum required version constant (MIN_APPMOD_VERSION = "1.15.0") for the modernization extension and logic to determine if the extension is up-to-date, outdated, or not installed. (src/constants.ts [1]; src/upgrade/display/notificationManager.ts [2]
  • Improved the extension installation/update flow: now checks for outdated versions and prompts for update if the installed version is too old, with telemetry for both successful and failed installations/updates. (src/upgrade/utility.ts src/upgrade/utility.tsL158-R202)

Telemetry and Command Enhancements

  • Added telemetry for the source of upgrade actions and for extension install/update attempts, improving observability of user flows and extension health. (src/upgrade/upgradeManager.ts [1]; src/upgrade/utility.ts [2]; src/upgrade/display/notificationManager.ts [3]

Testing

  • Added comprehensive unit tests for notification content and extension state logic, ensuring reliability across different extension versions and notification scenarios. (test/suite/notificationContent.test.ts test/suite/notificationContent.test.tsR1-R145)

Other Improvements

These changes collectively improve the user experience, reliability, and maintainability of the Java upgrade and modernization workflow.

@frankliu20 frankliu20 force-pushed the fix/check-extension-version-before-gotoAgentMode branch 3 times, most recently from f8ae0f5 to e1f14a8 Compare May 27, 2026 08:38
@frankliu20
Copy link
Copy Markdown
Contributor Author

@copilot pls review this pr

@frankliu20 frankliu20 force-pushed the fix/check-extension-version-before-gotoAgentMode branch 3 times, most recently from d9bffa2 to 6712e66 Compare May 27, 2026 11:09
- Check appmod extension version (>= 1.15.0) before calling gotoAgentMode,
  fixing 67% of upgrade failures caused by outdated extensions
- Add extensionState (up-to-date/outdated/not-installed) and issueType
  (cve/upgrade) dimensions to all telemetry events for funnel analysis
- Distinguish notification button text and message body based on extension
  state (Upgrade Now / Update Extension and Upgrade / Install Extension
  and Upgrade)
- Track extension install/update success rate and reload prompt engagement
- Extract pure functions (getExtensionState, buildNotificationContent) for
  unit testability
- Centralize telemetry operation names in telemetryConstants.ts

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@frankliu20 frankliu20 force-pushed the fix/check-extension-version-before-gotoAgentMode branch from 6712e66 to e82d377 Compare May 27, 2026 11:17
… correlation

- Replace instrumentOperationAsVsCodeCommand with instrumentOperation +
  registerCommand to get operationId for execute.start/end events
- Pass notification's operationId to the upgrade command as
  notificationOperationId, enabling cross-step funnel join

Co-Authored-By: Claude Opus 4 <noreply@anthropic.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.

2 participants