[BUG] API's with revisions are not being set to current.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with tools/code/publisher/Api.cs around line 369 and trace CorrectApimRevisionNumber, comparing its revision check with the API's apiInformation.json isCurrent value. Reproduce the described Azure APIM extraction and publishing flow, then verify that the revision marked current in the artifact remains current after deployment.
Written by the indexing model from the issue text.
Description
Release version
6.0.1.1
Describe the bug
The publishing of our APIM artifacts is failing once there's a reference to an API operation that only exists in the parent APIs second revision, even though the second revision should be the current revision. Looking at the APIs in Azure, I see that the first revision is set as current even though the APIs apiInformation.json file has it's isCurrent property set to true.
From what I can tell, looking at the code, the isCurrent value is being nulled out of the API Dto object to prevent occasional failures.
This causes the API to be initially deployed with out the isCurrent property set, defaulting to revision 1 as current.
I then noticed that there's a process in place to "correct" the revision number: CorrectApimRevisionNumber.
But, reviewing that code, I think I found a small bug preventing that process from correcting the revision numbers of revisioned APIs.
I could be wrong, but it appears that this would skip all revisioned APIs when assessing them for correction.
To test this, I cloned the repo and updated line 369 to:
if (ApiName.IsNotRevisioned(name))
After that, I ran it locally and it published successfully.
Expected behavior
I expect API revisions to be set correctly in accordance to the API's apiInformation.json file.
Actual behavior
Revisioned APIs do not have the correct revision set to current after deployment, causing failures when anything in the now non-current API is referenced.
Reproduction Steps
In a new APIM instance:
- Create an API with a single operation.
- Revision the API.
- Create another operation in that new revision.
- Set the second revision as current (
Make current). - Extract the APIM instance.
- Delete all APIs or create another new APIM instance.
- Publish the extracted artifacts to the cleaned or new APIM instance.
You should see that revision 1 is incorrectly set as current.
- Dominant language
- C#
- Stars
- 448
- Forks
- 247
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/apiops
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nightscout/nocturne#1425 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Difficulty 2/5 1-2 days Newbie friendliness 75/100
Altinn/altinn-auth#4143 ·