Feature request: support an explicit base and target commit for incremental publish

未关闭
#345 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
azure, typescript
领域
cli, cloud

调研方向

Start with the referenced src/services/git-diff-service.ts implementation and the incremental publish guide to trace how --commit-id selects artifact changes and deletions. Then follow the apiops publish entry point and its dry-run output. Done means an explicit base and target select the net changes and deletions for that range, with the requested validation and dry-run details.

由索引模型根据 Issue 内容生成。

描述

Problem or use case

A deployment pipeline needs to promote all intended changes since the last successful deployment to a particular destination, not necessarily only the changes made by one commit.

In the reviewed implementation, --commit-id C selects the difference between C~1 and C. This is appropriate for publishing one commit when its parent is fully deployed, but does not cover releases that intentionally skip intermediate commits or batch several commits.

Version reviewed: @azure-tools/apiops-cli 1.0.4. This is a feature request based on documentation and source review. The following is a synthetic scenario, not a runtime reproduction.

Example scenario

Consider a linear history A -> B -> C:

  • A is the last successfully deployed commit.
  • B updates managed API X and removes the artifact for managed Product Y.
  • C updates managed API Z but does not change X or Y.
  • The pipeline intentionally skips deploying B and next deploys C.

With C checked out, incremental publish using --commit-id <C_SHA> --delete-unmatched considers B-to-C, not A-to-C. The intended change to X and deletion of Y are outside the selected difference.

Full publish without deletion does not address the missing deletion. Full publish with deletion is not an acceptable substitute when the destination contains resources outside the repository's management scope.

Proposed solution

Allow the caller to provide both an explicit comparison base and target commit, with the pipeline retaining the successful deployment SHA separately for each destination.

For the example above, publication should use the net A-to-C artifact changes and the actual files from C. Commit-scoped deletion should be computed from that same range, not from a comparison of the entire destination against repository contents.

Please document and validate:

  • The relationship between the target commit and checked-out artifact/override files.
  • The requirement that both commits and the required history are available.
  • The handling of invalid or unavailable commits, without silently reporting a successful no-op.
  • Whether the base must be an ancestor of the target, and how merge histories are treated.

The existing single-commit mode could remain unchanged for compatibility. No automatic discovery of deployment history is required; the pipeline can provide the base.

Desired outcome

Using A as the base and C as the target selects the intended update to X, deletion of Y, and update to Z. Unrelated destination resources remain untouched. Dry-run should display the selected base, target, updates, and deletions.

Affected command

apiops publish

References and related issues

If range publication is already supported in a newer release, please point to the relevant command and its deletion semantics.

主要语言
TypeScript
星标
44
派生
14
PR 合并指标
30 天内没有已合并 PR

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/apiops-cli 的其他 Issue

查看 Azure/apiops-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。