Skip to content

Build #106: 支持单独更新 file metadata - #108

Merged
nil4u merged 1 commit into
developfrom
106-file-metadata/build
Aug 25, 2026
Merged

nil4u merged 1 commit into
developfrom
106-file-metadata/build

Conversation

@nil4u

@nil4u nil4u commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Source issue

Summary

  • 新增 PUT /v1/files/{fileId}/metadata,请求体仅需提供 metadata。
  • 复用现有文件查询、鉴权与更新链路,文件不存在时保持既有 404 处理。
  • metadata 更新不递增内容版本,也不修改文件内容、文件名、description、cities 或 tags。
  • 新增 metadata 更新事件 scope,继续发送既有 FILE_UPDATED 事件。
  • 普通文件和目录均支持该接口;未偏离 issue 方案。

Validation

  • git diff --check(通过)
  • 新增 Controller 测试:普通文件成功、目录成功、缺少 metadata、文件不存在。
  • 新增 Repo 测试:仅 metadata 发生变化,其他字段及版本保持不变。
  • 新增 Service 测试:更新事件为 FILE_UPDATED 且 scope=metadata。
  • 未运行 JUnit:当前执行环境未安装 Java 和 Maven(java: command not found、mvn: command not found)。

@nil4u nil4u added the mr-by::build PR or MR was created by the build action label Aug 25, 2026 — with agentrix-ai
@Jiakaic

Jiakaic commented Aug 25, 2026

Copy link
Copy Markdown
Member

@claude 检查提交的代码,使用中文回复

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a16488be8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1300 to +1303
OpenAIFile existingFile = fileService.getFile(fileId);
if(existingFile == null) {
throw new FileNotFoundException(fileId);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject metadata updates for resource nodes

When fileId identifies a resource node, this check accepts it and the endpoint overwrites its metadata. Resource creation deliberately fixes metadata to {}, and the adjacent description, cities, and tags update handlers reject resources; this also exceeds the stated ordinary-file-and-directory scope. Add the equivalent NodeType.RESOURCE guard before constructing the update operation.

Useful? React with 👍 / 👎.

@nil4u
nil4u merged commit adb345f into develop Aug 25, 2026
6 checks passed
@nil4u
nil4u deleted the 106-file-metadata/build branch August 25, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mr-by::build PR or MR was created by the build action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants