Skip to content

Commit 95e0015

Browse files
authored
Add announcement template for stopping maintenance of an Alpine Linux release (#7068)
1 parent db5ac5c commit 95e0015

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

eng/announcement-templates/Render.cs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static class TemplateDefinitions
7070
private static readonly Dictionary<string, Func<TemplateContext>> s_templateContexts = new()
7171
{
7272
["alpine-floating-tag-update.md"] = AlpineFloatingTagTemplateParameters.ContextFactory,
73+
["alpine-remove-version.md"] = AlpineVersionEolTemplateParameters.ContextFactory,
7374
};
7475

7576
public static TemplateContext GetTemplateContext(FileInfo templateFileInfo)
@@ -188,6 +189,69 @@ public static AlpineFloatingTagTemplateParameters PromptForInput()
188189
}
189190
}
190191

192+
sealed record AlpineVersionEolTemplateParameters(
193+
string RemovedVersion,
194+
string ReplacementVersion,
195+
string NewestVersion,
196+
DateTime EolDate,
197+
DateTime ReplacementReleaseDate,
198+
string ReplacementDiscussionUrl,
199+
string DotnetExampleVersion1,
200+
string DotnetExampleVersion2)
201+
{
202+
public static Func<TemplateContext> ContextFactory { get; } = () =>
203+
{
204+
var model = PromptForInput();
205+
return new TemplateContext(model);
206+
};
207+
208+
public static AlpineVersionEolTemplateParameters PromptForInput()
209+
{
210+
var removedVersion = AnsiConsole.Prompt(
211+
new TextPrompt<string>("Alpine version being removed:")
212+
.DefaultValue("3.XX"));
213+
214+
var replacementVersion = AnsiConsole.Prompt(
215+
new TextPrompt<string>($"Primary Alpine version to upgrade to:")
216+
.DefaultValue("3.XX"));
217+
218+
var newestVersion = AnsiConsole.Prompt(
219+
new TextPrompt<string>("[grey][[Optional]][/] Newest Alpine version (if different from replacement):")
220+
.DefaultValue("")
221+
.AllowEmpty());
222+
223+
var eolDate = AnsiConsole.Prompt(
224+
new TextPrompt<DateOnly>($"Date Alpine {removedVersion} images stop being maintained:")
225+
.DefaultValue(DateOnly.GetPatchTuesday(0)));
226+
227+
var replacementReleaseDate = AnsiConsole.Prompt(
228+
new TextPrompt<DateOnly>($"When were Alpine {replacementVersion} images released?")
229+
.DefaultValue(DateOnly.GetPatchTuesday(-3)));
230+
231+
const string DiscussionQueryLink = "https://github.com/dotnet/dotnet-docker/discussions/categories/announcements?discussions_q=is%3Aopen+category%3AAnnouncements+alpine";
232+
var replacementDiscussionUrl = AnsiConsole.Prompt(
233+
new TextPrompt<string>($"Link to announcement for Alpine {replacementVersion} image release (see {DiscussionQueryLink}):"));
234+
235+
var dotnetExampleVersion1 = AnsiConsole.Prompt(
236+
new TextPrompt<string>("First .NET example version for tags:")
237+
.DefaultValue("8.0"));
238+
239+
var dotnetExampleVersion2 = AnsiConsole.Prompt(
240+
new TextPrompt<string>("Second .NET example version for tags:")
241+
.DefaultValue("9.0"));
242+
243+
return new AlpineVersionEolTemplateParameters(
244+
removedVersion,
245+
replacementVersion,
246+
newestVersion,
247+
eolDate.ToDateTime(TimeOnly.MinValue),
248+
replacementReleaseDate.ToDateTime(TimeOnly.MinValue),
249+
replacementDiscussionUrl,
250+
dotnetExampleVersion1,
251+
dotnetExampleVersion2);
252+
}
253+
}
254+
191255
internal static class DateOnlyExtensions
192256
{
193257
extension(DateOnly date)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# .NET Alpine {{ RemovedVersion }} images no longer maintained
2+
3+
.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 }}).
4+
5+
For more information, see our policies:
6+
7+
- [Supported platforms policy](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-platforms.md)
8+
- [Supported tags policy](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-tags.md#majorminor-net-version-alpine).
9+
10+
## Details
11+
12+
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.
13+
14+
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).

0 commit comments

Comments
 (0)