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

Đang mở
#349 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
56/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
azure, typescript
Lĩnh vực
backend, cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
44
Fork
14
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/apiops-cli

Tất cả issue của Azure/apiops-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.