Skip to content

Component removal using package-url in filter.json does not work; documentation lacks examples #204

@maheshmurali1979

Description

@maheshmurali1979

Issue Description

Summary

When using RepositoryId (package-url / purl) in filter.json to remove components, capycli does not match or remove the component. The same filtering mechanism works when using other fields like Name, but purl-based matching does not trigger any removal.

There is also no documentation or examples showing how RepositoryId-based filtering is intended to work (exact match, prefix match, wildcards, etc.).

Filter File Used

The following is the exact filter.json used:

{
  "Components": [
    {
      "component": {
        "RepositoryId": "pkg:maven/it.softeco*"
      },
      "Mode": "remove"
    }
  ]
}

Observed Behavior

  • No components are removed from the SBOM.
  • Wildcard matching (*) has no effect.
  • Using RepositoryId alone results in zero matches, even when the SBOM contains components with purls like:
    pkg:maven/it.softeco.example/library@1.0.0

Expected Behavior

  • Components whose RepositoryId (purl) starts with or equals pkg:maven/it.softeco should be matched and removed.
  • capycli should support:
    • exact purl matching
    • wildcard/prefix matching (if intended)
  • RepositoryId filtering should behave consistently with Name/Version filtering.

Steps to Reproduce

  1. Use any SBOM (CycloneDX XML/JSON) containing Maven components whose purl begins with pkg:maven/it.softeco...
  2. Create the above filter.json.
  3. Run the capycli command that applies filters (e.g., components apply-filter or the equivalent).
  4. Observe that:
    • No components are matched.
    • The output SBOM is unchanged.

Actual Behavior

  • The component removal based on RepositoryId does not work.
  • No documentation describes whether:
    • RepositoryId is supported for filtering
    • purl needs to be exact or normalized
    • wildcards are supported for purl matching

Environment

capycli version: 2.10.1
Python version: 3.13.7
OS: Microsoft Windows [Version 10.0.22631.6649]
SBOM format: CycloneDX JSON

Requested Actions

  1. Confirm whether RepositoryId (purl) matching is officially supported in filters.
  2. If supported, fix the logic so purl-based filtering works correctly.
  3. Document how RepositoryId matching is supposed to work:
    • exact match?
    • prefix match?
    • wildcard support?
  4. Provide at least one example in the documentation showing valid RepositoryId-based filtering in filter.json.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions