-
-
Notifications
You must be signed in to change notification settings - Fork 10k
Refactor plugin reconciliation to ensure only one update on plugin #5148
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
Conversation
e50ba7e
to
17c5369
Compare
/ping @halo-dev/sig-halo |
应该是要继续限制一下生产模式下如果运行的插件不在 plugins-root 中不允许运行吧,也就是要同时使用开发模式和生产模式的插件配置必须要是开发模式 |
application/src/main/java/run/halo/app/core/extension/reconciler/PluginReconciler.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/core/extension/reconciler/PluginReconciler.java
Show resolved
Hide resolved
application/src/main/java/run/halo/app/core/extension/reconciler/PluginReconciler.java
Outdated
Show resolved
Hide resolved
17c5369
to
d454eca
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5148 +/- ##
============================================
+ Coverage 55.91% 56.41% +0.49%
+ Complexity 3032 3006 -26
============================================
Files 524 525 +1
Lines 17826 17606 -220
Branches 1329 1303 -26
============================================
- Hits 9968 9933 -35
+ Misses 7309 7134 -175
+ Partials 549 539 -10 ☔ View full report in Codecov by Sentry. |
如果配置了 |
是的,之前是这样 |
d454eca
to
af46ca0
Compare
Hi @guqing ,已修改,请看测试用例: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
经测试在 mac 目前没有发现问题,兼容性 ok,windows 没有试过没环境
/milestone 2.12.x |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @guqing ,我这里有一个不确定的小问题:在 Plugin Reconciler 中创建/更新的 setting,将会在插件启动的时候又会初始化一遍,而且是强制更新。即使我为 setting 添加 annotation:delete-stage=uninstall 似乎也会被覆盖掉。不知道之前是如何实现的呢? |
/unhold The latest issue was resolved in e05640f. /ping @halo-dev/sig-halo |
e05640f
to
fa8319f
Compare
Hi @guqing ,已彻底修复无法找到 |
好的 我试试 |
@JohnNiang 我在开发模式修改了 plugin.yaml 的一些信息比如 description 后 reloadPlugin,插件的信息没有变更还是旧的 |
目前似乎不只是开发环境修改 plugin.yaml 失效,升级后似乎也没有正常更新 plugin 资源。 |
我是尝试的开发环境发现的问题,然后切到 main 是正确的 |
fa8319f
to
dbc6738
Compare
确实是因为当前 PR 未考虑到升级和重载问题,现在已修复。 |
/ping @halo-dev/sig-halo |
在开发环境下,无法正常使用
复现步骤:
在 2.11 下没有此问题。 |
Hi @ruibaby ,目前我通过配置 halo.plugin.fixed-plugin-path 是可以正常 reload 的。关于使用 Gradle 插件启用 Halo 并 reload 我还需要测试一下。 |
Signed-off-by: John Niang <johnniang@foxmail.com>
dbc6738
to
87a8d64
Compare
Hi @ruibaby ,确实是因为 reload 和 upadte 插件的时候强制覆盖了 annotations 和 labels,导致修改了插件的运行模式(开发模式 -> 生产模式),最终无法正确查找到 plugin.yaml。最新的提交已修复该问题。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经测试过:
- gradle haloServer task
- gradle reload task
- 修改配置文件
没有再出现过上述问题。
/lgtm
#### What type of PR is this? /kind improvement /area core /milestone 2.12.x #### What this PR does / why we need it: This PR reverts changes in PR <#4023>, mainly thanks to PR <#5148>. We don't need to refresh the plugin wrapper on every startup, because we entirely disable the plugin in plugin manager when disabling plugin at console. #### Which issue(s) this PR fixes: Fixes #4016 #### Does this PR introduce a user-facing change? ```release-note None ```
What type of PR is this?
/kind improvement
/area core
What this PR does / why we need it:
This PR mainly refactors plugin reconciliation to ensure only one update on plugin and make the logic clearer.
The next step is to refactor plugin manager to make plugin resources can receive the state changes of the plugin in plugin manager.
It works very well in Windows environment.
See #5129 for more.
Which issue(s) this PR fixes:
Fixes #5129
Special notes for your reviewer:
Does this PR introduce a user-facing change?