-
Notifications
You must be signed in to change notification settings - Fork 246
Improved Error for edit gateway for Issue #363 and Bug fixing of issue #603 #648
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
Merged
Conversation
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
Signed-off-by: RAKHI DUTTA <[email protected]>
Signed-off-by: RAKHI DUTTA <[email protected]>
Signed-off-by: RAKHI DUTTA <[email protected]>
Signed-off-by: RAKHI DUTTA <[email protected]>
Signed-off-by: RAKHI DUTTA <[email protected]>
Signed-off-by: RAKHI DUTTA <[email protected]>
Signed-off-by: RAKHI DUTTA <[email protected]>
Signed-off-by: RAKHI DUTTA <[email protected]>
Closed
6 tasks
@crivetimihai , @madhav165 , @rakdutta Feature Testing Complete - works as intended/described PR Test summary
GOOD to MERGE |
crivetimihai
approved these changes
Aug 1, 2025
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.
Summary of PR #648 ("Improved Error for edit gateway for Issue #361 and Bug fixing of issue #603"):
- Refactors the admin_edit_gateway flow to return detailed JSON error responses (rather than only redirects), handling ValidationError and IntegrityError gracefully.
- Improves error handling in gateway_service.py and main.py for gateway edit and registration, including better reporting for name and URL conflicts, validation errors, and DB integrity issues.
- Updates the frontend (admin.js) to handle new response formats, show error messages, and redirect only on success.
- Adjusts unit tests to check for the new error handling and response structure.
- Addresses issues #361 (edit gateway error handling) and #603 (bug in registration with duplicate names/URLs).
Major changes:
- All gateway edit API errors (validation, DB integrity, etc.) now return specific JSON responses with status codes (400, 409, 422, 500, etc.).
- Frontend now properly displays error messages and only redirects on successful edit.
- Test coverage updated for new behaviors.
Passed make lint-web doctest test
2 tasks
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.
#363
This PR includes the following changes and enhancements related to gateway editing:
Refactored admin.py:
Updated gateway_service.py:
Enhanced admin.js:
Test Improvements:
Issue Fix – #603:
Testing Steps:
curl -v -X POST http://127.0.0.1:4444/gateways
-H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN"
-H "Content-Type: application/json"
-d '{"name":"mcp-server","url":"http://localhost:8080/sse","transport":"SSE"}' | jq
✅ Result: Successfully registered.
curl -v -X POST http://127.0.0.1:4444/gateways
-H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN"
-H "Content-Type: application/json"
-d '{"name":"mcp-server1","url":"http://localhost:8080/sse","transport":"SSE"}' | jq
❌ Response:
{
"message": "A gateway with this URL already exists",
"success": false
}
curl -v -X POST http://127.0.0.1:4444/gateways
-H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN"
-H "Content-Type: application/json"
-d '{"name":"mcp-server","url":"http://localhost:8000/sse","transport":"SSE"}' | jq
❌ Response:
{
"message": "Gateway name already exists"
}