Extractor mistakes set-body json response as transitive dependency which causes pipeline failure

オープン
#349 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
azure, typescript
領域
backend, cli

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

type:bug
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>
image
apiops CLI version

1.0.5

Environment details

Azure DevOps

CI/CD environment

Azure DevOps

Is this bug blocking you?

Yes

主要言語
TypeScript
スター
44
フォーク
14
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/apiops-cli のほかの issue

Azure/apiops-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。