feat: allow reassigning a gateway's team (and its federated entities) from the edit form#5794
Draft
hirapHoriuchi wants to merge 1 commit into
Draft
feat: allow reassigning a gateway's team (and its federated entities) from the edit form#5794hirapHoriuchi wants to merge 1 commit into
hirapHoriuchi wants to merge 1 commit into
Conversation
Add a team selector to the MCP server (gateway) edit form and propagate team changes to the gateway's federated entities. - UI mirrors the virtual server selector: owned teams only, empty placeholder to avoid implicit moves, team_id sent only for team visibility, submission blocked with an accessible message otherwise. - On team reassignment, propagate the new team_id to child tools, resources and prompts that inherited the old team, preserving per-item overrides (mirrors the existing visibility propagation). - Run the slug/URL duplicate checks against the destination team and validate destination-team ownership before applying the change. - Adds deny-path and propagation regression tests. Signed-off-by: hirapHoriuchi <yuta.hira-p0119@docomo.ne.jp>
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.
✨ Feature / Enhancement PR
🔗 Epic / Issue
Closes #5792
🚀 Summary (1-2 sentences)
Adds a team selector to the MCP server (gateway) edit form and makes team reassignment consistent by propagating the new team to the gateway's federated tools/resources/prompts. Mirrors the virtual server selector in #5791, plus the backend propagation gateways need.
❓ Design question for maintainers (please confirm before merge)
When a gateway's team changes, this PR propagates the new
team_idto child tools/resources/prompts that inherited the old team, preserving per-item overrides (mirroring how visibility already propagates). Is that the desired behavior, or should children be left in place and moved individually? Happy to change the approach based on your preference — that's why this is a draft.📏 Reviewability
triageNotes:
What it does
UI (mirrors the virtual server selector): owned-teams-only dropdown, empty placeholder to avoid implicit moves,
team_idsent only forteamvisibility, submission blocked with an accessible message otherwise, disabled with an explanation when the user owns no teams.Backend (
update_gateway):team_idto child tools/resources/prompts that inherited the old team, preserving per-item overrides. No schema/migration change (columns already exist).🧪 Checks
Targeted checks run locally (not the full
make lint/make testsuite):python -m pytest tests/unit/mcpgateway/services/test_gateway_service.py→ 354 passed, 1 skipped (includes new deny-path, propagation-with-override, and destination-team conflict tests)npx vitest run tests/unit/js/gateway.test.js tests/unit/js/formSubmitHandlers.test.js→ 116 passedruff check mcpgateway/services/gateway_service.py→ cleanmake build-ui→ successManually verified end-to-end: reassigning a gateway's team on a local instance moved the gateway and its two federated tools to the destination team together; per-item overrides were preserved.
make lintpasses (ran targeted ruff/eslint on changed files only)make testpasses (ran targeted pytest/vitest above)CHANGELOG updated (if user-facing) (can add an entry if preferred)
📓 Notes (optional)
Security: destination-team ownership is validated before applying the change and cannot be bypassed via disabled gateways (validation and assignment are under the same enabled/include-inactive guard). Deny-path regression tests are included.