-
Notifications
You must be signed in to change notification settings - Fork 75
feat: wire native FME traffic type and rollout status lists #838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
puthrayaharness
merged 9 commits into
harness:main
from
ravindraharness:fme-v4-traffic-type-rollout-status
Aug 20, 2026
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9dd5991
feat: wire native FME traffic type and rollout status lists
ravindraharness 47d003e
fix: make native traffic and rollout lists harness_list-ready
ravindraharness df868f3
fix: align FME segment kinds and environment list with v4
ravindraharness 10befe0
Revert "fix: align FME segment kinds and environment list with v4"
ravindraharness c3ae868
fix: simplify fme_rollout_status description without endpoint details
cursoragent e4492f1
fix: rewrite fme_traffic_type description without endpoint details
cursoragent 10305ce
fix: keep traffic and rollout list copy tool-facing
ravindraharness 72ec755
fix: drop native payload fields from traffic and rollout list copy
ravindraharness 83e92a6
Merge branch 'main' into fme-v4-traffic-type-rollout-status
puthrayaharness File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import type { ToolsetDefinition, BodySchema } from "../types.js"; | ||
| import { passthrough, fmeListExtract, fmeGetExtract } from "../extractors.js"; | ||
| import { passthrough, fmeListExtract, fmeGetExtract, fmeV4PaginatedListExtract } from "../extractors.js"; | ||
| import { isFmeHarnessNativeSelected, logFmeDeprecation, requireFmeIdentifier, requireHarnessNativeSegmentScope, resolveFmeDualMode } from "../scope-utils.js"; | ||
|
|
||
| const fmeActionExtract = (raw: unknown) => { | ||
|
|
@@ -680,32 +680,32 @@ export const featureFlagsToolset: ToolsetDefinition = { | |
| resourceType: "fme_rollout_status", | ||
| displayName: "FME Rollout Status", | ||
| description: | ||
| "Rollout status definitions for a workspace (e.g. Killed, Permanent, Ramping). Use to discover valid rollout_status_id UUIDs for filtering fme_feature_flag lists. Note: this endpoint may not be available on all account types — rollout status IDs are also returned inline with fme_feature_flag list results.", | ||
| "Rollout status definitions (e.g. Killed, Permanent, Ramping). Dual-mode list: org_id+project_id (Harness-native GET /fme/api/v4/rollout-statuses) or deprecated workspace_id (Split Admin). Use to discover rollout_status_id UUIDs for filtering fme_feature_flag lists. Native response is {data, limit, offset, totalCount}; each item is {type: \"ROLLOUT_STATUS\", id, name, description?}. List-only — no get/create/update/delete.", | ||
| toolset: "feature-flags", | ||
| scope: "account", | ||
| scopeOptional: true, | ||
| identifierFields: ["workspace_id"], | ||
| product: "fme", | ||
| listFilterFields: [ | ||
| { name: "workspace_id", description: "FME workspace ID (get from fme_workspace). Deprecated — omit and pass org_id+project_id instead for Harness-native scoping." }, | ||
| { name: "offset", description: "Harness-native pagination offset (default 0)", type: "number" }, | ||
| { name: "limit", description: "Harness-native page size (default 100, max 100)", type: "number" }, | ||
| ], | ||
| operations: { | ||
| list: { | ||
| method: "GET", | ||
| path: "/internal/api/v2/rolloutStatuses/ws/{wsId}", | ||
| path: "", | ||
| routeResolver: (input) => { | ||
| const mode = resolveFmeDualMode(input, "fme_rollout_status"); | ||
| if (mode.mode === "harness_native") { | ||
| throw new Error( | ||
| "fme_rollout_status.list: Harness-native (org_id/project_id) mode not yet implemented for this operation — pass workspace_id (deprecated) instead.", | ||
| ); | ||
| if (mode.mode === "legacy") { | ||
| return { path: `/internal/api/v2/rolloutStatuses/ws/${encodeURIComponent(mode.workspaceId)}` }; | ||
| } | ||
| return { path: `/internal/api/v2/rolloutStatuses/ws/${encodeURIComponent(mode.workspaceId)}` }; | ||
| return { path: "/fme/api/v4/rollout-statuses", product: "harness", scopeParams: FME_HARNESS_NATIVE_SCOPE_PARAMS }; | ||
| }, | ||
| operationPolicy: { risk: "read", retryPolicy: "safe" }, | ||
| pathParams: { workspace_id: "wsId" }, | ||
| responseExtractor: passthrough, | ||
| description: "List rollout status definitions for a workspace (Killed, Permanent, Ramping, etc.). If this returns 404, use rolloutStatus fields from fme_feature_flag list results instead.", | ||
| queryParams: { offset: "offset", size: "limit", limit: "limit" }, | ||
| responseExtractor: fmeV4PaginatedListExtract, | ||
| description: "List rollout statuses. Legacy: workspace_id → Split Admin. Harness-native: org_id+project_id, optional offset/limit (harness_list size maps to limit). Envelope {data, limit, offset, totalCount} promoted to items/total.", | ||
| }, | ||
| }, | ||
| }, | ||
|
|
@@ -931,32 +931,32 @@ export const featureFlagsToolset: ToolsetDefinition = { | |
| resourceType: "fme_traffic_type", | ||
| displayName: "FME Traffic Type", | ||
| description: | ||
| "Traffic type in a workspace (e.g. 'user', 'account'). List traffic types to discover traffic_type_id values needed for identity queries and flag/segment creation.", | ||
| "Traffic type (e.g. 'user', 'account'). Dual-mode list: org_id+project_id (Harness-native GET /fme/api/v4/traffic-types) or deprecated workspace_id (Split Admin). Use to discover traffic_type_id / name values for flag and segment create. Native items are {type: \"TRAFFIC_TYPE\", id, name} — no displayAttributeId. List-only — no get/create/update/delete.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here let's avoid exposing the details of the underlying end points. Provide details of tool. Also it is clear that is listing and has not GET/CREATE etc |
||
| toolset: "feature-flags", | ||
| scope: "account", | ||
| scopeOptional: true, | ||
| identifierFields: ["workspace_id"], | ||
| product: "fme", | ||
| listFilterFields: [ | ||
| { name: "workspace_id", description: "FME workspace ID (get from fme_workspace). Deprecated — omit and pass org_id+project_id instead for Harness-native scoping." }, | ||
| { name: "offset", description: "Harness-native pagination offset (default 0)", type: "number" }, | ||
| { name: "limit", description: "Harness-native page size (default 100, max 100)", type: "number" }, | ||
| ], | ||
| operations: { | ||
| list: { | ||
| method: "GET", | ||
| path: "/internal/api/v2/trafficTypes/ws/{wsId}", | ||
| path: "", | ||
| routeResolver: (input) => { | ||
| const mode = resolveFmeDualMode(input, "fme_traffic_type"); | ||
| if (mode.mode === "harness_native") { | ||
| throw new Error( | ||
| "fme_traffic_type.list: Harness-native (org_id/project_id) mode not yet implemented for this operation — pass workspace_id (deprecated) instead.", | ||
| ); | ||
| if (mode.mode === "legacy") { | ||
| return { path: `/internal/api/v2/trafficTypes/ws/${encodeURIComponent(mode.workspaceId)}` }; | ||
| } | ||
| return { path: `/internal/api/v2/trafficTypes/ws/${encodeURIComponent(mode.workspaceId)}` }; | ||
| return { path: "/fme/api/v4/traffic-types", product: "harness", scopeParams: FME_HARNESS_NATIVE_SCOPE_PARAMS }; | ||
| }, | ||
| operationPolicy: { risk: "read", retryPolicy: "safe" }, | ||
| pathParams: { workspace_id: "wsId" }, | ||
| responseExtractor: passthrough, | ||
| description: "List traffic types for a workspace. Returns id, name, and displayAttributeId for each traffic type.", | ||
| queryParams: { offset: "offset", size: "limit", limit: "limit" }, | ||
| responseExtractor: fmeV4PaginatedListExtract, | ||
| description: "List traffic types. Legacy: workspace_id → Split Admin (may include displayAttributeId). Harness-native: org_id+project_id, optional offset/limit (harness_list size maps to limit); envelope {data, limit, offset, totalCount} with id and name only, promoted to items/total.", | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid exposing the details of endpoint in the description.