Skip to content

Set WI runtime to context - #1423

Merged
kaumini merged 2 commits into
wso2:5.0.xfrom
kaumini:updateWIti0.9.2
May 7, 2026
Merged

Set WI runtime to context#1423
kaumini merged 2 commits into
wso2:5.0.xfrom
kaumini:updateWIti0.9.2

Conversation

@kaumini

@kaumini kaumini commented May 7, 2026

Copy link
Copy Markdown
Contributor

Purpose

Related wso2/vscode-extensions#2196

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

Summary by CodeRabbit

  • Enhancements
    • Extension now detects and configures itself based on the runtime environment during activation, enabling environment-specific behavior and functionality.

@kaumini
kaumini requested a review from gigara May 7, 2026 07:32
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Extension activation now sets VS Code context flag WI.isWiRuntime based on the WSO2_INTEGRATOR_RUNTIME environment variable, exposing runtime configuration state to the extension before other initialization steps.

Changes

Runtime Context Configuration

Layer / File(s) Summary
Runtime Context Flag Setup
wi/wi-extension/src/extension.ts
During activation, extension reads WSO2_INTEGRATOR_RUNTIME environment variable and sets WI.isWiRuntime VS Code context flag before other initialization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is mostly a template with placeholders and lacks substantive content in most sections. Fill in all required sections with actual implementation details: Purpose (expand beyond the PR link), Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests (unit and integration coverage), Security checks (provide yes/no answers with explanation), Samples, Related PRs, Migrations, Test environment, and Learning. At minimum, describe what the change does and why it matters.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Set WI runtime to context' accurately summarizes the main code change, which sets the WI runtime context flag based on an environment variable.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

gigara
gigara previously approved these changes May 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wi/wi-extension/src/extension.ts`:
- Around line 119-120: The call to vscode.commands.executeCommand('setContext',
'WI.isWiRuntime', ...) is not awaited, so the context may not be applied before
ProductUpdateServiceClient is constructed; make the surrounding function async
(if not already) and await vscode.commands.executeCommand(...) or chain a
.then() so that ProductUpdateServiceClient instantiation happens only after the
promise resolves (refer to vscode.commands.executeCommand and
ProductUpdateServiceClient in the diff).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a3c50815-cca3-4e54-b2a0-5c40179fa366

📥 Commits

Reviewing files that changed from the base of the PR and between 665214b and 7ffa1b9.

📒 Files selected for processing (1)
  • wi/wi-extension/src/extension.ts

Comment thread wi/wi-extension/src/extension.ts Outdated
@kaumini
kaumini merged commit b81ecfc into wso2:5.0.x May 7, 2026
5 checks passed
gigara pushed a commit to gigara/product-integrator that referenced this pull request Jul 28, 2026
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