Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG] API's with revisions are not being set to current.

オープン
#646 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
azure, csharp
領域
api, cloud

調査の方向性

tools/code/publisher/Api.cs の369行目付近から始め、CorrectApimRevisionNumber を追跡し、そのリビジョンチェックを API の apiInformation.json の isCurrent 値と比較します。説明されている Azure APIM の抽出および公開フローを再現し、その後、アーティファクトで現在のものとしてマークされたリビジョンがデプロイ後も現在のままであることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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.

image

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.

image

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:

  1. Create an API with a single operation.
  2. Revision the API.
  3. Create another operation in that new revision.
  4. Set the second revision as current (Make current).
  5. Extract the APIM instance.
  6. Delete all APIs or create another new APIM instance.
  7. Publish the extracted artifacts to the cleaned or new APIM instance.

You should see that revision 1 is incorrectly set as current.

主要言語
C#
スター
448
フォーク
247
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/apiops のほかの issue

Azure/apiops の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。