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

feat: support running plugins from JAR in development mode #4589

Merged
merged 6 commits into from
Sep 27, 2023

Conversation

guqing
Copy link
Member

@guqing guqing commented Sep 11, 2023

What type of PR is this?

/kind feature
/milestone 2.10.x
/area core

What this PR does / why we need it:

支持在开发模式下通过 JAR 运行插件

从此版本开始 BasePlugin 的子类建议使用 BasePlugin(PluginContext context) 构造函数,而不要使用之前的 BasePlugin(PluginWrapper wrapper) 构造函数。BasePlugin(PluginWrapper wrapper) 构造函数将计划在后续版本移除 ,当移除构造函数后不再将 PluginWrapper 暴露给插件使用,它只应该在 halo core 使用。

how to test it?

  1. 测试开发模式下配置的 halo.plugin.fixed-plugin-path 插件是否正确运行
  2. 测试开发模式下通过 JAR 包安装插件是否正确运行
  3. 测试生产模式下是否能通过项目目录的方式运行插件,期望是生产模式不可以运行开发模式的插件
  4. 测试开发模式和生产模式的插件卸载功能是否正确

Which issue(s) this PR fixes:

Fixes #2908

Does this PR introduce a user-facing change?

支持在开发模式下通过 JAR 运行插件

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Sep 11, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.10.x milestone Sep 11, 2023
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Sep 11, 2023
@f2c-ci-robot f2c-ci-robot bot requested review from ruibaby and wan92hen September 11, 2023 07:12
@guqing guqing force-pushed the feature/plugin-runtime branch from 57d8662 to af28b58 Compare September 11, 2023 07:16
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #4589 (5881da9) into main (7de97e4) will decrease coverage by 0.09%.
The diff coverage is 12.12%.

@@             Coverage Diff              @@
##               main    #4589      +/-   ##
============================================
- Coverage     61.11%   61.02%   -0.09%     
- Complexity     2570     2571       +1     
============================================
  Files           374      375       +1     
  Lines         13171    13181      +10     
  Branches        938      941       +3     
============================================
- Hits           8049     8044       -5     
- Misses         4669     4684      +15     
  Partials        453      453              
Files Changed Coverage Δ
...in/java/run/halo/app/plugin/BasePluginFactory.java 9.52% <0.00%> (-2.25%) ⬇️
...in/java/run/halo/app/plugin/HaloPluginManager.java 10.52% <0.00%> (-0.21%) ⬇️
...in/java/run/halo/app/plugin/HaloPluginWrapper.java 0.00% <0.00%> (ø)
.../halo/app/plugin/PluginApplicationInitializer.java 8.33% <0.00%> (-0.40%) ⬇️
...va/run/halo/app/plugin/SpringExtensionFactory.java 4.87% <5.88%> (-7.20%) ⬇️
...a/run/halo/app/plugin/PluginAutoConfiguration.java 45.34% <23.52%> (-0.44%) ⬇️
...pp/core/extension/reconciler/PluginReconciler.java 54.56% <27.27%> (-0.81%) ⬇️

@guqing
Copy link
Member Author

guqing commented Sep 15, 2023

/cc @halo-dev/sig-halo

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 15, 2023

@guqing: GitHub didn't allow me to request PR reviews from the following users: halo-dev/sig-halo.

Note that only halo-dev members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @halo-dev/sig-halo

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/lgtm

功能符合预期。

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2023
@guqing guqing requested review from JohnNiang and LIlGG September 18, 2023 09:43
@guqing
Copy link
Member Author

guqing commented Sep 18, 2023

/ping @halo-dev/sig-halo

Copy link
Member

@LIlGG LIlGG left a comment

Choose a reason for hiding this comment

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

/lgtm

@guqing
Copy link
Member Author

guqing commented Sep 26, 2023

/ping @halo-dev/sig-halo

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang, LIlGG

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 27, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 1f0cfc1 into halo-dev:main Sep 27, 2023
2 checks passed
@JohnNiang JohnNiang modified the milestones: 2.10.x, 2.10.0 Sep 27, 2023
@guqing guqing deleted the feature/plugin-runtime branch September 27, 2023 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

当以开发模式启动halo项目时 plugins-root 下的插件没有启动
4 participants