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: optional plugin dependencies not working correctly #7094

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

guqing
Copy link
Member

@guqing guqing commented Nov 29, 2024

What type of PR is this?

/kind bug
/area core
/milestone 2.20.x

What this PR does / why we need it:

修复可选插件依赖功能无法正常工作的问题

Special notes for your reviewer:

使用以下两个插件测试可选依赖:

测试插件集合.zip

使用以下测试用例进行测试:

测试用例1:plugin-feed 插件提供 RSS 扩展功能

  • 前置条件:
    安装并启用 plugin-feed 插件。
  • 操作步骤:
    访问 http://localhost:8090/feed/rss.xml
  • 期望结果:
    返回 plugin-feed 提供的 RSS 内容。

测试用例 2: plugin-moments 扩展了 plugin-feed 的 RSS 功能(依赖于 plugin-feed)

  • 前置条件:
    安装并启用 plugin-feedplugin-moments 插件。
  • 操作步骤:
    访问 http://localhost:8090/feed/moments/rss.xml
  • 期望结果:
    返回 plugin-moments 提供的 RSS 内容。

测试用例 3: plugin-feed 启用时安装 plugin-moments

  • 前置条件:
    启用 plugin-feed 插件。
  • 操作步骤:
    1. 安装 plugin-moments 插件。
    2. 访问 http://localhost:8090/feed/moments/rss.xml
  • 期望结果:
    plugin-moments 提供的 RSS 路由可访问,并返回正确内容。

测试用例 4: plugin-feed 未启用时安装 plugin-moments

  • 前置条件:
    未安装或未启用 plugin-feed 插件。
  • 操作步骤:
    1. 安装并启用 plugin-moments 插件。
    2. 访问 http://localhost:8090/feed/moments/rss.xml
  • 期望结果:
    • plugin-moments 的 RSS 路由不可访问,返回 404。
    • plugin-moments 的其他功能正常运行。

测试用例 5: plugin-moments 启用后安装 plugin-feed

  • 前置条件:
    已安装并启用 plugin-moments 插件。
  • 操作步骤:
    1. 安装并启用 plugin-feed 插件。
    2. 访问 http://localhost:8090/feed/moments/rss.xml
  • 期望结果:
    plugin-moments 提供的 RSS 路由可访问,并返回正确内容。

测试用例 6: 停止 plugin-feed 后验证 RSS 路由

  • 前置条件:
    已启用 plugin-feedplugin-moments 插件。
  • 操作步骤:
    1. 停止 plugin-feed 插件。
    2. 访问 http://localhost:8090/feed/moments/rss.xml
  • 期望结果:
    • plugin-feed 停止成功。
    • plugin-moments 提供的 RSS 路由不可访问,返回 404。

测试用例 7: 重启 Halo 后验证可选依赖插件的启动顺序

  • 前置条件:
    已启用 plugin-feedplugin-moments 插件。
  • 操作步骤:
    1. 重启 Halo 服务。
    2. 访问 http://localhost:8090/feed/moments/rss.xml
  • 期望结果:
    • plugin-moments 提供的 RSS 路由始终可访问

测试用例 8: 必选依赖插件验证

  • 场景 1: 安装 seo 插件时未安装应用市场

    • 前置条件:
      未安装 app-store-integration 插件。
    • 操作步骤:
      安装 plugin-seo 插件。
    • 期望结果:
      提示需要先安装 app-store-integration 插件。
  • 场景 2: 停止应用市场插件时 seo 插件仍启用

    • 前置条件:
      已启用 app-store-integrationplugin-seo 插件。
    • 操作步骤:
      停止 app-store-integration 插件。
    • 期望结果:
      提示需要先停止 plugin-seo 插件。

Does this PR introduce a user-facing change?

修复可选插件依赖功能无法正常工作的问题

@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/bug Categorizes issue or PR as related to a bug. labels Nov 29, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.20.x milestone Nov 29, 2024
@f2c-ci-robot f2c-ci-robot bot requested a review from JohnNiang November 29, 2024 10:06
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Nov 29, 2024
@f2c-ci-robot f2c-ci-robot bot requested a review from LIlGG November 29, 2024 10:06
@guqing guqing requested a review from ruibaby November 29, 2024 10:07
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 63.73626% with 33 lines in your changes missing coverage. Please review.

Project coverage is 57.20%. Comparing base (eff73dc) to head (c825ab7).
Report is 68 commits behind head on main.

Files with missing lines Patch % Lines
.../plugin/extensionpoint/DefaultExtensionGetter.java 30.00% 13 Missing and 1 partial ⚠️
...run/halo/app/core/reconciler/PluginReconciler.java 52.17% 10 Missing and 1 partial ⚠️
...in/java/run/halo/app/plugin/PluginServiceImpl.java 57.89% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7094      +/-   ##
============================================
+ Coverage     56.99%   57.20%   +0.20%     
- Complexity     3999     4033      +34     
============================================
  Files           714      714              
  Lines         24110    24266     +156     
  Branches       1585     1596      +11     
============================================
+ Hits          13742    13881     +139     
- Misses         9756     9767      +11     
- Partials        612      618       +6     

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

@guqing guqing force-pushed the fix/optional-plugin-dependency branch 3 times, most recently from fa9ea61 to 7b391ef Compare December 3, 2024 04:26
@guqing guqing force-pushed the fix/optional-plugin-dependency branch from 7b391ef to c825ab7 Compare December 3, 2024 04:52
@f2c-ci-robot f2c-ci-robot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 4, 2024
@f2c-ci-robot f2c-ci-robot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 4, 2024
@guqing guqing requested a review from JohnNiang December 4, 2024 03:13
Copy link

sonarqubecloud bot commented Dec 4, 2024

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 f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2024
Copy link

f2c-ci-robot bot commented Dec 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

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 Dec 4, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit fef06ed into halo-dev:main Dec 4, 2024
9 checks passed
@guqing guqing deleted the fix/optional-plugin-dependency branch December 4, 2024 07:15
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/bug Categorizes issue or PR as related to a bug. 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.

2 participants