Skip to content

feat: add native-only FME environment get, create, update, and delete - #833

Open
ravindraharness wants to merge 3 commits into
harness:mainfrom
ravindraharness:fme-v4-remaining-environment
Open

feat: add native-only FME environment get, create, update, and delete#833
ravindraharness wants to merge 3 commits into
harness:mainfrom
ravindraharness:fme-v4-remaining-environment

Conversation

@ravindraharness

@ravindraharness ravindraharness commented Aug 18, 2026

Copy link
Copy Markdown

Description

Follow-up to #806 for remaining FME environment ops.

#806 dual-moded list only (workspace_id or org_id+project_id). MCP never had get/create/update/delete on workspace_id, so those four ops are Harness-native only. This PR does not invent a legacy Split v2 MCP contract (those Admin APIs exist; we are not exposing them).

Dual-mode routing — this PR only

Resource Legacy (workspace_id) Harness-native (org_id+project_id)
fme_environment list (unchanged dual-mode) list + get / create / update / delete

Native contracts

  • list — still dual-mode. Native list uses fmeV4PaginatedListExtract (dataitems, totalCounttotal) with offset/limit (harness_list size maps to limit).
  • getGET /fme/api/v4/environments/{environment_id} (UUID from list, not the env name).
  • createPOST /fme/api/v4/environments body { name, isProduction? } (CreateEnvironmentRequest). Name max 15 characters. production is accepted as an alias for isProduction. skipScopeBodyInjection so NG orgIdentifier/projectIdentifier are not injected.
  • updatePATCH JSON Merge Patch { name?, isProduction? }. Neither field is clearable (omit to keep).
  • deleteDELETE /fme/api/v4/environments/{id}. Backend returns 400 hasDependents while SDK API keys (always created by EnvironmentStarterKit), flags, or segments remain. MCP has no v4 token resource and does not auto-delete keys.

workspace_id on get/create/update/delete throws: Harness-native (org_id/project_id) only — MCP never supported workspace_id for this operation (list remains dual-mode).

Key implementation changes

  • src/registry/toolsets/feature-flags.ts plus tests/README.
  • src/registry/extractors.tsfmeV4PaginatedListExtract used by native environment list (same helper as traffic type / rollout status lists).
  • resolveNativeOnlyEnvironmentRoute for the four new ops. List still uses resolveFmeDualMode.
  • README Feature Flags matrix: fme_environment get/create/update/delete. Native list envelope/pagination documented without citing other PR numbers.
  • No registry/index.ts, types.ts, or prompt changes.

Type of Change

  • New feature

Checklist

  • Unit: tests/registry/fme-environment-native-only.test.ts + tests/registry/feature-flags.test.ts
  • pnpm docs:check (README matrix matches registry)

Coding Standards (registry-driven MCP model)

  • No new server.registerTool() calls — existing feature-flags toolset extended
  • operationPolicy on every new/changed endpoint
  • Shared response extractors from src/registry/extractors.ts
  • identifierFields and scope declared
  • No console.log() in src/

Test plan

  • Native create/get/update against qa.harness.io
  • workspace_id rejected on get/create/update/delete
  • Native delete: expected 400 hasDependents until starter-kit SDK keys are removed (no MCP token API)

List was already dual-mode after harness#806. Remaining CRUD follows v4 EnvironmentResource: isProduction on the wire, merge-patch update, UUID environment_id, and skipScopeBodyInjection on POST. Item get is native-only because Split v2 has no GET-by-id.

Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: Cursor <cursoragent@cursor.com>

harness#806 only dual-moded environment list. MCP never had a workspace_id contract for the other ops, so do not invent legacy v2 create/update/delete paths.
@ravindraharness ravindraharness changed the title feat: wire native FME environment get, create, update, and delete feat: add native-only FME environment get, create, update, and delete Aug 18, 2026
Java EnvironmentListResponse is paginated; passthrough dropped
totalCount. Product docs should not cite internal PR history.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants