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

[BUG] Publisher fails to remove apis with tags.json file #562

Closed
treysu opened this issue Jun 5, 2024 · 6 comments
Closed

[BUG] Publisher fails to remove apis with tags.json file #562

treysu opened this issue Jun 5, 2024 · 6 comments

Comments

@treysu
Copy link

treysu commented Jun 5, 2024

Release version

APIOps Toolkit for Azure APIM v5.1.4

Describe the bug

The 5.1.4 version APIM Publisher seems unable to locate tags.json files in APIs when deleting.

Expected behavior

When an API folder is deleted from the APIM artifacts and published (using Publish Latest Commit option), the Publisher should find and remove that API completely. This includes locating and removing all files.

Actual behavior

When an API folder is deleted from the APIM artifacts and published (using Publish Latest Commit option), the Publisher fails with an error when trying to locate the tags.json file of the API.

  System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/vsts/work/1/s/artifacts/apis/my-test-api/tags.json'.

Reproduction Steps

  1. Create a new API inside the artifacts/apis folder.
  2. Add a tags.json file to the API folder and link appropriate tags (create tags if required).
  3. Use the publisher to publish the artifacts and create the API inside APIM.
  4. Remove the entire API folder in one commit.
  5. Use the publisher to publish the latest commit.
  6. Get error message.
Copy link

github-actions bot commented Jun 5, 2024

  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.

@treysu
Copy link
Author

treysu commented Jun 5, 2024

Recently during a cleanup, we were using the Publisher to remove all APIM artifacts. We noticed that we were unable to delete any APIs that contained tags.json files.

@DamianSwierczek
Copy link

I encountered the same problem. It's trying to find the deleted tags.json file for some reason but in this case, it doesn't make sense to do it since publisher should just delete API.

@jonstones
Copy link

I've too am encountering a similar issue. It appears to be trying to navigate to the API Folder, before removing the file.
In the example at the top, this folder ( my-test-api ) won't exist, hence "Directory Not Found Exception".

@itssKrish
Copy link

The same behaviour is observed in my case too. As a temporary fix, I'm creating two PR's. In the first one, I delete tags.json file from api folder and in the other one, delete the entire folder itself. I hope we will get a permanent solution on this soon.

@guythetechie
Copy link
Contributor

Please try our latest release. We've changed the folder structure for related resources, and it should help with this issue. Search for Subfolder structure in our release notes.

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

No branches or pull requests

5 participants