Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(azure-devops): Mentioning me lists only work items that mention you #48224

Openjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/48224/headopened View on GitHub

Showing 2 changed files with 58 additions and 5 deletions.

x
0 of 2 viewed, 2 left
56 additions and 3 deletionspackages/source-control-azure-devops/src/server/AzureDevOpsIssueTracker.test.tsModified
View file
@@ -333,10 +333,9 @@
expect(bodies[1]).toBe(bodies[0]);
expect(bodies[0]).toContain("AND [System.State] NOT IN ('shipped')");
const { query } = JSON.parse(bodies[0]!) as { query: string };
- // Mentions cannot be asked for over REST, so the filter sends no clause for them.
- expect(query).not.toContain("@RecentMentions");
expect(query).toContain(
- " AND [System.Tags] CONTAINS 'o''hare' AND [System.AssignedTo] = 'theo@acme.test'" +
+ " AND [System.Id] IN (@RecentMentions)" +
+ " AND [System.Tags] CONTAINS 'o''hare' AND [System.AssignedTo] = 'theo@acme.test'" +
" AND ([System.CreatedDate] < '2026-07-01T00:00:00Z' OR ([System.CreatedDate] = '2026-07-01T00:00:00Z' AND [System.Id] < 7))" +
" ORDER BY [System.CreatedDate] DESC, [System.Id] DESC",
@@ -586,4 +585,58 @@
expect(candidates.assignees.map((assignee) => assignee.login)).toEqual(["octo@acme.test"]);
}),
+​
+ it.effect("does not list a work item that mentions nobody under Mentioning me", () =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const queries: string[] = [];
+ const api = yield* AzureDevOpsIssueTracker.make.pipe(
+ Effect.provide(
+ Layer.mock(AzureDevOpsCli.AzureDevOpsCli)({
+ execute: ({ args }) => {
+ const resource = args[args.indexOf("--resource") + 1];
+ if (resource !== "wiql" && resource !== "workitemsbatch") {
+ return Effect.succeed(TestSourceControlHost.processOutput(answer(args)));