Skip to content

feat: support configure ext host spawn options#3980

Merged
bytemain merged 2 commits into
mainfrom
feat/configure-exthost
Aug 30, 2024
Merged

feat: support configure ext host spawn options#3980
bytemain merged 2 commits into
mainfrom
feat/configure-exthost

Conversation

@bytemain
Copy link
Copy Markdown
Member

@bytemain bytemain commented Aug 29, 2024

Types

  • 🎉 New Features

Background or solution

Changelog

Summary by CodeRabbit

  • 新特性

    • 引入了 ExtHostSpawnOptions 接口,允许更灵活的环境变量和执行参数配置。
    • 新增 getSpawnOptions 方法,提供扩展进程选项的获取功能。
    • ICreateProcessOptions 接口中添加了 extHostSpawnOptions 属性,增强了创建进程的灵活性。
    • 更新了日志记录功能,改进了日志格式和时间戳显示。
  • 修复

    • 处理环境变量和执行参数的逻辑得到增强,支持更复杂的配置。

@railway-app
Copy link
Copy Markdown

railway-app Bot commented Aug 29, 2024

🚅 Previously deployed to Railway in the core project. Environment has been deleted.

@opensumi opensumi Bot added the 🎨 feature feature required label Aug 29, 2024
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 29, 2024

Walkthrough

此次更改引入了新的接口 ExtHostSpawnOptions,并在多个服务类中添加了 getSpawnOptions 方法,以配置扩展进程的环境变量和执行参数。修改了日志输出的格式,增强了对环境变量和执行参数的处理能力。还创建了一个新的服务类 OverrideExtensionNodeService,以自定义进程生成选项。整体上,这些更改增强了扩展的可配置性和服务的灵活性。

Changes

文件路径 更改摘要
packages/core-common/src/types/extension.ts 新增接口 ExtHostSpawnOptions,包含可选属性 envexecArgv
packages/extension/src/browser/extension-node.service.ts 移除了 ILogger 依赖,新增 getSpawnOptions 方法,返回 ExtHostSpawnOptions 的空对象。
packages/extension/src/browser/extension-worker.service.ts 新增 getSpawnOptions 方法,返回空对象,增强了类的功能。
packages/extension/src/common/extension.service.ts 新增抽象方法 getSpawnOptions,返回 ExtHostSpawnOptions,增强了可扩展性。
packages/extension/src/common/extension.ts ICreateProcessOptions 接口中新增可选属性 extHostSpawnOptions
packages/extension/src/hosted/api/vscode/ext.host.output.ts 修改日志格式,新增私有方法 label,改进日志记录功能。
packages/extension/src/node/extension.service.ts 增强环境变量和执行参数的处理,合并 options.extHostSpawnOptions 中的环境变量。
packages/startup/entry/sample-modules/index.ts 更新 SampleModuleproviders 数组,包含 AbstractNodeExtProcessService 的实现类。
packages/startup/entry/sample-modules/overrides/extension/extension-node.service.ts 新增 OverrideExtensionNodeService 类,重写 getSpawnOptions 方法以自定义环境变量。
packages/startup/entry/web/render-app.tsx 简化查询参数的处理,改进 workspaceDirextensionDevelopmentPath 参数的获取。

Sequence Diagram(s)

sequenceDiagram
    participant A as Client
    participant B as NodeExtProcessService
    participant C as OverrideExtensionNodeService

    A->>B: 请求生成进程
    B->>B: 调用 getSpawnOptions()
    B-->>A: 返回默认的 spawnOptions

    A->>C: 请求生成进程
    C->>C: 调用 getSpawnOptions()
    C-->>A: 返回自定义的 spawnOptions
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
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: 1

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 9.09091% with 20 lines in your changes missing coverage. Please review.

Project coverage is 54.85%. Comparing base (1807a2e) to head (0115027).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...extension/src/hosted/api/vscode/ext.host.output.ts 0.00% 14 Missing and 1 partial ⚠️
...es/extension/src/browser/extension-node.service.ts 0.00% 2 Missing ⚠️
.../extension/src/browser/extension-worker.service.ts 0.00% 2 Missing ⚠️
packages/extension/src/node/extension.service.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3980      +/-   ##
==========================================
- Coverage   54.86%   54.85%   -0.02%     
==========================================
  Files        1569     1569              
  Lines       95660    95680      +20     
  Branches    19613    19622       +9     
==========================================
+ Hits        52486    52487       +1     
- Misses      35852    35870      +18     
- Partials     7322     7323       +1     
Flag Coverage Δ
jsdom 50.32% <0.00%> (-0.02%) ⬇️
node 15.47% <9.09%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bytemain bytemain merged commit e16571f into main Aug 30, 2024
@bytemain bytemain deleted the feat/configure-exthost branch August 30, 2024 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 feature feature required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants