Extractor mistakes set-body json response as transitive dependency which causes pipeline failure
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- azure, typescript
Research direction
Start by tracing the dependency extraction path used by apiops-cli extract and find where it interprets braces in policy content as transitive dependencies. Reproduce the failure with the provided set-body JSON response and inspect the related extraction tests. Done means extraction succeeds when this response contains {{ and }} and still handles genuine transitive dependencies.
Written by the indexing model from the issue text.
Description
Command that triggered the bug
apiops-cli extract
Expected behavior
When extracting an API the extractor should not fail when it can not resolve a transitive dependency.
Actual behavior
When extraction an API the following set-body json response is being mistaken as a transitive dependency due to the braces "{{" and "}}" in the return string.
<!--
Fail if the auth endpoint returned a non-200
-->
<choose>
<when condition="@(((IResponse)context.Variables["tokenResponseVar"]).StatusCode != 200)">
<return-response>
<set-status code="502" reason="Bad Gateway" />
<set-header name="Content-Type" exists-action="override">
<value>application/json</value>
</set-header>
<set-body>@{
var status = ((IResponse)context.Variables["tokenResponseVar"]).StatusCode;
return $"{{\"error\":\"upstream_auth_failed\",\"upstream_status\":{status}}}";
}</set-body>
</return-response>
</when>
</choose>
apiops CLI version
1.0.5
Environment details
Azure DevOps
CI/CD environment
Azure DevOps
Is this bug blocking you?
Yes
- Dominant language
- TypeScript
- Stars
- 44
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/apiops-cli
-
type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
Azure/apiops-cli#350 ·
-
stale
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Azure/apiops-cli#333 · 1 comment ·
-
extract fails when a policy uses set-backend-service backend-id="{{namedValue}}"Possibly taken @dannyward630 claimed this 37 days ago. Openstale type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Azure/apiops-cli#331 · 1 comment ·
-
Docs example says products are auto-included transitively, but they aren't extracted with `products: []`Possibly taken @cdayne claimed this 27 days ago. Openstale type:question
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Azure/apiops-cli#277 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Azure/apiops-cli#345 ·
All issues in Azure/apiops-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
tashfeenahmed/freellmapi#2217 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
remotion-dev/skills#37 ·
-
gui: a narrow window's gateway key row with a line under it wraps its faded badges onto blank linesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Slider: Escape during a thumb drag keeps and commits the dragged value, unlike ui-sdk's other dragsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vercel-labs/ui#1758 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nicobailon/pi-subagents#3425 ·
Maintainers usually reply within 1 day