diff --git a/eng/announcement-templates/Render.cs b/eng/announcement-templates/Render.cs index 5130aac672..a869334f65 100755 --- a/eng/announcement-templates/Render.cs +++ b/eng/announcement-templates/Render.cs @@ -70,6 +70,7 @@ static class TemplateDefinitions private static readonly Dictionary> s_templateContexts = new() { ["alpine-floating-tag-update.md"] = AlpineFloatingTagTemplateParameters.ContextFactory, + ["alpine-remove-version.md"] = AlpineVersionEolTemplateParameters.ContextFactory, }; public static TemplateContext GetTemplateContext(FileInfo templateFileInfo) @@ -188,6 +189,69 @@ public static AlpineFloatingTagTemplateParameters PromptForInput() } } +sealed record AlpineVersionEolTemplateParameters( + string RemovedVersion, + string ReplacementVersion, + string NewestVersion, + DateTime EolDate, + DateTime ReplacementReleaseDate, + string ReplacementDiscussionUrl, + string DotnetExampleVersion1, + string DotnetExampleVersion2) +{ + public static Func ContextFactory { get; } = () => + { + var model = PromptForInput(); + return new TemplateContext(model); + }; + + public static AlpineVersionEolTemplateParameters PromptForInput() + { + var removedVersion = AnsiConsole.Prompt( + new TextPrompt("Alpine version being removed:") + .DefaultValue("3.XX")); + + var replacementVersion = AnsiConsole.Prompt( + new TextPrompt($"Primary Alpine version to upgrade to:") + .DefaultValue("3.XX")); + + var newestVersion = AnsiConsole.Prompt( + new TextPrompt("[grey][[Optional]][/] Newest Alpine version (if different from replacement):") + .DefaultValue("") + .AllowEmpty()); + + var eolDate = AnsiConsole.Prompt( + new TextPrompt($"Date Alpine {removedVersion} images stop being maintained:") + .DefaultValue(DateOnly.GetPatchTuesday(0))); + + var replacementReleaseDate = AnsiConsole.Prompt( + new TextPrompt($"When were Alpine {replacementVersion} images released?") + .DefaultValue(DateOnly.GetPatchTuesday(-3))); + + const string DiscussionQueryLink = "https://github.com/dotnet/dotnet-docker/discussions/categories/announcements?discussions_q=is%3Aopen+category%3AAnnouncements+alpine"; + var replacementDiscussionUrl = AnsiConsole.Prompt( + new TextPrompt($"Link to announcement for Alpine {replacementVersion} image release (see {DiscussionQueryLink}):")); + + var dotnetExampleVersion1 = AnsiConsole.Prompt( + new TextPrompt("First .NET example version for tags:") + .DefaultValue("8.0")); + + var dotnetExampleVersion2 = AnsiConsole.Prompt( + new TextPrompt("Second .NET example version for tags:") + .DefaultValue("9.0")); + + return new AlpineVersionEolTemplateParameters( + removedVersion, + replacementVersion, + newestVersion, + eolDate.ToDateTime(TimeOnly.MinValue), + replacementReleaseDate.ToDateTime(TimeOnly.MinValue), + replacementDiscussionUrl, + dotnetExampleVersion1, + dotnetExampleVersion2); + } +} + internal static class DateOnlyExtensions { extension(DateOnly date) diff --git a/eng/announcement-templates/alpine-remove-version.md b/eng/announcement-templates/alpine-remove-version.md new file mode 100644 index 0000000000..6587658d28 --- /dev/null +++ b/eng/announcement-templates/alpine-remove-version.md @@ -0,0 +1,14 @@ +# .NET Alpine {{ RemovedVersion }} images no longer maintained + +.NET container images based on Alpine {{ RemovedVersion }} will no longer be maintained starting today, {{ EolDate | date: "%Y-%m-%d" }}, per our policy. Alpine {{ ReplacementVersion }} images [were released on {{ ReplacementReleaseDate | date: "%Y-%m-%d" }}]({{ ReplacementDiscussionUrl }}). + +For more information, see our policies: + +- [Supported platforms policy](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-platforms.md) +- [Supported tags policy](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-tags.md#majorminor-net-version-alpine). + +## Details + +Image tags containing `alpine{{ RemovedVersion }}` will no longer be updated. We will not delete existing {{ RemovedVersion }} images or tags, but they now contain unsupported builds of Alpine and .NET. + +If you are using one of the Alpine {{ RemovedVersion }} tags such as `{{ DotnetExampleVersion1 }}-alpine{{ RemovedVersion }}` or `{{ DotnetExampleVersion2 }}-alpine{{ RemovedVersion }}`, we recommend that you upgrade to Alpine {{ ReplacementVersion }}{% if NewestVersion != "" %} or Alpine {{ NewestVersion }}{% endif %}. Alternatively, you can use a floating tag for Alpine such as `{{ DotnetExampleVersion1 }}-alpine` or `{{ DotnetExampleVersion2 }}-alpine` which updates automatically according to the [supported tags policy](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-tags.md#majorminor-net-version-alpine).