Skip to content

Commit 95b097d

Browse files
author
Krishna Prasath D
committed
test and documentation updates
1 parent dd3ad9c commit 95b097d

2 files changed

Lines changed: 37 additions & 37 deletions

File tree

docs/TOOLSET.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ Create a new branch in the repository.
277277

278278
### mcp_ado_repo_search_commits
279279

280-
Search for commits in a repository with comprehensive filtering capabilities.
280+
Search for commits across projects and repositories with comprehensive filtering capabilities.
281281

282-
- **Required**: `project`, `repository`
283-
- **Optional**: `author`, `authorEmail`, `commitIds`, `committer`, `committerEmail`, `fromCommit`, `fromDate`, `historySimplificationMode`, `includeLinks`, `includeWorkItems`, `searchText`, `skip`, `toCommit`, `toDate`, `top`, `version`, `versionType`
282+
- **Required**: `searchText`
283+
- **Optional**: `project`, `repository`, `branch`, `author`, `commitStartDate`, `commitEndDate`, `orderBy`, `includeFacets`, `skip`, `top`
284284

285285
### mcp_ado_repo_list_pull_requests_by_repo_or_project
286286

test/src/tools/repositories.test.ts

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5992,19 +5992,19 @@ describe("repos tools", () => {
59925992
results: [
59935993
{
59945994
commitId: "abc123",
5995-
commitTitle: "Fix authentication bug",
5996-
commitDescription: "Fixed null pointer in auth module",
5997-
authorName: "dpaquette",
5998-
repositoryName: "MyRepo",
5999-
projectName: "MyProject",
5995+
commitTitle: "test commit title one",
5996+
commitDescription: "test commit description one",
5997+
authorName: "test-author-1",
5998+
repositoryName: "test-repo",
5999+
projectName: "test-project",
60006000
},
60016001
{
60026002
commitId: "def456",
6003-
commitTitle: "Add feature flag support",
6004-
commitDescription: "Added feature flag infrastructure",
6005-
authorName: "krid",
6006-
repositoryName: "MyRepo",
6007-
projectName: "MyProject",
6003+
commitTitle: "test commit title two",
6004+
commitDescription: "test commit description two",
6005+
authorName: "test-author-2",
6006+
repositoryName: "test-repo",
6007+
projectName: "test-project",
60086008
},
60096009
],
60106010
};
@@ -6054,53 +6054,53 @@ describe("repos tools", () => {
60546054
const handler = getHandler();
60556055

60566056
// Zod transform converts string → string[] before handler is called; pass post-transform value
6057-
await handler({ searchText: "auth", project: ["MyProject"], skip: 0, top: 10, includeFacets: false });
6057+
await handler({ searchText: "test search", project: ["test-project"], skip: 0, top: 10, includeFacets: false });
60586058

60596059
const body = JSON.parse((mockFetch.mock.calls[0][1] as { body: string }).body);
6060-
expect(body.filters.projectName).toEqual(["MyProject"]);
6060+
expect(body.filters.projectName).toEqual(["test-project"]);
60616061
});
60626062

60636063
it("should send projectName filter when project is provided as array", async () => {
60646064
const mockFetch = setupFetchMock(true, mockSearchResponse);
60656065
const handler = getHandler();
60666066

6067-
await handler({ searchText: "auth", project: ["Project1", "Project2"], skip: 0, top: 10, includeFacets: false });
6067+
await handler({ searchText: "test search", project: ["test-project-1", "test-project-2"], skip: 0, top: 10, includeFacets: false });
60686068

60696069
const body = JSON.parse((mockFetch.mock.calls[0][1] as { body: string }).body);
6070-
expect(body.filters.projectName).toEqual(["Project1", "Project2"]);
6070+
expect(body.filters.projectName).toEqual(["test-project-1", "test-project-2"]);
60716071
});
60726072

60736073
it("should send repositoryName filter for multiple repos", async () => {
60746074
const mockFetch = setupFetchMock(true, mockSearchResponse);
60756075
const handler = getHandler();
60766076

60776077
await handler({
6078-
searchText: "refactor",
6079-
project: ["AzureDevOps"],
6080-
repository: ["AzureDevOps", "azure-devops-remote-mcp"],
6078+
searchText: "test search",
6079+
project: ["test-project"],
6080+
repository: ["test-repo-1", "test-repo-2"],
60816081
skip: 0,
60826082
top: 10,
60836083
includeFacets: false,
60846084
});
60856085

60866086
const body = JSON.parse((mockFetch.mock.calls[0][1] as { body: string }).body);
6087-
expect(body.filters.repositoryName).toEqual(["AzureDevOps", "azure-devops-remote-mcp"]);
6087+
expect(body.filters.repositoryName).toEqual(["test-repo-1", "test-repo-2"]);
60886088
});
60896089

60906090
it("should send authorName filter for multiple authors", async () => {
60916091
const mockFetch = setupFetchMock(true, mockSearchResponse);
60926092
const handler = getHandler();
60936093

60946094
await handler({
6095-
searchText: "update",
6096-
author: ["dpaquette", "krid"],
6095+
searchText: "test search",
6096+
author: ["test-author-1", "test-author-2"],
60976097
skip: 0,
60986098
top: 10,
60996099
includeFacets: false,
61006100
});
61016101

61026102
const body = JSON.parse((mockFetch.mock.calls[0][1] as { body: string }).body);
6103-
expect(body.filters.authorName).toEqual(["dpaquette", "krid"]);
6103+
expect(body.filters.authorName).toEqual(["test-author-1", "test-author-2"]);
61046104
});
61056105

61066106
it("should send branchName filter", async () => {
@@ -6193,11 +6193,11 @@ describe("repos tools", () => {
61936193
const handler = getHandler();
61946194

61956195
await handler({
6196-
searchText: "api",
6197-
project: ["AzureDevOps"],
6198-
repository: ["AzureDevOps", "azure-devops-remote-mcp"],
6199-
branch: ["main"],
6200-
author: ["dpaquette", "krid"],
6196+
searchText: "test search",
6197+
project: ["test-project"],
6198+
repository: ["test-repo-1", "test-repo-2"],
6199+
branch: ["test-branch-1"],
6200+
author: ["test-author-1", "test-author-2"],
62016201
commitStartDate: "2024-01-01",
62026202
commitEndDate: "2025-12-31T23:59:59",
62036203
orderBy: "DESC",
@@ -6207,11 +6207,11 @@ describe("repos tools", () => {
62076207
});
62086208

62096209
const body = JSON.parse((mockFetch.mock.calls[0][1] as { body: string }).body);
6210-
expect(body.searchText).toBe("api");
6211-
expect(body.filters.projectName).toEqual(["AzureDevOps"]);
6212-
expect(body.filters.repositoryName).toEqual(["AzureDevOps", "azure-devops-remote-mcp"]);
6213-
expect(body.filters.branchName).toEqual(["main"]);
6214-
expect(body.filters.authorName).toEqual(["dpaquette", "krid"]);
6210+
expect(body.searchText).toBe("test search");
6211+
expect(body.filters.projectName).toEqual(["test-project"]);
6212+
expect(body.filters.repositoryName).toEqual(["test-repo-1", "test-repo-2"]);
6213+
expect(body.filters.branchName).toEqual(["test-branch-1"]);
6214+
expect(body.filters.authorName).toEqual(["test-author-1", "test-author-2"]);
62156215
expect(body.filters.commitStartDate).toEqual(["2024-01-01"]);
62166216
expect(body.filters.commitEndDate).toEqual(["2025-12-31T23:59:59"]);
62176217
expect(body.$orderBy).toEqual([{ field: "commitDate", sortOrder: "DESC" }]);
@@ -7916,8 +7916,8 @@ describe("repos tools", () => {
79167916
global.fetch = mockFetch;
79177917

79187918
await handler({
7919-
searchText: "authentication",
7920-
author: ["john@example.com"],
7919+
searchText: "test search",
7920+
author: ["test-author@example.com"],
79217921
commitStartDate: "2023-01-01",
79227922
commitEndDate: "2023-12-31T23:59:59",
79237923
skip: 0,
@@ -7926,7 +7926,7 @@ describe("repos tools", () => {
79267926
});
79277927

79287928
const body = JSON.parse((mockFetch.mock.calls[0][1] as { body: string }).body);
7929-
expect(body.filters.authorName).toEqual(["john@example.com"]);
7929+
expect(body.filters.authorName).toEqual(["test-author@example.com"]);
79307930
expect(body.filters.commitStartDate).toEqual(["2023-01-01"]);
79317931
expect(body.filters.commitEndDate).toEqual(["2023-12-31T23:59:59"]);
79327932
});

0 commit comments

Comments
 (0)