apiops icon indicating copy to clipboard operation
apiops copied to clipboard

[BUG] - Product - api association gets revoked, while extracting targeted apis and publishing those artifacts.

Open ParthVyas2912 opened this issue 1 year ago • 6 comments

Release version

v5.1.4

Describe the bug

When extracting only targeted api using "configuration.extractor.yaml", the api gets extracted correctly. The issue is that for the product assignment, only product assignment with that api is configured properly. For all the other products, the api connection gets removed in the extracted artifacts. And when we run publisher pipeline, it revokes the api-product association. This actually caused a small outage in our company as well. Below are detailed behavior.

When Extracting all artifacts: (Working as expected)

Here are the extracted artifacts.

image

When we publish the artifacts by using "Extract-all" extractor pipeline, the deployment to DEV and UAT environment works as expected as well.

image

Extracting only targeted apis:

But, when we extract selected api using "configuration.extractor.yaml" file. Here is the behavior.

"configuration.extractor.yaml" file

image

Selected Artifacts: Only – “mock-api” has been extracted under api folder, which is expected. image

Under products folder, all the product definitions are extracted, Here are all products that got extracted: (All products are here)

image

But only product associated with “mock-api” has that association. All other product-api associations are no longer there.

Products --> demo --> apis.json

image

Products --> unlimited --> apis.json

image

Now the issue is when we run publisher pipeline.

The previously established product --> api connection will be removed automatically, and only product --> api association will remain between "mock-api" (the api we selected using configuration.extractor.yaml)

image

All the other apis will now have no products. Here is one example. But its same for all other apis.

image

Basically api --> product association gets destroyed for all the other apis.

Expected behavior

When we run extract all, everything works as expected. When we run targeted extraction, expectation is that all the other products and api connection should not be destroyed. This can have major consequences, and it has potential to destroy all the consumer apps that call the apis in that apim instance.

Actual behavior

While selecting targeted api, the api-product connection gets broken for all the other apis and products except selected product.

Reproduction Steps

Have an apim instance with bunch of apis connected to few products. Run "Extractor" pipeline by selecting a subset of all apis using "configuration.extractor.yaml" file. Then run publisher pipeline, and see the behavior where all the other product-api association gets destroyed. Except the targeted one.

ParthVyas2912 avatar Apr 03 '24 19:04 ParthVyas2912

  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 Apr 03 '24 19:04 github-actions[bot]

Can you please search some of the outstanding issues that may have touched n the same issue?

@guythetechie is this is a known issue that you plan on addressing in the upcoming release?

waelkdouh avatar Apr 04 '24 01:04 waelkdouh

I am not able to find some outstanding issue that talk about this exact same issue. So, I decided to create a new one. Thanks

ParthVyas2912 avatar Apr 04 '24 16:04 ParthVyas2912

This will be fixed in the next release. See #245; not exactly the same issue, but related.

guythetechie avatar Apr 04 '24 16:04 guythetechie

@guythetechie Thanks for the confirmation, any idea on how can I register for a notification, when new release is available.?

ParthVyas2912 avatar Apr 04 '24 17:04 ParthVyas2912

@guythetechie Thanks for the confirmation, any idea on how can I register for a notification, when new release is available.?

Subscribe to the repository release notifications.

waelkdouh avatar Apr 04 '24 19:04 waelkdouh

we just tested under v6.0.0-rc1 and the issue has been resolved. Please test and let us know.

waelkdouh avatar Jul 03 '24 19:07 waelkdouh