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

Add support for patching extensions #6031

Merged
merged 2 commits into from
Jun 20, 2024
Merged

Conversation

JohnNiang
Copy link
Member

@JohnNiang JohnNiang commented Jun 3, 2024

What type of PR is this?

/kind feature
/area core
/milestone 2.17.x

What this PR does / why we need it:

This PR adds patch method for all extensions API.

Patch example:

http -a admin:admin PATCH http://localhost:8090/apis/plugin.halo.run/v1alpha1/plugins/app-store-integration \
  Content-Type:application/json-patch+json \
  --raw='[{"op": "replace", "path": "/spec/enabled", "value": false}]'

Which issue(s) this PR fixes:

Fixes #2311

Does this PR introduce a user-facing change?

为自定义模型添加 patch 类型的接口支持。

@f2c-ci-robot f2c-ci-robot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 3, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.17.x milestone Jun 3, 2024
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Jun 3, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from guqing and LIlGG June 3, 2024 09:06
Copy link

sonarqubecloud bot commented Jun 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.2% Duplication on New Code

See analysis details on SonarCloud

@JohnNiang JohnNiang changed the title WIP: Implement PATCH method for extension APIs Add support for patching extensions Jun 19, 2024
@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 19, 2024
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 46.72131% with 65 lines in your changes missing coverage. Please review.

Project coverage is 56.36%. Comparing base (5fdf6c0) to head (b80dd12).
Report is 241 commits behind head on main.

Files Patch % Lines
.../java/run/halo/app/extension/router/JsonPatch.java 0.00% 47 Missing ⚠️
...c/main/java/run/halo/app/config/SwaggerConfig.java 0.00% 9 Missing ⚠️
...alo/app/extension/ReactiveExtensionClientImpl.java 71.42% 4 Missing and 2 partials ⚠️
...lo/app/extension/router/ExtensionPatchHandler.java 92.85% 2 Missing ⚠️
...ain/java/run/halo/app/extension/JsonExtension.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6031      +/-   ##
============================================
- Coverage     56.91%   56.36%   -0.55%     
- Complexity     3319     3570     +251     
============================================
  Files           587      627      +40     
  Lines         18968    21132    +2164     
  Branches       1401     1491      +90     
============================================
+ Hits          10795    11912    +1117     
- Misses         7594     8614    +1020     
- Partials        579      606      +27     

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

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 Jun 20, 2024
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

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

/approve

Copy link

f2c-ci-robot bot commented Jun 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing

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 Jun 20, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit c0ac2f3 into halo-dev:main Jun 20, 2024
7 checks passed
@JohnNiang JohnNiang deleted the feat/patch branch June 20, 2024 15:16
@ruibaby ruibaby modified the milestones: 2.17.x, 2.17.0 Jun 21, 2024
f2c-ci-robot bot pushed a commit that referenced this pull request Jun 24, 2024
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

#### What this PR does / why we need it:

使用新的 [patch](#6031) 接口重构附件的移动功能。

#### Special notes for your reviewer:

1. 测试附件移动至其他分组的功能是否正常。
2. 测试删除附件分组,选择 **删除并将附件移动至未分组** 选项,观察删除分组之后,其中的附件是否已经移动到未分组。

#### Does this PR introduce a user-facing change?

```release-note
None
```
@f2c-ci-robot f2c-ci-robot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 26, 2024
@f2c-ci-robot f2c-ci-robot bot removed the release-note-none Denotes a PR that doesn't merit a release note. label Jun 26, 2024
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.

新增 PATCH 接口以部分更新自定义模型
3 participants