Azure / apiops

APIOps applies the concepts of GitOps and DevOps to API deployment. By using practices from these two methodologies, APIOps can enable everyone involved in the lifecycle of API design, development, and deployment with self-service and automated tools to ensure the quality of the specifications and APIs that they’re building.
https://azure.github.io/apiops
MIT License
328 stars 193 forks source link

[BUG] Extractor pipeline still extracts unnecessary version sets instead of extracting only version set of API being extracted #626

Closed JamesProant closed 3 months ago

JamesProant commented 3 months ago

Release version

6.0.1

Describe the bug

When using extractor pipeline, all version sets are being extracted from all of our API's in the APIM instance, instead of only the version set of the specific API being extracted. Feature req-(https://github.com/Azure/apiops/issues/529#issuecomment-2207007896) was declared as solved, but same behavior is happening.

Expected behavior

Only version set of API being extracted should be added to artifacts.

Actual behavior

Every version set from our APIM instance is being extracted and added to artifacts.

Reproduction Steps

Run extractor pipeline for API-A. New branch with artifacts contains every version set for every API in APIM instance.

github-actions[bot] commented 3 months ago
  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.
guythetechie commented 3 months ago

We don't limit version sets by API because they can exist independently. A version set can have no API, one API, or multiple APIs.

To only extract specific version sets, update your configuration.extractor.yaml like this:

versionSetNames
- version-set-to-extract
JamesProant commented 3 months ago

Hello @guythetechie

Thank you for your quick reply.

I have tried adding that parameter to the configuration.extractor.yaml file, but it seems to not work properly. In fact whenever I add the parameter "versionSetNames" to the config file, the extractor no longer extracts any api artifacts at all.

Any idea why this behaviour is happening?

guythetechie commented 3 months ago

Sure.

If you put version set names under versionSetNames, we will only extract those version sets. We will also filter APIs and only extract APIs associated with those version sets.

Make sure that the names under versionSetNames match the version set names/IDs, not their display names. Easy way to see the correct names is to remove the version set filter in configuration.extractor.yaml, extract everything, and then look at the folder names in /artifacts/version sets/.

guythetechie commented 3 months ago

To expand on the API/version set filter relationship, we filter APIs like this:

ash9368 commented 3 weeks ago

only change i have to do in the configuration.extractor.yaml file to extract the API version or is there anything also i have to do