Skip to content

fix(workspace): qualify combined diffs by repository - #946

Open
rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/workspace-qualify-multi-repo-diffs
Open

rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/workspace-qualify-multi-repo-diffs

Conversation

@rudycelekli

Copy link
Copy Markdown

What changed

The workspace status list names each file relative to the whole workspace. Combined diffs instead concatenated Git patches whose paths were relative to each repository. When two repositories changed the same file name, the chat panel could show the first repository’s patch for both rows.

The platform and runner pass Git the relevant workspace directory as the source and destination prefix in combined diffs. This lets each file in the status list find its own patch.

Scope

  • Platform core / API / runner
  • Chat workspace changes

Compatibility

Combined diffs under nested workspaces now use workspace-root paths. Root workspace diffs and requests for one file keep their previous headers. Remote workspaces pick up the fix when the runner is updated.

Validation

  • The new Go baseline test created two repositories, changed a README in each, and reproduced colliding headers.
  • The platform two-repository test, the runner equivalent prefix check, and the existing workspace browsing test passed.
  • All 16 chat changes and changes-panel tests passed. The new JS regression verifies the two README rows use the correct repository's hunk.
  • git diff --check passed. The full platform and public browser suites were not run.

Safety

  • I did not include credentials, internal endpoints, production data, or organization-specific infrastructure.
  • I preserved user files and unrelated changes.

@Yanami-2K Yanami-2K left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

核对了 internal/httpapi/run_workspace.go 和 internal/runner/workspace.go 两处对称的改动:只有在取合并 diff(raw 为空)且仓库不在工作区根目录时,才用 --src-prefix / --dst-prefix 给路径加上仓库目录前缀;单文件请求和根工作区的输出保持不变。Go 测试用两个真实仓库验证了加前缀后的文件头,以及单文件 diff 仍是仓库相对路径且不会串仓库;前端测试验证了两个同名 README 各自对应自己仓库的 hunk。远程工作区要等 runner 升级后才生效,描述里已经写明。提醒:#947 也改了 internal/runner/workspace.go;本 PR 只跑了开源扫描,合入前请触发 platform CI。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants