Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: merge plugin config when load because of plugin preset #272

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

noahziheng
Copy link
Member

之前在 Scan 阶段预处理的 pluginConfig,存在边界 case:

  • 插件合集 a 内 default 启用了插件 b
  • app 在 prod 环境未启用插件合集 a
  • 但预处理过程中把全部 default 合并,全部 prod 合并
  • 预期应为 prod 是 a 禁用,所以不涉及 b 的工作
  • 但实际出现总和 default 中 b 启用,prod 中 a 禁用,合并结果中 b 仍被启用

本 PR 调整了 Scanner & Loader 的插件配置部分逻辑:

  • 将 pluginConfig 字段分拆到 refMap 和 extraPluginConfig(扫描时指定的);
  • load 阶段以 ref(插件/应用)为单位,每层按环境合并插件配置;
  • 用上面按环境合并的配置排序、加载 itemList

@noahziheng noahziheng self-assigned this Jan 24, 2024
@noahziheng noahziheng force-pushed the refactor/plugin-preset-config-merge branch from fee397b to 7c664d1 Compare January 24, 2024 11:46
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (a2e5f6d) 91.38% compared to head (5d50207) 91.34%.

Files Patch % Lines
src/configuration/index.ts 57.14% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
- Coverage   91.38%   91.34%   -0.05%     
==========================================
  Files          49       49              
  Lines        1196     1202       +6     
  Branches      218      218              
==========================================
+ Hits         1093     1098       +5     
- Misses        103      104       +1     

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

@noahziheng noahziheng force-pushed the refactor/plugin-preset-config-merge branch from 7c664d1 to 734b58b Compare January 24, 2024 11:50
@noahziheng noahziheng force-pushed the refactor/plugin-preset-config-merge branch from 734b58b to 5d50207 Compare January 24, 2024 11:55
@JerrysShan
Copy link
Collaborator

标题修改下吧, fix

@noahziheng noahziheng changed the title refactor: merge plugin config when load because of plugin preset fix: merge plugin config when load because of plugin preset Jan 25, 2024
@noahziheng noahziheng merged commit 4435a71 into master Jan 29, 2024
6 checks passed
@noahziheng noahziheng deleted the refactor/plugin-preset-config-merge branch January 29, 2024 07:11
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.

3 participants