fix: [FME-17257]: point fme.spec.yaml at real v4 FME endpoints - #111
Draft
puthrayaharness wants to merge 4 commits into
Draft
fix: [FME-17257]: point fme.spec.yaml at real v4 FME endpoints#111puthrayaharness wants to merge 4 commits into
puthrayaharness wants to merge 4 commits into
Conversation
pkg/spec/fme.spec.yaml declared feature_flag/feature_flag:definition commands against /v3/feature-flag... paths with entity-wrapped JSON, but the live FME API is /fme/internal/api/v4/... and returns flat items with no entity wrapper. Swap the path prefix, drop every it.entity indirection, and fix the killed->isKilled and modifiedAt->createdAt field drift so list and get actually work against the real API. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> AI-Session-Id: 20b23a2d-5d3f-4d25-9879-167a341599d4 AI-Tool: claude-code AI-Model: unknown
|
Deepak Puthraya seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
added 3 commits
August 12, 2026 15:15
…pe flag
Live verification against qa.harness.io surfaced two more real-API drifts
beyond the read-path fixes in the previous commit:
- POST/PATCH responses for feature_flag and feature_flag:definition wrap
the resource in {"entity": {...}, "governance": {...}}, unlike the flat
GET/list shape. item_expr now reads it.entity on every create/update/
archive/unarchive/kill/restore/reallocate command.
- `flags.traffic-type` parsed as `flags.traffic - type` under expr-lang
(hyphens aren't valid in identifiers), so create_body_init silently
dropped trafficType from the POST body. Switched to bracket indexing
(flags["traffic-type"]), matching the convention already used for
hyphenated flags elsewhere in the codebase.
Also added mutable_path to feature_flag's description field — update
feature_flag had zero mutable fields declared, so `--set` always failed
with "unknown or read-only field" regardless of path.
Verified live: full create/update/archive/unarchive/delete lifecycle for
feature_flag, and create/list/get/update/kill/restore/reallocate/delete
for feature_flag:definition, against qa.harness.io project puthraya with
a disposable flag (cleaned up after). go test ./... and modules/har's
suite both pass.
Known follow-up not fixed here: `update feature_flag:definition --set
trafficAllocation=...` (the example in the command's own help text)
still fails — MutableFields only reads noun.Fields, not the definition's
fields_extra, so there's no way to expose a definition-specific mutable
field without a registry/spec engine change. Out of scope for this
mechanical spec fix.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AI-Session-Id: 20b23a2d-5d3f-4d25-9879-167a341599d4
AI-Tool: claude-code
AI-Model: unknown
…n FME v4 commands Extends the v4-shaped fme.spec.yaml with segment (CRUD), fme_environment (CRUD; named to avoid colliding with the CD module's "environment" noun), segment:definition (CRUD, scoped by --env), and segment:definition_keys (list/add/remove) commands, following the same real-API-verified approach used for feature_flag. Live-verified against qa.harness.io: fme_environment and segment full CRUD, and segment:definition list. segment:definition writes and the keys add/remove commands could not be live-verified in this session due to an in-progress backend rollout (PR #12644) causing intermittent 403/405 responses; the request shapes are believed correct based on the 403 responses matching the documented error contract. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> AI-Session-Id: 20b23a2d-5d3f-4d25-9879-167a341599d4 AI-Tool: claude-code AI-Model: unknown
…dation
fields_noun belongs on CommandSpec, not nested under endpoint: — the
embedded-spec loader rejected the file with strict YAML unmarshaling
("field fields_noun not found in type spec.EndpointSpec"), failing
"Build, Test & Validate Specs" in CI. Also suppresses the expected
"missing get_id_expr" warning on segment:definition_keys (raw string
items have no id), following the same get_id_expr: "-" convention used
elsewhere in the repo.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AI-Session-Id: 20b23a2d-5d3f-4d25-9879-167a341599d4
AI-Tool: claude-code
AI-Model: unknown
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
fme.spec.yamlpointed every FME command at the wrong API (/v3/...,entity-wrapped responses). Fixedfeature_flagagainst the real/fme/internal/api/v4/...API, then extended the spec withsegment,fme_environment,segment:definition,segment:definition_keysusing the same pattern.feature_flagfixes/v3/feature-flag.../fme/internal/api/v4/...entity-wrapped.entity(it.entity.X→it.X)entity-wrapped ({"entity":..., "governance":...})item_expr: it.entityon mutation commandsflags["traffic-type"]parsed asflags.traffic - typeunder expr-langkilled→isKilled, nomodifiedAton definitionsit.isKilled;createdreadsit.createdAtupdate feature_flag --set description=...had no mutable fieldmutable_path: descriptionNew resources
segmentname, likefeature_flagfme_environmentfme_environment, notenvironment— that noun/alias belongs to the CD module. Addressed by UUID (it.id), not namesegment:definition--env;listhas no parent-id requirement (env-scoped, not segment-scoped)segment:definition_keysexecute ...:definition_keys_add/_remove{"keys": [...], "governance": ...}(noentity) →item_expr: it.keys. Dedicatedfields_noun: segment_definition_keysfor raw string itemsSoft-archive delete confirmed live:
DELETEreturns200with no body; subsequentGETon an archivedsegment/segment_definitionreturns404.Test plan
go test ./...,modules/har,check:specs:mainpkg/specloader/fme_spec_test.gofeature_flag/fme_environment/segment, listsegment:definition/segment:definition_keys(incl.--env→environment_id,fields_nounoverride)feature_flagfull lifecycle,fme_environmentCRUD,segmentCRUD,segment:definitionlistqa.harness.iosegment:definitioncreate/update/delete,definition_keys_add/_remove403 forbidden) on the test PAT — not exercised end-to-endCaveats
segment:definitionwrites: confirmed against the backend repo that the route (POST/PATCH/DELETE .../segment-definitions/{name},environment_idquery param,keys/keys/removebody/response shapes) matches this spec exactly. The403s are legitimate RBAC (CREATE/EDIT/DELETE permission on segment-definitions for that project/environment), not a spec or rollout issue — the qa test account needs a role grant to exercise these live.update feature_flag:definition --set trafficAllocation=...fails "unknown or read-only field" —MutableFieldsonly reads noun-level fields, not a noun-variant'sfields_extra. Needs a registry/spec engine change; out of scope.Manual verification