feat(cli): define x-xgen-long-running-operation - #1425
Closed
julius-jogela wants to merge 2 commits into
Closed
Conversation
Tag every operation that returns HTTP 202 with x-xgen-long-running-operation: true during the merge step. 17 operations return 202 but predate IPA-132 and do not follow the long-running operation contract, so they are excluded via a hardcoded denylist of operation IDs. That list is a draft idea for filtering out legacy operations, not a final design.
julius-jogela
force-pushed
the
feat/x-xgen-long-running-operation
branch
from
August 10, 2026 14:56
83d153e to
7e04952
Compare
Legacy pre-IPA-132 operations were left untagged. Publish them under the
same extension with a legacy marker instead, so downstream tooling can
tell them apart from IPA-132 compliant operations:
standard 202 -> x-xgen-long-running-operation: true
legacy 202 -> x-xgen-long-running-operation: {"legacy": true}
The legacy operations are still identified by the hardcoded denylist of
operation IDs.
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
Draft. Introduces the
x-xgen-long-running-operationvendor extension and tags it atmerge time.
Behavior:
202operation → no extension202→x-xgen-long-running-operation: true202→x-xgen-long-running-operation: { legacy: true }17 operations return
202but predate IPA-132 and do not follow the long-runningoperation contract (no
Locationheader, no/operationspolling endpoint). Rather thanleaving them untagged, they are published under the same extension with a
legacymarkerso downstream tooling can tell the two groups apart:
How legacy operations are identified
A hardcoded denylist of the 17
operationIds inmerge.go. I looked for a native signalin the raw spec first and there isn't one:
Locationheader. The only responseheader names present are
RateLimit-LimitandRateLimit-Remaining(542 responseseach), so
Locationpresence can't distinguish legacy from future-compliant operations./operationssegment.at 6 unrelated schemas.
that later gains a new version.
The cleaner long-term design is a marker in the upstream service specs
(
x-xgen-legacy-long-running-operation), letting merge derive the value instead ofhardcoding it. That can't be done from this repo, which only holds generated output — the
source specs come from S3. The denylist decision is isolated in
longRunningOperationExtensionValue()so switching to an upstream marker later touchesone function.
Deliberately not using
x-xgen-IPA-exception: it is scoped to validation-ruleexceptions and is stripped from the released spec by
ExtensionFilter, so the semanticswould silently disappear.
What's here
tools/cli/internal/cli/merge/merge.go— tag202operations during merge; emit{ legacy: true }for denylisted operation IDstools/cli/internal/cli/merge/merge_test.go— tests asserting the exact emitted shapeVerified published shape
Ran the built binary over the committed raw spec, then through
foascli filter --env prod:The object-valued extension survives filtering intact, in both JSON and YAML. The single
trueis a synthetic probe operation, not a real one — all 17 real202operations inthe spec today are legacy, and none is IPA-132 compliant, so
truewill not appear inthe published spec until a service ships a compliant LRO.
Risk worth discussing
{ legacy: true }is truthy in JavaScript, Python and Go map-presence checks. Aconsumer writing
if (op['x-xgen-long-running-operation'])will read legacy operations ascompliant and poll them per a contract they don't implement. Since the spec currently
contains 17 legacy and 0 compliant operations, a naive consumer would be wrong every time.
Options if that matters: document that the value is
true | { legacy: true }before anyconsumer is written, or emit
{ legacy: false }for compliant operations so the valuetype is uniform and presence can never be mistaken for compliance.
Nothing consumes this extension in the repo yet, so there is no in-repo backward-
compatibility risk.
Testing
go test ./internal/cli/merge/— asserts exact shapes for non-202 (absent), standard202(true),201+202(true), and legacy202({legacy: true}).