-
Notifications
You must be signed in to change notification settings - Fork 186
[feat]: Add wiki creation and update functionality #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[feat]: Add wiki creation and update functionality #374
Conversation
- Implement wiki_create_wiki tool for creating new project and code wikis - Implement wiki_update_wiki tool for updating wiki names and versions - Implement wiki_create_or_update_page tool for managing wiki page structure - Add comprehensive test coverage for all new wiki tools - Update README.md with new Wiki section and example prompts - Fix GitVersionDescriptor import from correct interface module - All 203 tests passing with 100% coverage on new functionality
@ssmith-avidxchange we will take a look. thank you. I am out for a week for VS Live but will try and get to this |
No problem, going to add some more tweaks and test a bunch more in the meantime |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #374 +/- ##
=======================================
Coverage ? 93.97%
=======================================
Files ? 13
Lines ? 879
Branches ? 154
=======================================
Hits ? 826
Misses ? 21
Partials ? 32
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Added support for creating and updating wiki pages with full content management using the Azure DevOps REST API. - Implemented automatic ETag handling for safe updates and conflict resolution. - Updated README.md to reflect recent enhancements in wiki support, including new features and usage examples. - Improved test coverage for the new wiki functionalities, ensuring robust error handling and successful page creation/update scenarios.
- Implemented tests to verify ETag retrieval from response body when not present in headers. - Added scenarios to handle missing ETag errors and update failures due to ETag mismatches. - Enhanced error handling for wiki page creation and updates, ensuring robust functionality.
- Implemented tests to handle non-Error exceptions, missing project parameters, and paths without leading slashes. - Enhanced error handling for failed GET requests and ETag retrieval during wiki page updates. - Improved test coverage for various scenarios to ensure robust functionality in the wiki tools.
@microsoft-github-policy-service agree company="AvidXchange" |
src/tools/wiki.ts
Outdated
const projectParam = project || ""; | ||
const url = `${baseUrl}/${projectParam}/_apis/wiki/wikis/${wikiIdentifier}/pages?path=${encodedPath}&api-version=7.1`; | ||
|
||
console.log(`[Wiki API] Attempting to create/update page at: ${url}`); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
…tions to clean up output.
…thub.com/ssmith-avidxchange/azure-devops-mcp into users/ssmith/wiki-create-update-features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some use cases for the create/update page tool that are working succesfully with this branch :)
Edit: For clarity, I haven't dug much into the other tools, or the test cases.
@ssmith-avidxchange this is great for adding updating pages. Love it 💖 I would like to not merge the changes to create and update the wiki itself. I don't think that is a common scenario for most users. Can you remove those two tools so we just merge the If not, I am happy to take what you put together and merge a seperate PR with just that tool. |
Yes, not a problem, after I finished I kind of thought only the "upsert" was really needed, but wasn't sure about other folks' use cases. I can get that removed and merged back up |
awesome, great!! |
…nly wiki_create_or_update_page - Removed create_wiki tool functionality - Removed update_wiki tool functionality - Kept wiki_create_or_update_page for comprehensive page content management - Removed unused imports (WikiCreateParametersV2, WikiUpdateParameters, WikiType, GitVersionDescriptor) - Updated test suite to remove 30 tests for removed tools - Maintained 100% line coverage and 97.61% branch coverage - All 291 tests passing with focused scope per @danhellem feedback
…iki_update_wiki tools - Removed wiki creation example from overview prompts - Updated Wiki tools section to remove wiki_create_wiki and wiki_update_wiki entries - Focused documentation on available wiki_create_or_update_page functionality - Maintains consistency with simplified PR scope
Not to be naggy, but could a release be made after this is merged? My team has a strong need for this functionality 😄 |
We are doing daily releases now. You can also build by source if you need it sooner |
[feat]: Add wiki page creation and update functionality
📋 Description
This PR introduces comprehensive wiki page content management to the Azure DevOps MCP Server through a new
wiki_create_or_update_page
tool. This enhancement enables users to create new wiki pages and update existing ones with full markdown content support, utilizing the Azure DevOps REST API for immediate visibility and robust conflict resolution.🚀 New Feature:
wiki_create_or_update_page
Overview
A unified, intelligent tool that handles both wiki page creation and updates seamlessly. The tool automatically detects whether a page exists and performs the appropriate operation with built-in conflict resolution.
Key Capabilities
Parameters
wikiIdentifier
path
content
project
etag
Usage Examples
🔧 Technical Implementation
REST API Integration
fetch()
instead of Git operationsETag Concurrency Control
etag
orETag
)eTag
property)Error Handling & Resilience
404
: Wiki or page not found409
: Conflict (page exists, retry with ETag)412
: Precondition Failed (ETag mismatch)500
: Server error (treat as conflict, retry with ETag)Code Quality
🧪 Testing & Quality Assurance
Test Coverage Statistics
wiki.ts
wiki.ts
wiki.ts
wiki.ts
Comprehensive Test Scenarios
Core Functionality Tests
/page
andpage
formats correctlyETag Handling Tests
etag
andETag
variants)Error Handling Tests
Edge Case Tests
Manual Testing & Validation
📁 Files Modified
Source Code Changes
src/tools/wiki.ts
:wiki_create_or_update_page
tool implementation (120+ lines)Test Suite Enhancements
test/src/tools/wiki.test.ts
:Documentation Updates
README.md
:🎯 Scope & Design Philosophy
What's Included
What's Intentionally Excluded
Design Principles Followed
🔄 PR Evolution & Scope Refinement
Initial Scope
Originally included
wiki_create_wiki
andwiki_update_wiki
tools for complete wiki management.Refined Scope (Current)
Based on maintainer feedback (@danhellem):
Changes Made:
wiki_create_wiki
tool (30 lines removed)wiki_update_wiki
tool (57 lines removed)WikiCreateParametersV2
,WikiUpdateParameters
,WikiType
,GitVersionDescriptor
)🚦 Quality Gates Passed
Code Quality
Testing
Documentation
🔗 Related Issues & Context
Addresses: Issue #258 -
create_or_update_wiki_page
feature requestCommunity Validation: @hwittenborn confirmed successful real-world usage
Maintainer Alignment: Scope refined based on @danhellem feedback for practical usability
📈 Impact & Benefits
For Users
For Project
✅ PR Checklist