Repository navigation
fix(experimentation): Expose update_experiment to MCP as PATCH - #9138
Open
Dakshhhhh-ops wants to merge 1 commit into
Open
Dakshhhhh-ops wants to merge 1 commit into
Dakshhhhh-ops wants to merge 1 commit into
Conversation
|
@Dakshhhhh-ops is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval skipped because this PR is from an external contributor.
Re-trigger cubic
This branch has not been deployed
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.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature. (Not needed: the tool name and description in the MCP tool catalogue are unchanged.)Changes
Closes #9136
The
update_experimentMCP tool was generated from theupdate(PUT) action. PUT on an experiment always fails: withoutfeatureit is a required field, and withfeaturethe serializer refuses to change it. This moves the MCP schema decorator topartial_update, so the tool sends PATCH with thePatchedExperimentbody (every field optional).partial_updateinstead ofupdate.update_experimentnow sits onpatchand usesPatchedExperiment; the PUT operation goes back to the default operation id and tag.update_experimentto PATCH with themcptag and leaves PUT untagged.REST behaviour is unchanged; only the OpenAPI operation ids and tags move.
A note on openapi.yaml: I don't have the private packages, so
make generate-full-openapion my machine drops the enterprise endpoints. I ranmanage.py spectacular+ openapi-format 1.23.0, copied only the experiment detail path into openapi.yaml (the other paths matched apart from the enterprise ones), then ranmake generate-mcp-openapias is. Worth re-runningmake generate-docs-privateon your side to confirm there's no drift.How did you test this code?
pytest tests/unit/experimentation/test_experiment_views.py tests/unit/api tests/integration/test_api_documentation.py: 260 passed (Linux container, Postgres 16).ruff check,ruff format --checkandmypyon the two changed Python files: clean.name+hypothesisgives 400 (feature required), PUT with the currentfeaturegives 400 (cannot change feature), PATCH withhypothesisgives 200.