Repository navigation
fix: enhance wiki search tool to include repository path and pagePath… - #1700
Open
Dan Hellem (danhellem) wants to merge 1 commit into
Open
Dan Hellem (danhellem) wants to merge 1 commit into
Dan Hellem (danhellem) wants to merge 1 commit into
Conversation
1 task done
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation satisfies the linked issue and includes appropriate edge-case coverage.
0 open findings
What changed in this PR
Enriches wiki search results with paths consumable by the wiki tool.
Changes:
- Derives
pagePathfrom repository paths and wiki mappings. - Clarifies tool documentation.
- Adds coverage for enrichment and empty responses.
| File | Description |
|---|---|
src/tools/search.ts |
Adds wiki-relative path enrichment. |
test/src/tools/search.test.ts |
Tests enrichment and response preservation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Manoj Singaperumal (skmanoj)
approved these changes
Oct 15, 2026
Manoj Singaperumal (skmanoj)
left a comment
Member
There was a problem hiding this comment.
left nit comments and approved
| return result; | ||
| } | ||
|
|
||
| const relativePath = decodeURIComponent(result.path.slice(mappedPath.length).replace(/\.md$/i, "")); |
There was a problem hiding this comment.
decodeURIComponent can throw URIError when result.path contains malformed encoding
| type CombinedResult = { gitItem: GitItem } | { error: string }; | ||
|
|
||
| function addWikiPagePath(result: WikiSearchResult): WikiSearchResult { | ||
| if (result.pagePath || !result.path || !result.wiki?.mappedPath) { |
There was a problem hiding this comment.
should we have null check for result
if (!result || result.pagePath || !result.path || !result.wiki?.mappedPath) {
return result;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the Azure DevOps Wiki search tool by enriching search results with a wiki-relative
pagePathfor each result, improving downstream usability. It also introduces comprehensive tests to ensure the new behavior works correctly and maintains compatibility with responses that lack results.Wiki Search Result Enrichment:
addWikiPagePathinsrc/tools/search.tsto compute and attach apagePathproperty to each wiki search result, making it easier to reference wiki pages relative to their mapped paths.pagePath, and return the modified result as a stringified JSON object.SEARCH_TOOLS.search_wikitool to clarify that results include both repository paths and wiki-relativepagePathvalues.Testing Improvements:
test/src/tools/search.test.tsto verify that:pagePathto various wiki search results, including edge cases..text()and.json()fetch responses for more accurate simulation.GitHub issue number
#1695
Associated Risks
None
✅ PR Checklist
🧪 How did you test it?
Ran thru several manual tests and updated auto tests