Scoped-delete semantics for --filter + --delete-unmatched

Open
#275 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
azure, typescript
Domain
api, cli

Research direction

Start with the apiops publish command and hasMutuallyExclusivePublishOptions, then review issue #215 for the existing fail-fast behavior. Define scoped-delete semantics for filtered artifact trees, including shared dependencies, and document or implement the agreed behavior so filtered create, update, and delete requests are correctly orchestrated.

Written by the indexing model from the issue text.

Description

type:feature
Problem or use case

In #215, combining --filter with --delete-unmatched was intentionally left to fail fast until
scoped-delete semantics are designed:

Combining --filter with --delete-unmatched should fail fast with a clear error until
scoped-delete semantics are designed.

Designing and enabling that combination would allow deletion tracking for a filtered subset of the
artifact tree, rather than requiring a full-tree --delete-unmatched run just to track any
deletions at all.

Proposed solution

Is there a plan or timeline for designing scoped-delete semantics, or a place to follow along?

As a workaround, expanding the following:

 export function hasMutuallyExclusivePublishOptions(
   deleteUnmatched: boolean,
   _commitId?: string,
   hasFilter = false
 ): boolean {
-  return deleteUnmatched && hasFilter;
+  return deleteUnmatched && hasFilter && !_commitId;
 }

produced correctly-scoped create/update/delete requests when tested against a simple,
self-contained API with no shared dependencies, but this doesn't address resources with shared dependencies that would need more thoughtful deletion orchestration.

Affected command

apiops publish

Dominant language
TypeScript
Stars
29
Forks
10
Avg merge
1d 14h
Merged PRs (30d)
22

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/apiops-cli

All issues in Azure/apiops-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.