Skip to content

Comments

Fix issues in the MI Extension#899

Merged
ChinthakaJ98 merged 9 commits intowso2:mainfrom
ChinthakaJ98:mi-fixes-11
Nov 28, 2025
Merged

Fix issues in the MI Extension#899
ChinthakaJ98 merged 9 commits intowso2:mainfrom
ChinthakaJ98:mi-fixes-11

Conversation

@ChinthakaJ98
Copy link
Contributor

@ChinthakaJ98 ChinthakaJ98 commented Nov 13, 2025

This PR will fix the below mentioned issues.

Summary by CodeRabbit

  • New Features

    • Legacy MI runtime detection with contextual warnings and a new runtime check endpoint
    • Debugger: added message-variable retrieval support
  • Bug Fixes

    • More robust module search and connector fetch error handling and notifications
    • Relaxed module filtering to improve compatibility
  • Improvements

    • Refinements to form placeholders, validations, labels and project info display
    • Build feedback now surfaces success/error after builds
  • Documentation

    • Prerequisites section removed from extension README
  • Chores

    • Updated ignore rules (added env and wrapper files)

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Walkthrough

Adds legacy MI runtime detection and an RPC for it, conditions try-out UI on runtime/artifact support, tightens error reporting with user notifications, adjusts module filtering and form field defaults/validation, restructures project information fields, and makes async/runtime changes in RPC manager and state machine.

Changes

Cohort / File(s) Change Summary
Legacy runtime detection & RPC
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts, workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-handler.ts, workspaces/mi/mi-core/src/state-machine-types.ts, workspaces/mi/mi-extension/src/stateMachine.ts
Added isLegacyProject/isLegacyRuntime checks and propagation; exposed new RPC handler for legacy check; made exposeVersionedServices async and added MiDiagramRpcManager.isLegacyProject().
Try-out UI conditional rendering
workspaces/mi/mi-diagram/src/components/sidePanel/tryout/SetPayloads.tsx
Added runtime/artifact support flags (showLegacyRuntimeError, showNotSupportedError) and conditional rendering to show warnings or original payload UI.
Module suggestions & module filtering
workspaces/mi/mi-diagram/src/components/sidePanel/mediators/ModuleSuggestions.tsx, workspaces/mi/mi-diagram/src/components/sidePanel/modules/ModulesList.tsx
ModuleSuggestions: safer response parsing and empty-array fallback on error. ModulesList: removed version equality check when filtering store modules (now matches connector name only).
Debugger behavior & variables support
workspaces/mi/mi-extension/src/debugger/debugHelper.ts, workspaces/mi/mi-extension/src/debugger/debugger.ts
Guarded deployment-toml copy logic behind shouldCopyTarget and added post-build success/error feedback; extended debugger to support variables via a "variable" context and "message-variables" mapping.
User-facing error notifications
workspaces/mi/mi-visualizer/src/views/Forms/ConnectionForm/index.tsx, workspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/index.tsx
Added rpcClient.showNotification calls when connector or inbound-connector fetches fail.
Form field placeholder/default adjustments
workspaces/mi/mi-visualizer/src/views/Forms/AddressEndpointForm.tsx, workspaces/mi/mi-visualizer/src/views/Forms/HTTPEndpointForm/Types.ts, workspaces/mi/mi-visualizer/src/views/Forms/WSDLEndpointForm/Types.ts
Swapped use of defaultValue string to placeholder with empty defaultValue for parameter template fields.
Form validation & parameter payloads
workspaces/mi/mi-visualizer/src/views/Forms/MessageProcessorForm.tsx, workspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/inboundConnectorForm.tsx
MessageProcessorForm: adjusted maxRedeliveryAttempts validation to permit -1/undefined as valid sentinel values. Inbound connector: use merged finalParameters (paramManager + transformed) when creating connector payloads.
Project information restructure
workspaces/mi/mi-visualizer/src/views/Overview/ProjectInformation/ProjectInformationForm.tsx, workspaces/mi/mi-visualizer/src/views/Overview/ProjectInformation/index.tsx
Replaced Description display with Group ID and Artifact ID fields; made Group ID and Artifact ID required in schema and sourced from buildDetails.advanceDetails; adjusted UI items accordingly.
UI text & spacing tweaks
workspaces/mi/mi-visualizer/src/views/Forms/Tests/MockServices/MockResourceForm.tsx, workspaces/mi/mi-visualizer/src/views/Forms/Tests/MockServices/MockServiceForm.tsx
Title-cased FormGroup labels and added line breaks for spacing.
README & gitignore
workspaces/mi/mi-extension/README.md, workspaces/mi/mi-extension/src/util/index.ts
Removed Prerequisites section from README; updated .gitignore to ignore mvnw, mvnw.cmd, and .env.

