Skip to content

[BUG] Extractor does not detect deleted Policy Fragments - stale artifacts remain in repo #842

@sonalk-optimus

Description

@sonalk-optimus

Release version

v6.0.2

Describe the bug

When a Policy Fragment is deleted from the APIM instance and the extractor pipeline is run, the extractor does not remove the corresponding Policy Fragment folder from the output artifacts. The PR created by the extractor shows no changes related to the deleted fragment. The stale artifact remains in the repository

Expected behavior

When a Policy Fragment exists in the repository but no longer exists in the source APIM instance, the extractor pipeline should:

Remove the corresponding artifact folder/files from the output so the PR reflects the deletion

Actual behavior

The extractor only writes artifacts for resources it finds in APIM. It does not compare the output against the existing repository contents. As a result:

  1. Deleted Policy Fragments remain in the repo as stale files
  2. The extractor PR shows zero changes related to the deletion

Reproduction Steps

  1. Create a Policy Fragment in the APIM portal
  2. Run the extractor pipeline - verify the policy fragment folder appears in the PR
  3. Merge the PR
  4. Delete the policy fragment from the APIM portal
  5. Run the extractor pipeline again
  6. Observe the PR - the policy fragment folder is not removed; no deletion is reflected in the diff

Metadata

Metadata

Assignees

No one assigned

    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