[Bug] Selective API operation extraction filter does not filter paths in specification.yaml

Open
#294 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
api, cli

Research direction

Start with the apiops extract entry point and the filter configuration at configuration/extractor.config.yaml. Compare how the operations allow-list is applied to artifacts/apis/api1/operations/ versus artifacts/apis/api1/specification.yaml. Done means the specification contains only the selected operation paths while excluded operation artifacts remain absent.

Written by the indexing model from the issue text.

Description

type:bug
Command that triggered the bug

apiops extract

Expected behavior

When an API is configured with an operations allow-list, the generated specification.yaml should contain only those selected operations.

For example:

apis:
  - api1:
      operations:
        - create-resources

If the api1 API contains create-resources and test, only create-resources should appear in: specification.yaml



### Actual behavior

The extractor correctly filters the individual operation artifacts. Only the selected operation is generated under:

artifacts/apis/api1/operations/

However, artifacts/apis/api1/specification.yaml still contains the other operations path.

As a result, publishing the extracted artifacts can create the excluded operation in the target APIM instance, even though it was not listed in the extractor filter.

This is the same behavior described in for the older apiops [Azure/apiops#854](https://github.com/Azure/apiops/issues/854).

### apiops CLI version

1.0.3

### Environment details

APIOps CLI package: @azure-tools/apiops-cli
APIOps CLI version: 1.0.3
Node.js: 22.x or later
Package installation: npm ci
Command: apiops extract
Filter option: --filter configuration/extractor.config.yaml

### CI/CD environment

Azure DevOps

### Is this bug blocking you?

Yes
Dominant language
TypeScript
Stars
29
Forks
10
Avg merge
1d 13h
Merged PRs (30d)
23

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.