Sequence Diagram(s)

sequenceDiagram
  participant UI as SetPayloads UI
  participant RPC as MiDiagram RPC
  participant Core as mi-core (isLegacyProject)
  rect rgb(225,240,255)
  Note right of UI: User opens Try-Out / Set Payloads
  end
  UI->>RPC: request isLegacyProject(projectUri)
  RPC->>Core: delegate isLegacyProject check
  Core-->>RPC: Promise<boolean> (isLegacy)
  RPC-->>UI: boolean result
  alt isLegacyRuntime == true
    UI->>UI: show legacy runtime warning (no try-out)
  else isSupportedArtifact == false
    UI->>UI: show unsupported artifact warning
  else
    UI->>UI: render payload form (AutoComplete, ParameterManager, actions)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas needing careful review:
    • workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts — async signature changes and duplicated isLegacyProject declarations.
    • workspaces/mi/mi-visualizer/src/views/Overview/ProjectInformation/ProjectInformationForm.tsx — schema, data mapping, and UI wiring changes.
    • workspaces/mi/mi-diagram/src/components/sidePanel/tryout/SetPayloads.tsx — conditional rendering branches and unit/UX edge cases.
    • Cross-file propagation of isLegacyRuntime (stateMachine, RPC handler, type updates) should be validated for consistent typing and runtime behavior.

Possibly related PRs

Suggested reviewers

  • hevayo
  • gigara
  • kanushka

Poem

🐰 I sniffed the runtime, old or new,
I hopped through forms to change a view.
Warnings now whisper when things won't fit,
Placeholders bloom where defaults once lit.
Hooray — async checks and fewer surprises too! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only lists issue references without following the required template structure. It lacks critical sections including Purpose, Goals, Approach, UI/Icon changes, test coverage, and other required documentation. Complete the PR description using the repository template, including Purpose (problem statement), Goals (solutions), Approach (implementation details), and relevant sections for UI changes, tests, security, and documentation.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Fix issues in the MI Extension' is vague and generic, using non-descriptive phrasing that doesn't convey the specific nature or primary focus of the substantial changes across multiple components and files. Provide a more specific title that highlights the main change category, such as 'Add legacy MI runtime detection and support' or 'Fix module filtering and payload validation in MI diagram components'.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
workspaces/mi/mi-diagram/src/components/sidePanel/modules/ModulesList.tsx (1)

159-168: Restore version check in connector filtering logic.

The git diff confirms the version comparison (c.version === values.version.tagName) was removed from the filter. This is a functional regression: the updated code hides all versions of an installed connector, preventing users from accessing alternative versions or upgrades.

This inconsistency is evident when compared to similar filtering in workspaces/mi/mi-diagram/src/components/sidePanel/mediators/ModuleSuggestions.tsx:107, which retains the version check: (c.version === module.version.tagName).

Restore the condition to match the intended filtering behavior:

.filter(([_, values]: [string, any]) =>
    !localConnectors ||
    !localConnectors.some((c: any) =>
        ((c.displayName ? c.displayName === values.connectorName : c.name.toLowerCase() === values.connectorName.toLowerCase())) &&
        (c.version === values.version.tagName)
    )
)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)

6149-6153: Strip inline TOML comments before evaluating expose.versioned.services
If the admin keeps an inline comment – e.g. expose.versioned.services = true # generated by scriptmatch[1] becomes true # ..., so the later toLowerCase() === "true" check fails and we incorrectly report that versioned deployments are disabled. That forces the runtime-services flow to fall back even though the feature is actually on. Please trim any trailing inline comment (and surrounding whitespace) before comparing the value.

