apiops icon indicating copy to clipboard operation
apiops copied to clipboard

[FEATURE REQ] Flag to disable extract of global policy

Open christopherhouse opened this issue 1 year ago • 2 comments

Please describe the feature.

The ApiOps documentation describes a model for supporting distributed API teams working with a single API Management set of resources. The approach describes each team having a dedicated repository and using the Extractor configuration file to control which APIM resources are extracted.

One challenge with this approach is that with the current implementation of the Extractor, each team would end up extracting APIM's global policy. This means teams could potentially introduce global policy changes that introduces issues for other teams using the same APIM. Ideally, customers should have the ability to disable extracting global policy. This would ensure each independent API team doesn't need to extract global policy and customers could have a central team that manages global policy through a separate repo.

christopherhouse avatar Jan 07 '25 19:01 christopherhouse

  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.

github-actions[bot] avatar Jan 07 '25 19:01 github-actions[bot]

@christopherhouse We ran into the same issue and solved the problem with this ps script below which you can add after the "run extractor" task in the run-extractor.yaml file:

Write-Host "Path set to: $artifactsFolderPath"

# Define the path to the policy.xml file
$globalPolicy = Join-Path -Path $artifactsFolderPath -ChildPath "policy.xml"

# Check if the policy.xml file exists
if (-not (Test-Path -Path $globalPolicy -PathType Leaf)) {
    Write-Host "Execution Failed: The policy.xml file does not exist at the specified path: $globalPolicy"
    exit
} else {
    Write-Host "Removing global/All APIs policy.xml file, as we work with a multi-repo/team approach"
    Remove-Item -Path $globalPolicy -Force
    Write-Host "Execution complete."
}

JamesProant avatar Feb 05 '25 10:02 JamesProant