Skip to content

feat(MCP): Use native OpenAPI tool fields and consolidate private deps#7656

Merged
khvn26 merged 1 commit into
mainfrom
feat/mcp-native-fields-sunset-gram
Jun 1, 2026
Merged

feat(MCP): Use native OpenAPI tool fields and consolidate private deps#7656
khvn26 merged 1 commit into
mainfrom
feat/mcp-native-fields-sunset-gram

Conversation

@khvn26
Copy link
Copy Markdown
Member

@khvn26 khvn26 commented Jun 1, 2026

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to Flagsmith/flagsmith-private#145 and the self-hosted MCP v3 epic (Flagsmith/flagsmith-private#127).

  • Relocate the 36 MCP-tagged views' friendly names and descriptions from the non-standard x-gram extension to native operation_id and description. Gram falls back to operationId/description when x-gram is absent, so the existing Gram push keeps working unchanged; this also prepares for the self-hosted MCP v3 server (Flagsmith/flagsmith-private#146), which reads the same native fields from the live /swagger. Descriptions are phrased API-agnostically ("Applies to …" rather than "Use this tool …") since they now also feed the public API docs, and the organisation descriptions are Britishised. Tool names are unchanged.
  • Consolidate the private apps: rbac and workflows_logic now ship inside flagsmith-private (>=0.7.0), so drop the separate workflows-logic dependency, the flagsmith-rbac clone in install-private-modules, and the --extra workflows installs. integrate-private-tests pulls those suites from flagsmith-private at the installed version's tag.
  • Switch pytest to --import-mode=importlib (with pythonpath = ["."]) so the imported private test suites resolve without per-directory package markers, matching flagsmith-private's own pytest config. (from tests.* importers keep working via pythonpath.)
  • Bump uv 0.11.8 -> 0.11.14.

The Gram schema generator and deploy push are deliberately left intact — Gram stays live until the v3 server lands.

How did you test this code?

  • Full core suite green locally under the new import mode: 3780 passed, 7 skipped.
  • make typecheck (1690 files) and make lint pass.
  • Installed flagsmith-private==0.7.0 from the index and ran make generate-mcp-spec: 43 mcp-tagged operations, no x-gram, every op with native operationId + description, including the private tools (org roles, release pipelines, change requests).
  • Verified the imported flagsmith-private test suites (rbac, workflows) collect cleanly under importlib, including duplicate test-module basenames across unit/ and integration/.

@khvn26 khvn26 requested review from a team as code owners June 1, 2026 09:52
@khvn26 khvn26 requested review from emyller and removed request for a team June 1, 2026 09:52
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Building Building Preview, Comment Jun 1, 2026 10:43am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ignored Ignored Preview Jun 1, 2026 10:43am
flagsmith-frontend-staging Ignored Ignored Preview Jun 1, 2026 10:43am

Request Review

@github-actions github-actions Bot added api Issue related to the REST API feature New feature or request labels Jun 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7656 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7656 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api-test:pr-7656 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith:pr-7656 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7656 Finished ✅ Results

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the custom MCP schema generation logic, custom views, and x-gram extensions in favor of standard OpenAPI operation_id and description fields. It also removes the workflows extra dependency, updates the flagsmith-private package to v0.7.0, and simplifies the Dockerfile and Makefile. The feedback suggests using a conditional assignment (?=) for FLAGSMITH_PRIVATE_REVISION in the Makefile to allow developers to override the revision from the command line during testing.

Comment thread api/Makefile
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.52%. Comparing base (85b92fa) to head (6533fe7).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7656   +/-   ##
=======================================
  Coverage   98.52%   98.52%           
=======================================
  Files        1443     1443           
  Lines       55047    55050    +3     
=======================================
+ Hits        54237    54240    +3     
  Misses        810      810           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  39.2 seconds
commit  8e19685
info  🔄 Run: #17127 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.8 seconds
commit  8e19685
info  🔄 Run: #17127 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  42.2 seconds
commit  8e19685
info  🔄 Run: #17127 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 9 seconds
commit  8e19685
info  🔄 Run: #17127 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.8 seconds
commit  71e61f5
info  🔄 Run: #17128 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.2 seconds
commit  71e61f5
info  🔄 Run: #17128 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33.9 seconds
commit  71e61f5
info  🔄 Run: #17128 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  43.9 seconds
commit  71e61f5
info  🔄 Run: #17128 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.5 seconds
commit  ac1ef5f
info  🔄 Run: #17129 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.9 seconds
commit  ac1ef5f
info  🔄 Run: #17129 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  31.8 seconds
commit  ac1ef5f
info  🔄 Run: #17129 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  49.8 seconds
commit  ac1ef5f
info  🔄 Run: #17129 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.9 seconds
commit  6533fe7
info  🔄 Run: #17131 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.2 seconds
commit  6533fe7
info  🔄 Run: #17131 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  31.5 seconds
commit  6533fe7
info  🔄 Run: #17131 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 7 seconds
commit  6533fe7
info  🔄 Run: #17131 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Visual Regression

19 screenshots compared. See report for details.
View full report

@khvn26 khvn26 force-pushed the feat/mcp-native-fields-sunset-gram branch from 8e19685 to 71e61f5 Compare June 1, 2026 10:06
@khvn26 khvn26 changed the title feat(MCP): Adopt native OpenAPI tool fields and retire Gram scaffolding feat(MCP): Use native OpenAPI tool fields and consolidate private deps Jun 1, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jun 1, 2026
germangarces
germangarces previously approved these changes Jun 1, 2026
Copy link
Copy Markdown
Member

@germangarces germangarces left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@khvn26 khvn26 force-pushed the feat/mcp-native-fields-sunset-gram branch from 71e61f5 to ac1ef5f Compare June 1, 2026 10:22
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jun 1, 2026
Relocate the 36 MCP-tagged views' friendly names and descriptions from the
non-standard `x-gram` extension to native `operation_id` and `description`
(Flagsmith/flagsmith-private#145). Gram falls back to `operationId`/`description`
when `x-gram` is absent, so the existing Gram push keeps working unchanged; this
also prepares for the self-hosted MCP v3 server (Flagsmith/flagsmith-private#146),
which reads the same native fields from the live `/swagger`. Descriptions are
phrased API-agnostically ("Applies to ..." rather than "Use this tool ...") since
they now also feed the public API docs, and the organisation descriptions are
Britishised; tool names are unchanged.

Consolidate the private apps: rbac and workflows_logic now ship inside
flagsmith-private (>=0.7.0), so drop the separate `workflows-logic` dependency,
the `flagsmith-rbac` clone in `install-private-modules`, and the `--extra workflows`
installs; `integrate-private-tests` pulls those suites from flagsmith-private at
the installed version's tag.

Switch pytest to `--import-mode=importlib` (with `pythonpath = ["."]`) so the
imported private test suites resolve without per-directory package markers,
matching flagsmith-private's own pytest configuration.

Bump uv 0.11.8 -> 0.11.14.

The Gram schema generator and deploy push are deliberately left intact; Gram
stays live until the v3 server lands.

beep boop
@khvn26 khvn26 force-pushed the feat/mcp-native-fields-sunset-gram branch from ac1ef5f to 6533fe7 Compare June 1, 2026 10:43
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jun 1, 2026
@khvn26 khvn26 requested a review from germangarces June 1, 2026 11:02
Copy link
Copy Markdown
Contributor

@emyller emyller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one language question.

Comment thread api/organisations/views.py
@khvn26 khvn26 merged commit 2c8cf0f into main Jun 1, 2026
34 checks passed
@khvn26 khvn26 deleted the feat/mcp-native-fields-sunset-gram branch June 1, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants