Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When extracting just an api via the config.yaml file, the global policy xml file is extracted as well and shouldn't be. #586

Open
karlrissland opened this issue Jul 12, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@karlrissland
Copy link

Release version

v6.0.0-alpha.1.0.8

Describe the bug

My config.yaml is set to only extract an api as follows;

`
apiNames:

  • demo-conference-api

versionSetNames:

backendNames: [ignore]

diagnosticNames: [ignore]

loggerNames: [ignore]

namedValueNames: [ignore]

productNames: [ignore]

subscriptionNames: [ignore]

tagNames: [ignore]

policyFragmentNames: [ignore]

gatewayNames: [ignore]

groupNames: [ignore]
`

Expected behavior

I expect only the API specification, the API apim config, the api policy, and the api operation policies to be extracted. In this use case, the developer should only be able to work with the api and it's specific policies.

Actual behavior

Unfortunately, the global policy is also extracted along with the api and it's policies.

Reproduction Steps

Setup an config.yaml file to extract just one api, run the extractor, not that the api and it's policies are extracted and the global policy is also extracted.

Copy link

  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.

@rubenaster
Copy link

And what's even worse is that without this policy.xml file the publisher wants to delete the current policy - fortunately in our case this raises a 403 - but that's the least sensible behavior I would expect when I only define a single extracted API.

@waelkdouh
Copy link
Contributor

Will take a look and get back to you.

@waelkdouh waelkdouh added the question Further information is requested label Jul 26, 2024
@guythetechie
Copy link
Contributor

API filters only affect items related to specific APIs. Service-level policies sit above APIs and aren't impacted by API filters. Just like product-level policies wouldn't be affected by API filters; if you only extract ApiA, the policy for productB would still be extracted.

If you want to specifically exclude service-level policies, your best bet would be to add a .gitignore entry for rootpath/policy.xml.

@waelkdouh waelkdouh closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
@waelkdouh waelkdouh reopened this Jul 26, 2024
@waelkdouh waelkdouh added enhancement New feature or request and removed question Further information is requested labels Jul 26, 2024
@waelkdouh
Copy link
Contributor

And what's even worse is that without this policy.xml file the publisher wants to delete the current policy - fortunately in our case this raises a 403 - but that's the least sensible behavior I would expect when I only define a single extracted API.

Please post here a format of the configuration file that you think would make sense if we were to expand support filtering global level artifacts.

@rubenaster
Copy link

And what's even worse is that without this policy.xml file the publisher wants to delete the current policy - fortunately in our case this raises a 403 - but that's the least sensible behavior I would expect when I only define a single extracted API.

Update: My bad, I had a combination of removing the policy.xml from the last commit and using the last_commit setting, so it made sense. I currently have a FileRemove task that cleans up specific files, but I'll provide an idea for a configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants