fix(local): implement plantask backend delete#911
Open
claneo wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
fix
Check the PR title.
(Optional) Translate the PR title into Chinese.
修复 local backend 未实现 plantask 后端删除能力的问题
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
This PR makes
adk/backend/local.Localimplementplantask.Backendby adding the missingDelete(ctx, *plantask.DeleteRequest)method.Localalready implementsfilesystem.Backend, butplantask.Backendadditionally requiresDeletefor task deletion and cleanup when all tasks are completed. Without this method,*local.Localcannot be used directly with theplantaskmiddleware.The implementation removes the target file via the local filesystem and returns contextual errors on failure. Tests now include compile-time interface assertions for both
filesystem.Backendandplantask.Backend, plus delete success and missing-file error cases.zh(optional):
本 PR 为
adk/backend/local.Local补充缺失的Delete(ctx, *plantask.DeleteRequest)方法,使其实现plantask.Backend。Local已经实现了filesystem.Backend,但plantask.Backend额外要求Delete,用于任务删除以及所有任务完成后的清理。缺少该方法时,*local.Local无法直接用于plantaskmiddleware。本实现通过本地文件系统删除目标文件,并在失败时返回带路径上下文的错误。测试中新增了
filesystem.Backend和plantask.Backend的编译期接口断言,以及删除成功和文件不存在的错误场景。(Optional) Which issue(s) this PR fixes:
Fixes #908
(optional) The PR that updates user documentation:
N/A