[17.0] Document breaking change: Docker Swarm `UpdateConfig.MaxFailureRatio` changed from `string?` to `double?`

オープン 初心者向け
#2,129 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

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

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp, docker
領域
documentation

調査の方向性

Aspire 13.3 の What's New ページにある既存の破壊的変更の表を参考にしてください。Aspire 17.0 の What's New ページが追加されたら、Docker Swarm の UpdateConfig.MaxFailureRatio が string? から double? に変更されることを説明する行を追加し、移行例の変更前と変更後の値も記載してください。17.0 の項目で破壊的変更と数値の代入が明確に説明されていれば完了です。

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

説明

In Aspire 17.0, Aspire.Hosting.Docker.Resources.ServiceNodes.Swarm.UpdateConfig.MaxFailureRatio in the stable Aspire.Hosting.Docker package changed from string? to double?. This breaks both source and binary compatibility, so it should be listed in the 17.0 breaking changes.

Why it changed

The Compose publisher quotes every string value, so MaxFailureRatio = "0.3" was published as max_failure_ratio: "0.3". Docker Swarm requires a number and rejects that file:

services.my-service.deploy.update_config.max_failure_ratio must be a number

The string? property could never produce a deployable value. As a double?, it's published as max_failure_ratio: 0.3.

Impact

  • Source: assigning a string, such as MaxFailureRatio = "0.3", no longer compiles (CS0029).
  • Binary: assemblies compiled against 13.x that get or set the property throw MissingMethodException at run time.

Migration

Assign a number instead of a string:

using Aspire.Hosting.Docker.Resources.ServiceNodes.Swarm;

builder.AddContainer("my-service", "my-image:latest")
    .PublishAsDockerComposeService((resource, service) =>
    {
        service.Deploy = new Deploy
        {
            UpdateConfig = new UpdateConfig
            {
                MaxFailureRatio = 0.3 // Aspire 13.x: MaxFailureRatio = "0.3"
            }
        };
    });

Where to document

Add a row to the ⚠️ Breaking changes table on the 17.0 What's new page. There's no whats-new/aspire-17*.mdx on main yet. Aspire 13.3 listed a similar change (microsoft/aspire#15566, which changed Parallelism from string? to int?) as "Docker Swarm UpdateConfig property types changed" in aspire-13-3.mdx. For this entry, include the before and after values from the example above.

主要言語
MDX
スター
202
フォーク
99
平均マージ
2日 10時間
マージ済み PR(30日)
97

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

microsoft/aspire.dev のほかの issue

microsoft/aspire.dev の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

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

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