feat: wire native FME segment update and segment definition keys - #832
feat: wire native FME segment update and segment definition keys#832ravindraharness wants to merge 8 commits into
Conversation
Native segment PATCH and definition key execute actions were the remaining v4 gaps after harness#806; point native fme_segment_keys callers at those actions instead of advertising a fake NYI native keys resource. Co-authored-by: Cursor <cursoragent@cursor.com>
Harness NG orgIdentifier/projectIdentifier injection made v4 create and key-mutation JSON fail validation. Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
CreateSegmentRequest has no type field, and Jackson rejects unknown JSON. Keep local type validation when callers pass it. Co-authored-by: Cursor <cursoragent@cursor.com>
Reviewers would see describe() still requiring type after the wire omit, and add_keys allowed empty keys without replace=true. README matrix now matches the new update and key execute actions so docs:check passes. Co-authored-by: Cursor <cursoragent@cursor.com>
Java now requires segment_type on list and segmentType on create; omitting kind or sending JSON type 400s. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep deprecated standard/rule-based segments native-rejected and segment_keys as not-yet-implemented, matching the first dual-mode PR. New fme_segment ops stay org/project-only and reject workspace_id. Co-authored-by: Cursor <cursoragent@cursor.com>
List already rewrote standard to STANDARD; create exact-matched uppercase only, so the same agent input 400ed on POST.
Remove the added Harness-native key management note from the fme_segment_keys resource description for now. Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
| responseExtractor: passthrough, | ||
| description: "Delete a segment by name.", | ||
| description: | ||
| "Delete a segment by name. MCP does not gate on kind; the backend STANDARD-store lookup 404s for LARGE/RULE_BASED names. Returns 400 hasDependents if any environment definition or flag still references it — delete definitions (after clearing keys) first.", |
There was a problem hiding this comment.
Uncessary statement -
MCP does not gate on kind;
| responseExtractor: passthrough, | ||
| description: "Delete a segment by name.", | ||
| description: | ||
| "Delete a segment by name. MCP does not gate on kind; the backend STANDARD-store lookup 404s for LARGE/RULE_BASED names. Returns 400 hasDependents if any environment definition or flag still references it — delete definitions (after clearing keys) first.", |
There was a problem hiding this comment.
Removed the unnecessary "MCP does not gate on kind;" clause from the fme_segment delete description in commit a6a2a36. The description still notes the backend STANDARD-store lookup behavior and the hasDependents dependency ordering.
|
Skipping Bugbot: Bugbot could not find a matching SCM installation for this repository. Please reinstall the GitHub/GitLab installation and/or remove the installation from non-Bugbot accounts. Visit the Bugbot dashboard to update your settings. |
Description
Follow-up to #806 for the remaining Harness-native FME segment surface.
fme_segmentalready had list/get/create/delete; this PR adds update and wires membership keys ontofme_segment_definitionexecute actions. Legacyfme_segment_keyslist/update are unchanged. Nativeorg_id+project_idonfme_segment_keysis rejected with a pointer to those execute actions (not a silent NYI).Dual-mode routing — this PR only
workspace_id)org_id+project_id)fme_segmentfme_segment_definitionfme_segment_keysfme_segment_definitionexecute actionsNative contracts
fme_segment.update—PATCH /fme/api/v4/segments/{name}withContent-Type: application/merge-patch+json. Body:description/tags/owners.fme_segment.create— wire body matchesCreateSegmentRequest(name,trafficType, optionaldescription/tags/owners). Kind issegmentType:STANDARD|LARGE|RULE_BASED(FME_SEGMENT_KINDS; case is canonicalized). If callers passtype, MCP validates locally and omits it on the wire (not a Java field). Native POST usesskipScopeBodyInjection.GET/POST .../segment-definitions/{name}/keysandPOST .../keys/remove, queryenvironment_id, paginationlimit/offset. Emptyadd_keysonly whenreplace=true.hasDependents— definition delete fails while membership keys remain. Sequence:remove_keys(oradd_keys+replace=true+ empty keys) → delete definition → delete segment.Key implementation changes
src/registry/toolsets/feature-flags.tsplus tests/README.src/registry/scope-utils.ts—requireHarnessNativeSegmentScopenow rejectsworkspace_id(including mixed with org/project) and does not offer workspace_id as an alternative. Noregistry/index.ts,types.ts, or prompt changes.fme_segmentupdate;fme_segment_definitionexecutelist_keys,add_keys,remove_keys.Type of Change
Checklist
tests/registry/fme-segment-native-only.test.ts+tests/registry/feature-flags.test.tspnpm docs:check(README matrix matches registry)Coding Standards (registry-driven MCP model)
server.registerTool()callsfeature-flagstoolset extendedoperationPolicyon every new/changed endpointidentifierFieldsandscopedeclaredconsole.log()insrc/Test plan