Skip to content

Skip BI warnings and enable BI mode automatically when WSO2 Integrator is installed#1581

Merged
kanushka merged 3 commits intowso2:hotfix/wso2-integrator-reqfrom
kanushka:fix-warning-msg
Feb 26, 2026
Merged

Skip BI warnings and enable BI mode automatically when WSO2 Integrator is installed#1581
kanushka merged 3 commits intowso2:hotfix/wso2-integrator-reqfrom
kanushka:fix-warning-msg

Conversation

@kanushka
Copy link
Contributor

@kanushka kanushka commented Feb 26, 2026

Summary

This PR aligns WSO2 Integrator detection across the Ballerina extension and uses a single shared check.

Changes

  • Added shared helper: isWSO2IntegratorPresent() in src/utils/config.ts
  • Updated checkIsBI(...) to return true when WSO2 Integrator is present
    • This enables BI behavior automatically without requiring manual ballerina.isBI config
  • Skipped the "Multiple Ballerina installations detected" warning in Integrator environment
  • Reused the same Integrator check in AI panel sign-in alert logic
  • Removed duplicated Integrator detection logic from core/extension.ts

Why

  • Avoid noisy warning popups in WSO2 Integrator environment
  • Ensure BI-related buttons/workspace behavior are auto-enabled when Integrator is installed
  • Keep Integrator detection logic centralized and consistent

Notes

  • No functional changes for non-Integrator environments
  • Existing config-based ballerina.isBI behavior remains as fallback

Summary by CodeRabbit

  • Bug Fixes

    • Suppressed unnecessary multi-installation warnings when running within WSO2 Integrator.
    • Reduced redundant sign-in prompts when the WSO2 Integrator environment is detected.
  • Improvements

    • Centralized detection of WSO2 Integrator to streamline behavior and avoid irrelevant checks.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e45d974 and f07f08c.

📒 Files selected for processing (3)
  • workspaces/ballerina/ballerina-extension/src/core/extension.ts
  • workspaces/ballerina/ballerina-extension/src/rpc-managers/ai-panel/rpc-manager.ts
  • workspaces/ballerina/ballerina-extension/src/utils/config.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • workspaces/ballerina/ballerina-extension/src/rpc-managers/ai-panel/rpc-manager.ts
  • workspaces/ballerina/ballerina-extension/src/utils/config.ts

📝 Walkthrough

Walkthrough

Centralized WSO2 Integrator detection by introducing isInWI() in the config utils and replacing direct extension checks with calls to isInWI() in the extension and AI panel RPC manager; added an early return in installation/sign-in flows when running inside WSO2 Integrator.

Changes

Cohort / File(s) Summary
Config / Utils
workspaces/ballerina/ballerina-extension/src/utils/config.ts
Added WI_EXTENSION_ID constant and exported isInWI(): boolean that uses the VS Code extensions API; checkIsBI() now short-circuits when isInWI() is true.
Core Extension
workspaces/ballerina/ballerina-extension/src/core/extension.ts
Imported isInWI and added early return in checkMultipleBallerinaInstallations() to skip multi-installation warning when isInWI() is true.
RPC Manager (AI Panel)
workspaces/ballerina/ballerina-extension/src/rpc-managers/ai-panel/rpc-manager.ts
Replaced direct extension presence checks/imports with isInWI() usage and adjusted showSignInAlert flow to use a local inWI variable from isInWI().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nibble bugs and stitch a clue,
One small function, tidy and new,
WI found in utils, no more stray,
Flow skips the checks, hops on its way,
Code garden neat — a carrot for you! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers the summary, changes, rationale, and notes, but is missing most required template sections including Purpose, Goals, Approach, and other standard sections. Add missing required sections from the template: Purpose (with issue links), Goals, Approach, and complete other applicable sections like UI Component Development, Release note, and Documentation.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: skipping BI warnings and auto-enabling BI mode when WSO2 Integrator is installed, which aligns with the primary objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 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.

@kanushka kanushka merged commit a5567d4 into wso2:hotfix/wso2-integrator-req Feb 26, 2026
7 checks passed
@kanushka kanushka deleted the fix-warning-msg branch February 26, 2026 17:35
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