Skip to content
TypeScript

fix(azure-devops): file comments name the path the diff shows (#23468)

Victor Vogelc0d279f18e2a
diff --git a/packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.test.ts b/packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.test.ts
index 8ed7f8641c8..b9b1e36a943 100644
--- a/packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.test.ts
+++ b/packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.test.ts
@@ -208,7 +208,7 @@ describe("decodeThreadsJson", () => {
});
});
- it("reads a thread pinned to a file as a review comment", () => {
+ it("reads a thread pinned to a file as a review comment on the path its diff uses", () => {
const comments = expectSuccess(
decodeThreadsJson(
asJson({
@@ -223,7 +223,7 @@ describe("decodeThreadsJson", () => {
),
);
- expect(comments[0]).toMatchObject({ kind: "review-comment", path: "/src/app.ts" });
+ expect(comments[0]).toMatchObject({ kind: "review-comment", path: "src/app.ts" });
});
it("keeps the replies under a thread, which are as much of the conversation", () => {
diff --git a/packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.ts b/packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.ts
index 1073a2f96be..b3632ef1af9 100644
--- a/packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.ts
+++ b/packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.ts
@@ -298,7 +298,7 @@ export function decodeThreadsJson(
if (Exit.isFailure(decodedThread)) continue;
const thread = decodedThread.value;
if (thread.isDeleted === true) continue;
- const path = trimmed(thread.threadContext?.filePath);
+ const path = toRepositoryPath(thread.threadContext?.filePath);
for (const comment of thread.comments ?? []) {
const publishedDate = trimmed(comment.publishedDate);
if (