Skip to content

Sync Windows hotfix to release/bi-1.8.x#1568

Open
kanushka wants to merge 15 commits intorelease/bi-1.8.xfrom
hotfix/windows-fix
Open

Sync Windows hotfix to release/bi-1.8.x#1568
kanushka wants to merge 15 commits intorelease/bi-1.8.xfrom
hotfix/windows-fix

Conversation

@kanushka
Copy link
Contributor

@kanushka kanushka commented Feb 25, 2026

Purpose

Update the release/bi-1.8.x branch with the Windows activation hotfix.

Changes

  • Fixes BI extension activation issues specific to Windows environments.
  • Maintains stability for the 1.8.x release cycle.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Enhanced Windows environment detection for Ballerina distributions, improving binary location discovery when no home directory is explicitly configured.
  • Chores

    • Updated fast-xml-parser dependency to version 5.3.7.

@CLAassistant
Copy link

CLAassistant commented Feb 25, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ axewilledge
✅ kanushka
✅ gigara
❌ choreo-cicd
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

The PR releases Ballerina extension version 5.8.1 with enhanced Windows environment detection for locating Ballerina distributions, pins fast-xml-parser to 5.3.7 across configurations, and updates documentation accordingly.

Changes

Cohort / File(s) Summary
Ballerina Extension Version
workspaces/ballerina/ballerina-extension/package.json, workspaces/ballerina/ballerina-extension/CHANGELOG.md
Patch version bump to 5.8.1 with changelog entry documenting Windows environment detection improvement. Header URL reference in 5.8.0 entry modified.
Ballerina Windows Detection
workspaces/ballerina/ballerina-extension/src/core/extension.ts
Adds findWindowsBallerinaPath() function to search Windows registry and common installation directories for Ballerina binary. Extends version-detection workflow to utilize fallback path when ballerinaHome unavailable. Enhances shell environment retrieval by merging registry-derived machine and user PATH values.
Dependency Version Pins
common/autoinstallers/rush-plugins/package.json, common/config/rush/.pnpmfile.cjs
Pins fast-xml-parser to version 5.3.7 via pnpm override and updates dependency references in readPackage hook.
Trivy Configuration
.trivyignore
Clarifies comment for CVE-2026-26996 to remove redundant wording while maintaining context about nested dependency status.

Sequence Diagram(s)

sequenceDiagram
    participant Ext as Ballerina Extension
    participant Sys as Windows System
    participant Reg as Registry
    participant FS as File System
    participant Env as Environment

    Ext->>Sys: Check if Windows & no ballerinaHome
    Ext->>Reg: Query PATH entries for bal.bat
    alt bal.bat found in registry
        Reg-->>Ext: Return registry PATH
    else Not in registry
        Ext->>FS: Check common install directories<br/>(LOCALAPPDATA, ProgramFiles, etc.)
        FS-->>Ext: Return bin directory path
    end
    Ext->>Reg: Read Machine & User PATH values
    Reg-->>Env: Merge Path entries
    Env-->>Ext: Return combined environment
    Ext->>Ext: Set distPath for version detection
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop, skip, and a Windows leap,
Finding Ballerina paths so deep,
Registry searches, directories explored,
Version 5.8.1 soars forward!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete. While it provides Purpose and high-level Changes, it is missing most required sections from the template (Goals, Approach, Release notes, Documentation, Testing details, etc.). Expand the description to include Goals, Approach, Release note, Documentation impact, and test environment details as specified in the repository template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: syncing a Windows hotfix to the release branch for BI 1.8.x.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hotfix/windows-fix

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.

🧹 Nitpick comments (2)
common/config/rush/.pnpmfile.cjs (1)

37-57: Pre-existing duplicate override entries for diff, eslint, and lodash.

Both the dependencies and devDependencies blocks contain duplicate if checks for diff (lines 37–38 & 52–53), eslint (lines 40–41 & 55–56), and lodash (lines 46–47 & 61–62) — mirrored again in the devDependencies section. The second occurrence silently overwrites the first with the same value, so there's no functional bug, but it adds confusion and maintenance risk if future bumps only update one of the two occurrences.

Also applies to: 88-108

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@common/config/rush/.pnpmfile.cjs` around lines 37 - 57, The diff shows
duplicate conditional overrides for packages in the pnpmfile (e.g., duplicate
if-blocks checking pkg.dependencies['diff'], ['eslint'], ['lodash'] and the
mirrored duplicates in pkg.devDependencies); remove the redundant repeated
checks so each package is normalized only once per dependency block (or
consolidate into a small helper loop that iterates a map of package->version and
applies it to pkg.dependencies and pkg.devDependencies), updating the code
around the existing pkg.dependencies and pkg.devDependencies logic (references:
pkg.dependencies, pkg.devDependencies, package keys 'diff', 'eslint', 'lodash',
'fast-xml-parser', 'qs') so future bumps only need a single place to change.
workspaces/ballerina/ballerina-extension/src/core/extension.ts (1)

2716-2780: Remove the unsubstantiated duplication claim; the dual PowerShell spawns concern is valid.

findWindowsBallerinaPath() is defined only once in this file (line 2716), so the AI-generated summary about duplication is incorrect.

However, the concern about dual PowerShell spawns is accurate: during extension activation on Windows, syncEnvironment() (line 1706) calls getShellEnvironment() to read environment variables via PowerShell, and then findWindowsBallerinaPath() (line 1809) spawns PowerShell again to scan for Ballerina in the registry PATH. Each call has a 10 s timeout, creating potential startup latency. Consider caching or combining these registry reads in a follow-up to reduce activation latency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@workspaces/ballerina/ballerina-extension/src/core/extension.ts` around lines
2716 - 2780, The review incorrectly claims findWindowsBallerinaPath is
duplicated; however the real issue is that syncEnvironment ->
getShellEnvironment and findWindowsBallerinaPath both spawn PowerShell (each
with a 10s timeout), causing potential double startup latency; update the code
to avoid two separate PowerShell calls by consolidating registry PATH reads (or
caching the result) so findWindowsBallerinaPath reuses the environment/registry
data obtained by getShellEnvironment (or expose a shared helper that performs
the single PowerShell invocation and returns PATH entries) and adjust
syncEnvironment/getShellEnvironment to use that shared result instead of
spawning PowerShell again.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@common/config/rush/.pnpmfile.cjs`:
- Around line 37-57: The diff shows duplicate conditional overrides for packages
in the pnpmfile (e.g., duplicate if-blocks checking pkg.dependencies['diff'],
['eslint'], ['lodash'] and the mirrored duplicates in pkg.devDependencies);
remove the redundant repeated checks so each package is normalized only once per
dependency block (or consolidate into a small helper loop that iterates a map of
package->version and applies it to pkg.dependencies and pkg.devDependencies),
updating the code around the existing pkg.dependencies and pkg.devDependencies
logic (references: pkg.dependencies, pkg.devDependencies, package keys 'diff',
'eslint', 'lodash', 'fast-xml-parser', 'qs') so future bumps only need a single
place to change.

In `@workspaces/ballerina/ballerina-extension/src/core/extension.ts`:
- Around line 2716-2780: The review incorrectly claims findWindowsBallerinaPath
is duplicated; however the real issue is that syncEnvironment ->
getShellEnvironment and findWindowsBallerinaPath both spawn PowerShell (each
with a 10s timeout), causing potential double startup latency; update the code
to avoid two separate PowerShell calls by consolidating registry PATH reads (or
caching the result) so findWindowsBallerinaPath reuses the environment/registry
data obtained by getShellEnvironment (or expose a shared helper that performs
the single PowerShell invocation and returns PATH entries) and adjust
syncEnvironment/getShellEnvironment to use that shared result instead of
spawning PowerShell again.

ℹ️ 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 04d9bd4 and 74102f9.

⛔ Files ignored due to path filters (2)
  • common/autoinstallers/rush-plugins/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • common/config/rush/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .trivyignore
  • common/autoinstallers/rush-plugins/package.json
  • common/config/rush/.pnpmfile.cjs
  • workspaces/ballerina/ballerina-extension/CHANGELOG.md
  • workspaces/ballerina/ballerina-extension/package.json
  • workspaces/ballerina/ballerina-extension/src/core/extension.ts

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.

5 participants