-        if (match) {
-            let value = match[1].trim();
-            value = value.replace(/^["']|["']$/g, "");
+        if (match) {
+            let value = match[1].trim();
+            value = value.replace(/^["']|["']$/g, "");
+            value = value.split('#')[0].trim();
             if (value.toLowerCase() === "true") return true;
             return false;
         }
🧹 Nitpick comments (8)
workspaces/mi/mi-visualizer/src/views/Forms/Tests/MockServices/MockServiceForm.tsx (1)

314-315: LGTM! Minor spacing and capitalization improvements.

The title capitalization change improves UI consistency, and the spacing adjustment enhances the layout. No functional issues introduced.

Optionally, consider using CSS margin instead of the <br/> tag for more maintainable spacing:

-            <ComponentCard id="mockServiceResourceCard" sx={cardStyle} disbaleHoverEffect>
-                <br/>
-                <FormGroup title="Mock Service Resources" isCollapsed={false}>
+            <ComponentCard id="mockServiceResourceCard" sx={{...cardStyle, paddingTop: '30px'}} disbaleHoverEffect>
+                <FormGroup title="Mock Service Resources" isCollapsed={false}>
workspaces/mi/mi-visualizer/src/views/Forms/MessageProcessorForm.tsx (1)

123-124: Validation logic correctly allows -1 as a special value.

The updated validation properly allows -1 (likely representing unlimited attempts), undefined, and positive values while rejecting zero and other negative numbers. The logic aligns with the error message.

Consider these optional enhancements:

  1. Add integer validation to prevent decimal values like 0.5 or 2.7, which don't make semantic sense for attempt counts:
 maxRedeliveryAttempts: yup.number().typeError('Max Redelivery Attempts must be a number').notRequired().default(4)
-    .test('valid-value','Max Redelivery Attempts must be greater than 0 or -1',(value) => value === -1 || value === undefined || value > 0),
+    .test('valid-value','Max Redelivery Attempts must be greater than 0 or -1',(value) => value === -1 || value === undefined || (value > 0 && Number.isInteger(value))),
  1. Update the placeholder at line 396 to guide users about the -1 special value:
-    placeholder="10"
+    placeholder="10 (use -1 for unlimited)"
workspaces/mi/mi-extension/src/debugger/debugger.ts (1)

635-640: LGTM - Conditional command construction is correct.

The logic appropriately constructs different command structures based on context: "variables" command-argument for the "variable" context, and "properties" for all others.

Optionally, you could define a more specific type instead of any on line 635:

-let propertiesCommand: any;
+let propertiesCommand: { command: string; "command-argument": string; context: string };

This would provide better type safety, though the current implementation is acceptable given the immediate assignment.

workspaces/mi/mi-visualizer/src/views/Forms/Tests/MockServices/MockResourceForm.tsx (2)

174-175: Consider CSS-based spacing instead of <br/> tags.

The added line break achieves the desired spacing, but using CSS (e.g., margin or padding on the FormGroup or via the sx prop on the parent ComponentCard) would be more maintainable and align with modern React best practices. The updated FormGroup title "Expected Request to Resource" is clear and improves the UI.

If you'd like to refactor, you could apply this approach:

-            <ComponentCard id="mockResourceRequestCard" sx={cardStyle} disbaleHoverEffect>
-                <br/>
-                <FormGroup title="Expected Request to Resource" isCollapsed={false}>
+            <ComponentCard id="mockResourceRequestCard" sx={{ ...cardStyle, paddingTop: '15px' }} disbaleHoverEffect>
+                <FormGroup title="Expected Request to Resource" isCollapsed={false}>

207-208: Consider CSS-based spacing instead of <br/> tags.

Same as the previous FormGroup, using CSS for spacing would be more maintainable. The updated title "Expected Response from Resource" is descriptive and enhances clarity.

Apply the same refactor approach here:

-            <ComponentCard id="mockResourceResponseCard" sx={cardStyle} disbaleHoverEffect>
-                <br/>
-                <FormGroup title="Expected Response from Resource" isCollapsed={false}>
+            <ComponentCard id="mockResourceResponseCard" sx={{ ...cardStyle, paddingTop: '15px' }} disbaleHoverEffect>
+                <FormGroup title="Expected Response from Resource" isCollapsed={false}>
workspaces/mi/mi-extension/src/debugger/debugHelper.ts (1)

206-209: Remove redundant shouldCopyTarget check.

Line 209 checks if (shouldCopyTarget && code === 0) inside a block already guarded by if (shouldCopyTarget) at line 206. The inner shouldCopyTarget check is redundant.

Apply this diff to simplify:

         if (shouldCopyTarget) {

             buildProcess.on('exit', async (code) => {
-                if (shouldCopyTarget && code === 0) {
+                if (code === 0) {
workspaces/mi/mi-diagram/src/components/nodes/MediatorNode/MediatorNodeWidget.tsx (1)

102-116: Consider extracting repeated logic into a custom hook.

The pattern of fetching isLegacyProject on mount is duplicated across Navigator, GroupNodeWidget, MediatorNodeWidget, and List components. This violates the DRY principle and makes maintenance harder.

Create a custom hook:

// hooks/useIsLegacyProject.ts
export function useIsLegacyProject(rpcClient: any): boolean {
    const [isLegacyProject, setIsLegacyProject] = React.useState<boolean>(false);
    
    useEffect(() => {
        rpcClient.getMiDiagramRpcClient().isLegacyProject()
            .then(setIsLegacyProject)
            .catch((error) => {
                console.error("Failed to determine legacy project status:", error);
                setIsLegacyProject(false);
            });
    }, [rpcClient]);
    
    return isLegacyProject;
}

Then use it in components:

-    const [isLegacyProject, setIsLegacyProject] = React.useState<boolean>(false);
-
-    useEffect(() => {
-        rpcClient.getMiDiagramRpcClient().isLegacyProject().then(setIsLegacyProject);
-    }, []);
+    const isLegacyProject = useIsLegacyProject(rpcClient);
workspaces/mi/mi-diagram/src/components/nodes/CallNode/CallNodeWidget.tsx (1)

134-138: Consider adding rpcClient to the useEffect dependencies.

The useEffect references rpcClient but doesn't include it in the dependency array. While rpcClient is unlikely to change in practice, including it follows React best practices and prevents potential stale closure issues.

Apply this diff:

     useEffect(() => {
         rpcClient.getMiDiagramRpcClient().isLegacyProject().then(setIsLegacyProject);
-    }, []);
+    }, [rpcClient]);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20f6525 and c148260.

📒 Files selected for processing (31)
  • workspaces/mi/mi-core/src/rpc-types/mi-diagram/index.ts (1 hunks)
  • workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1 hunks)
  • workspaces/mi/mi-diagram/src/components/Navigator/Navigator.tsx (2 hunks)
  • workspaces/mi/mi-diagram/src/components/nodes/CallNode/CallNodeWidget.tsx (3 hunks)
  • workspaces/mi/mi-diagram/src/components/nodes/GroupNode/GroupNodeWidget.tsx (3 hunks)
  • workspaces/mi/mi-diagram/src/components/nodes/MediatorNode/MediatorNodeWidget.tsx (3 hunks)
  • workspaces/mi/mi-diagram/src/components/nodes/ReferenceNode/ReferenceNodeWidget.tsx (2 hunks)
  • workspaces/mi/mi-diagram/src/components/sidePanel/index.tsx (1 hunks)
  • workspaces/mi/mi-diagram/src/components/sidePanel/mediators/List.tsx (3 hunks)
  • workspaces/mi/mi-diagram/src/components/sidePanel/mediators/ModuleSuggestions.tsx (1 hunks)
  • workspaces/mi/mi-diagram/src/components/sidePanel/modules/ModulesList.tsx (1 hunks)
  • workspaces/mi/mi-diagram/src/components/sidePanel/tryout/SetPayloads.tsx (3 hunks)
  • workspaces/mi/mi-diagram/src/resources/icons/mediatorIcons/icons.tsx (2 hunks)
  • workspaces/mi/mi-extension/README.md (0 hunks)
  • workspaces/mi/mi-extension/src/debugger/debugHelper.ts (2 hunks)
  • workspaces/mi/mi-extension/src/debugger/debugger.ts (1 hunks)
  • workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-handler.ts (2 hunks)
  • workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (2 hunks)
  • workspaces/mi/mi-extension/src/util/index.ts (2 hunks)
  • workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (2 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/AddressEndpointForm.tsx (1 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/ConnectionForm/index.tsx (1 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/HTTPEndpointForm/Types.ts (1 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/inboundConnectorForm.tsx (1 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/index.tsx (1 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/MessageProcessorForm.tsx (1 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/Tests/MockServices/MockResourceForm.tsx (2 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/Tests/MockServices/MockServiceForm.tsx (1 hunks)
  • workspaces/mi/mi-visualizer/src/views/Forms/WSDLEndpointForm/Types.ts (1 hunks)
  • workspaces/mi/mi-visualizer/src/views/Overview/ProjectInformation/ProjectInformationForm.tsx (4 hunks)
  • workspaces/mi/mi-visualizer/src/views/Overview/ProjectInformation/index.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • workspaces/mi/mi-extension/README.md
🧰 Additional context used
🧬 Code graph analysis (12)
workspaces/mi/mi-diagram/src/components/Navigator/Navigator.tsx (4)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • isLegacyProject (456-456)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • isLegacyProject (1189-1191)
workspaces/mi/mi-diagram/src/resources/icons/mediatorIcons/icons.tsx (1)
  • getMediatorIconsFromFont (27-326)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (2)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • isLegacyProject (1189-1191)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-handler.ts (3)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • isLegacyProject (456-456)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • isLegacyProject (1189-1191)
workspaces/mi/mi-diagram/src/components/sidePanel/mediators/List.tsx (4)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • isLegacyProject (456-456)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • isLegacyProject (1189-1191)
workspaces/mi/mi-diagram/src/resources/icons/mediatorIcons/icons.tsx (1)
  • getMediatorIconsFromFont (27-326)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (2)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • isLegacyProject (456-456)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-diagram/src/components/sidePanel/index.tsx (1)
workspaces/mi/mi-diagram/src/resources/icons/mediatorIcons/icons.tsx (1)
  • getMediatorIconsFromFont (27-326)
workspaces/mi/mi-diagram/src/components/sidePanel/tryout/SetPayloads.tsx (1)
workspaces/common-libs/ui-toolkit/src/components/AutoComplete/AutoComplete.tsx (1)
  • AutoComplete (326-563)
workspaces/mi/mi-diagram/src/components/nodes/MediatorNode/MediatorNodeWidget.tsx (4)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • isLegacyProject (456-456)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • isLegacyProject (1189-1191)
workspaces/mi/mi-diagram/src/resources/icons/mediatorIcons/icons.tsx (1)
  • getMediatorIconsFromFont (27-326)
workspaces/mi/mi-diagram/src/components/nodes/CallNode/CallNodeWidget.tsx (4)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • isLegacyProject (456-456)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • isLegacyProject (1189-1191)
workspaces/mi/mi-diagram/src/resources/icons/mediatorIcons/icons.tsx (1)
  • getMediatorIconsFromFont (27-326)
workspaces/mi/mi-diagram/src/components/nodes/GroupNode/GroupNodeWidget.tsx (4)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • isLegacyProject (456-456)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • isLegacyProject (1189-1191)
workspaces/mi/mi-diagram/src/resources/icons/mediatorIcons/icons.tsx (1)
  • getMediatorIconsFromFont (27-326)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (3)
workspaces/mi/mi-extension/src/util/onboardingUtils.ts (2)
  • getMIVersionFromPom (137-149)
  • compareVersions (976-997)
workspaces/mi/mi-extension/src/constants/index.ts (1)
  • RUNTIME_VERSION_440 (200-200)
workspaces/mi/mi-extension/src/stateMachine.ts (1)
  • getStateMachine (686-718)
workspaces/mi/mi-diagram/src/components/nodes/ReferenceNode/ReferenceNodeWidget.tsx (4)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • isLegacyProject (456-456)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • isLegacyProject (6123-6126)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • isLegacyProject (1189-1191)
workspaces/mi/mi-diagram/src/resources/icons/mediatorIcons/icons.tsx (1)
  • getMediatorIconsFromFont (27-326)
🔇 Additional comments (25)
workspaces/mi/mi-extension/src/debugger/debugger.ts (2)

623-623: LGTM - New context type added.

The addition of "variable" to the context list enables querying variables alongside other property scopes.


630-631: LGTM - Property mappings extended.

The new mappings appropriately transform response keys to user-friendly labels for the Synapse scope and the new Variables feature.

workspaces/mi/mi-visualizer/src/views/Forms/ConnectionForm/index.tsx (1)

235-239: LGTM! Good addition of user feedback.

The error notification improves user experience by providing visible feedback when connector fetching fails, while the console.error maintains developer debugging capability.

workspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/index.tsx (1)

109-112: LGTM! Improved error handling with user notification.

The addition of user-facing error notification when fetching inbound-connectors fails improves the user experience by making failures visible.

workspaces/mi/mi-diagram/src/components/sidePanel/mediators/ModuleSuggestions.tsx (1)

54-76: LGTM! Improved error handling consistency.

The changes improve error handling by:

  • Initializing data to an empty array
  • Only parsing JSON when response.ok is true
  • Consistently using empty array [] instead of undefined on error

This ensures more predictable behavior in error scenarios.

workspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/inboundConnectorForm.tsx (1)

253-286: LGTM! Fixed parameter merging logic.

The change from transformedParameters to finalParameters correctly merges both parameter sources:

  • Parameters from the ParamManager UI component
  • Parameters from the form fields

This ensures all parameter inputs are included in the inbound connector configuration.

workspaces/mi/mi-extension/src/util/index.ts (1)

179-210: LGTM! Standard .gitignore patterns added.

The additions follow common best practices:

  • .env prevents accidental commit of environment variables/secrets
  • mvnw and mvnw.cmd are Maven wrapper executables that are typically generated
workspaces/mi/mi-diagram/src/components/nodes/ReferenceNode/ReferenceNodeWidget.tsx (2)

106-110: LGTM! Legacy project detection added.

The component now detects legacy projects on mount and passes this flag to icon rendering, enabling legacy-aware UI behavior.


234-234: LGTM! Icon rendering updated for legacy support.

The isLegacyProject flag is correctly propagated to getMediatorIconsFromFont, enabling appropriate icon rendering based on project type.

workspaces/mi/mi-core/src/rpc-types/mi-diagram/index.ts (1)

447-447: LGTM! New API method for legacy project detection.

The isLegacyProject method is correctly added to the MiDiagramAPI interface, enabling components to query project type.

workspaces/mi/mi-visualizer/src/views/Forms/AddressEndpointForm.tsx (1)

236-247: LGTM! Improved form UX with placeholder instead of default value.

The change from defaultValue: "parameter_value" to placeholder: "parameter_value" with defaultValue: "" provides better user experience by showing an example without pre-filling the field.

workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)

456-456: LGTM! RPC type declaration follows established patterns.

The new isLegacyProject RPC type is well-defined and consistent with other RPC type declarations in the file.

workspaces/mi/mi-visualizer/src/views/Forms/HTTPEndpointForm/Types.ts (1)

161-162: Good UX improvement with placeholder guidance.

Changing from a pre-filled defaultValue to a placeholder provides clearer guidance while keeping the field initially empty. This aligns with modern form design patterns.

workspaces/mi/mi-diagram/src/components/Navigator/Navigator.tsx (1)

148-148: Verify icon rendering behavior with legacy flag.

The legacy flag is now passed to getMediatorIconsFromFont. Ensure this produces the expected icon colors for legacy vs. non-legacy projects, especially for mediator groups like Call, Clone, and OAuth that have conditional coloring.

workspaces/mi/mi-visualizer/src/views/Forms/WSDLEndpointForm/Types.ts (1)

107-108: Consistent UX improvement across endpoint forms.

This change mirrors the HTTPEndpointForm update, providing consistent placeholder-based guidance across different endpoint types.

workspaces/mi/mi-visualizer/src/views/Overview/ProjectInformation/index.tsx (1)

240-244: Verify the UI change manually against linked issues.

I was unable to access the linked issues in the sandbox environment to verify whether any of them specifically request displaying Group ID and Artifact ID instead of Name and Description. The GitHub CLI is not functioning in this context.

Please manually verify that at least one of the linked issues (668, 1289, 1204, 1314, 1308, 1042, 1022, 970, 1259, 1343, 1306, 1295, 1293, 1098, 695, 715, 643, 645) explicitly requests this UI change. If confirmed, the change is intentional and aligns with requirements. If not, consider whether the project name should remain prominently displayed alongside or instead of the technical Maven coordinates.

workspaces/mi/mi-diagram/src/components/sidePanel/index.tsx (1)

158-159: LGTM!

The legacy project check is properly awaited and the result is correctly passed to getMediatorIconsFromFont. The implementation aligns with the broader PR pattern for legacy-aware icon rendering.

workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-handler.ts (2)

321-322: LGTM!

The import of isLegacyProject is correctly added to the import list from @wso2/mi-core.


510-510: LGTM!

The RPC handler registration correctly delegates to the manager's isLegacyProject() method and follows the established pattern in this file.

workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (2)

452-453: LGTM!

The import additions are correctly structured and follow the established pattern.


1189-1191: LGTM!

The client-side RPC method implementation correctly follows the established pattern and matches the type definitions from the core module.

workspaces/mi/mi-diagram/src/components/nodes/CallNode/CallNodeWidget.tsx (1)

228-228: LGTM!

The isLegacyProject flag is correctly passed to both getMediatorIconsFromFont calls for consistent legacy-aware icon rendering across the node and its endpoint.

Also applies to: 271-271

workspaces/mi/mi-diagram/src/components/sidePanel/tryout/SetPayloads.tsx (3)

52-53: LGTM!

The state initialization and computed value for error conditions are correctly implemented. The optional chaining for artifactModel?.tag is good defensive programming.


82-84: LGTM!

The legacy project check is appropriately placed within the existing data loading effect, ensuring it runs once on mount alongside other initialization logic.


260-299: LGTM!

The conditional rendering logic effectively handles unsupported artifacts and legacy runtimes before showing the payload configuration form. The warning messages are clear and provide actionable guidance to users.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
workspaces/mi/mi-core/src/state-machine-types.ts (1)

252-274: isLegacyRuntime flag looks fine; consider clarifying semantics vs isOldProject

The new optional field is backward compatible and fits the existing pattern of boolean flags on VisualizerLocation. To avoid ambiguity with isOldProject, it might be worth adding a short doc comment (either on the interface or on the field) explaining how isLegacyRuntime differs from isOldProject and in which scenarios each should be set.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08015c3 and a2b7ca8.

📒 Files selected for processing (1)
  • workspaces/mi/mi-core/src/state-machine-types.ts (1 hunks)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
workspaces/mi/mi-extension/src/stateMachine.ts (2)

100-104: Minor: Trailing blank line inside assign block.

There's an extra blank line at line 103 before the closing brace. Consider removing it for consistency with the other assign blocks in this file.

                             isOldProject: (context, event) => event.data.isOldProject,
                             displayOverview: (context, event) => event.data.displayOverview,
                             isLegacyRuntime: (context, event) => event.data.isLegacyRuntime
-
                         })

914-916: Consider moving version detection inside the project check block.

The runtime version detection logic is correct—defaulting to true (legacy) when the version is unavailable is a safe fallback. However, this detection runs unconditionally for all calls, including when no MI project is detected.

For a minor performance optimization, consider moving this logic inside the if (isProject || isOldProject) block (around line 905), since the legacy runtime flag is only meaningful for valid projects:

     if (isProject || isOldProject) {
         isEnvironmentSetUp = await setupEnvironment(projectUri, isOldProject);
         if (!isEnvironmentSetUp) {
             vscode.commands.executeCommand('setContext', 'MI.status', 'notSetUp');
         }
         // console.log project path
         console.log(`Current workspace path: ${projectUri}`);
     }

-    const runtimeVersion = await getMIVersionFromPom(projectUri);
-    const isLegacyRuntime = runtimeVersion ? compareVersions(runtimeVersion, RUNTIME_VERSION_440) < 0 : true;
+    let isLegacyRuntime = true;
+    if (isProject || isOldProject) {
+        const runtimeVersion = await getMIVersionFromPom(projectUri);
+        isLegacyRuntime = runtimeVersion ? compareVersions(runtimeVersion, RUNTIME_VERSION_440) < 0 : true;
+    }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a2b7ca8 and fa87b8c.

📒 Files selected for processing (1)
  • workspaces/mi/mi-extension/src/stateMachine.ts (6 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
workspaces/mi/mi-extension/src/stateMachine.ts (4)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/rpc-type.ts (1)
  • getMIVersionFromPom (428-428)
workspaces/mi/mi-rpc-client/src/rpc-clients/mi-diagram/rpc-client.ts (1)
  • getMIVersionFromPom (1080-1082)
workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts (1)
  • getMIVersionFromPom (490-495)
workspaces/mi/mi-extension/src/constants/index.ts (1)
  • RUNTIME_VERSION_440 (199-199)
🔇 Additional comments (3)
workspaces/mi/mi-extension/src/stateMachine.ts (3)

21-21: LGTM!

Import additions for runtime version detection are correctly structured and appropriately sourced from constants and utility modules.

Also applies to: 30-30


40-40: LGTM!

The optional isLegacyRuntime property correctly extends MachineContext and aligns with the pattern of other optional properties in the interface.


918-928: LGTM!

The return object correctly includes isLegacyRuntime, which is properly consumed by the state machine transition on line 102.

Copy link
Contributor

@gigara gigara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ChinthakaJ98 ChinthakaJ98 removed the Checks/Run MI UI Tests Force run MI UI tests label Nov 28, 2025
@ChinthakaJ98 ChinthakaJ98 merged commit cada6a6 into wso2:main Nov 28, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants