Skip to content

fix: accept native FME flag create aliases and align leftover agent docs - #830

Closed
ravindraharness wants to merge 2 commits into
harness:mainfrom
ravindraharness:fme-v4-remaining-native
Closed

fix: accept native FME flag create aliases and align leftover agent docs#830
ravindraharness wants to merge 2 commits into
harness:mainfrom
ravindraharness:fme-v4-remaining-native

Conversation

@ravindraharness

@ravindraharness ravindraharness commented Aug 17, 2026

Copy link
Copy Markdown

Description

Follow-up to #806 (feat: FME dual-mode Harness-native scope migration).

#806 already wired Harness-native fme_feature_flag create / update (JSON Merge Patch) / archive / unarchive, plus kill / restore / reallocate aliases onto /fme/api/v4/feature-flag-definitions/{name}/…. This PR does not re-implement those routes. It lands leftover agent-facing create input gaps that still produce wrong calls after that merge.

Why this follow-up exists

Agents that already know the legacy create contract pass traffic_type_id at the top level (it is a path param on Split v2). Native v4 requires trafficType in the JSON body, not in the path. After #806, that top-level field was ignored and create failed with “trafficType is required in body”, even though the caller had a traffic type. Native create could also POST { name: undefined } if body.name was omitted.

feature-flag-rollout no longer tells agents that native definitions or kill/restore are unimplemented. On this branch, fme_rollout_status.list in native mode is still called out as a remaining gap (wired separately in #838).

Key implementation changes

  • src/registry/toolsets/feature-flags.ts — native create bodyBuilder resolves trafficType from body.trafficType, then traffic_type_id, traffic_type, or body.traffic_type. Missing traffic type or missing name throws a clear error. The wire body is still { name, trafficType, description?, tags?, owners? } on POST /fme/api/v4/feature-flags (no traffic type in the path). Tag wrapping continues to use normalizeFmeTags.
  • src/prompts/feature-flag-rollout.ts — native-mode caveat no longer claims definitions or kill/restore are unimplemented.
  • tests/registry/feature-flags.test.tstraffic_type_idbody.trafficType and missing-name fail-closed.
  • tests/registry/registry.test.ts — fixture proving ResolvedRoute.headers override EndpointSpec.headers (route wins). Dispatch merge itself shipped in feat: [FME-17249]: FME dual-mode Harness-native scope migration #806; this is the missing unit coverage.

This PR does not change docs/testing/fme_feature_flag/test_plan.md or test_report.md.

Explicitly unchanged (already on main via #806)

Native create body (after this PR)

Field Source Notes
name body.name or input.name required — throws if missing
trafficType body.trafficType | traffic_type_id | traffic_type | body.traffic_type required — in the JSON body, never the path
description body.description optional
tags body.tags optional; strings wrapped as { name }
owners body.owners optional; { type: "USER", id | email } or { type: "GROUP", identifier }

Type of Change

  • Bug fix (agent-facing create input + stale prompt)

Checklist

  • Unit: tests/registry/feature-flags.test.ts + tests/registry/registry.test.ts
  • No new public tools — registry bodyBuilder + prompt only

Coding Standards (registry-driven MCP model)

  • No new server.registerTool() calls
  • Existing feature-flags toolset
  • No console.log() in src/

Test plan

  • Native create with body.trafficType still matches the feat: [FME-17249]: FME dual-mode Harness-native scope migration #806 v4 body shape
  • Native create with top-level traffic_type_id POSTs /fme/api/v4/feature-flags with { name, trafficType }
  • Native create without name / without traffic type throws and does not call the client
  • ResolvedRoute.headers win over spec.headers
  • Live QA (optional): harness_create fme_feature_flag with org_id+project_id+traffic_type_id against QA

Public v4 create already shipped in harness#806, but agents still pass traffic_type_id the way they do for legacy create, and the rollout prompt plus test plan still claimed kill/restore were NYI.

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.

Those markdown files are not part of the create-alias change, and rewriting NYI rows or pass counts without a fresh live run only adds review noise.

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

Copy link
Copy Markdown
Author

Closing as duplicate of the remaining product fix, which is now on #831 (c1c11b45).

Kept: native fme_feature_flag.create accepts traffic_type_id / traffic_type aliases and fails closed when name is missing.

Dropped from this PR:

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