Feature request: allow skipping the delete phase when any publish update fails

Đang mở
#346 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
azure, typescript
Lĩnh vực
cli, cloud

Hướng nghiên cứu

Start with src/services/publish-service.ts, especially the runPublish flow around executePuts and the delete phase, then inspect how resource-level failures are represented in the results. Define how informational skips affect the gate and how skipped deletions appear in human-readable and machine-readable output. Done means the opt-in mode skips all deletions after a failed update, returns a nonzero status, and proceeds with deletions when updates succeed.

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

Mô tả

Problem or use case

Some deployment workflows require all planned additions and updates to succeed before the same invocation starts deleting resources.

In the reviewed runPublish implementation, the CLI collects results from executePuts, then enters the requested delete phase without first checking those results for resource-level failures. Errors are aggregated afterward. This is different from a fatal exception or preflight failure that stops the invocation before deletion.

Version reviewed: @azure-tools/apiops-cli 1.0.4. This request is based on source review. The following is a synthetic failure scenario; no claim is made that it has been reproduced against APIM.

Example scenario

One commit:

  1. Updates Policy P to remove its reference to Named Value N.
  2. Deletes the artifact for N.
  3. Deletes the artifact for a separate, independently deletable managed resource R.

Incremental publish runs with --delete-unmatched. Suppose the update of P is recorded as a resource-level failure.

The delete phase can still be entered. A deletion of N might be rejected by APIM while references remain, but service-side reference checks do not provide a general "stop all deletions after an update failure" guarantee. A deletion of R is independent and might still succeed.

This complicates failure handling for workflows whose intended gate is that additions and updates must succeed before any requested deletions start.

Proposed solution

Provide an opt-in publish mode that skips the entire delete phase if any planned addition or update has a failed result.

Suggested behavior:

  • Finish or otherwise account for in-flight updates according to the existing execution model.
  • Check the collected update results before scheduling deletions.
  • If an update failed, do not schedule any deletion, return a nonzero status, and clearly state why deletion was skipped.
  • Distinguish skipped deletions from successful deletions in human-readable and machine-readable output.

Normal informational skips should not automatically be treated as failures; their semantics should be documented.

An opt-in mode would allow existing best-effort behavior to remain compatible. This is a phase gate, not a request for rollback, an atomic transaction, or dependency-aware suppression of individual deletions.

Desired outcome

In the example above, a failed update of P prevents deletion attempts for both N and R. A run in which all planned updates succeed proceeds to its requested deletions.

Affected command

apiops publish --delete-unmatched, including incremental publish with --commit-id <sha>

References and related issues

Please clarify whether a newer release already has an equivalent gate.

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.