Skip to content

Commit 716851a

Browse files
authored
List the versions that changed in package-version-bump PRs (#8518)
## Summary of changes Lists the package versions that were updated in the description of version-bump PRs ## Reason for change In #8504 we removed all the "honeypot" csproj files that dependabot was using, mostly because the PRs it was creating weren't very useful, were noisy, and required us to trigger a separate PR anyway, so we switched to a schedule. However, when reviewing the [[Test Package Versions Bump] PRs](#8502), these files were the main ones I was reviewing, as they were easy to read. As a workaround, this PR extends the "cool down report" to be a more generalized "bump report", that lists the changes to the packages that _were_ bumped too. We could extend this even further in the future to include release note changes (like dependabot does) or `dotnet inspect` updates, as we've discussed in the past, though I can also see those being overly noisy for the common cases. ## Implementation details Extend the existing report to include the list of packages that _were_ bumped too. ## Test coverage Ran it locally, and it produced the following: ## Package Version Updates Bold entries indicate **major**-version bumps. `(new)` means no previous version existed. | Package | Integration | Previous | New | Published | |---------|-------------|----------|-----|-----------| | AWSSDK.Core | AwsSdk | 4.0.3.30 | 4.0.3.31 | 2026-04-20 | | MongoDB.Driver | MongoDB | 3.7.1 | 3.8.0 | 2026-04-20 | | HotChocolate.AspNetCore | HotChocolate | 15.1.14 | 15.1.15 | 2026-04-22 | | MySql.Data | MySqlData | 9.6.0 | 9.7.0 | 2026-04-22 | | Microsoft.Data.Sqlite | MicrosoftDataSqlite | 10.0.6 | 10.0.7 | 2026-04-21 | | log4net | log4net | 3.3.0 | 3.3.1 | 2026-04-19 | | OpenTelemetry.Api | OpenTelemetry | 1.15.2 | 1.15.3 | 2026-04-21 | ## Package Version Cooldown Report The following versions were published less than **2 days** ago and have been overridden. These require manual review before inclusion. | Package | Integration | Overridden Version | Published | Age (days) | |---------|-------------|--------------------|-----------|------------| | AWSSDK.Core | AwsSdk | 3.7.500.96 | 2026-04-23 | 0 | | AWSSDK.Core | AwsSdk | 4.0.3.32 | 2026-04-22 | 1 | | AWSSDK.DynamoDBv2 | AwsDynamoDb | 3.7.513.2 | 2026-04-23 | 0 | | AWSSDK.DynamoDBv2 | AwsDynamoDb | 4.0.17.10 | 2026-04-22 | 1 | | AWSSDK.Kinesis | AwsKinesis | 3.7.506.19 | 2026-04-23 | 0 | | AWSSDK.Kinesis | AwsKinesis | 4.0.8.12 | 2026-04-22 | 1 | | AWSSDK.SQS | AwsSqs | 3.7.502.55 | 2026-04-23 | 0 | | AWSSDK.SQS | AwsSqs | 4.0.2.26 | 2026-04-22 | 1 | | AWSSDK.SimpleNotificationService | AwsSns | 3.7.502.59 | 2026-04-23 | 0 | | AWSSDK.SimpleNotificationService | AwsSns | 4.0.2.28 | 2026-04-22 | 1 | | AWSSDK.EventBridge | AwsEventBridge | 3.7.502.60 | 2026-04-23 | 0 | | AWSSDK.EventBridge | AwsEventBridge | 4.0.5.27 | 2026-04-22 | 1 | | AWSSDK.S3 | AwsS3 | 3.7.511.6 | 2026-04-23 | 0 | | AWSSDK.S3 | AwsS3 | 4.0.22 | 2026-04-22 | 1 | | AWSSDK.StepFunctions | AwsStepFunctions | 3.7.502.48 | 2026-04-23 | 0 | | AWSSDK.StepFunctions | AwsStepFunctions | 4.0.2.21 | 2026-04-22 | 1 |
1 parent 127ac2a commit 716851a

5 files changed

Lines changed: 196 additions & 123 deletions

File tree

.github/workflows/auto_bump_test_package_versions.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
- name: "Regenerating package versions"
3737
run: .\tracer\build.ps1 GeneratePackageVersions --PackageVersionCooldownDays 2
3838

39-
- name: Read cooldown report
40-
id: cooldown
39+
- name: Read bump report
40+
id: bump
4141
if: always()
4242
shell: pwsh
4343
run: |
4444
$report = ""
45-
$reportPath = ".nuke/temp/cooldown_report.md"
45+
$reportPath = ".nuke/temp/bump_report.md"
4646
if (Test-Path $reportPath) {
4747
$report = Get-Content $reportPath -Raw
4848
}
@@ -63,9 +63,9 @@ jobs:
6363
milestone: "${{steps.rename.outputs.milestone}}"
6464
labels: "area:dependabot,area:test-apps,dependencies"
6565
body: |
66-
Updates the package versions for integration tests.
66+
Updates the package versions for integration tests. See below for a summary of the changes.
6767
68-
${{ steps.cooldown.outputs.report }}
68+
${{ steps.bump.outputs.report }}
6969
7070
- name: Send Slack notification about generating failure
7171
if: failure()

tracer/build/_build/Build.Utilities.cs

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -282,61 +282,76 @@ static Func<string, CooldownMode> BuildCooldownModeSelector(string[] includePack
282282
foreach (var tested in testedVersions)
283283
{
284284
var packageName = tested.NugetPackageSearchName;
285-
var previousMax = versionGenerator
286-
.GetPreviouslyTestedVersions(tested.IntegrationName)
287-
.Where(v => v >= tested.MinVersion && v <= tested.MaxVersion)
288-
.OrderByDescending(v => v)
289-
.FirstOrDefault();
285+
var previouslyTested = versionGenerator.GetPreviouslyTestedVersions(tested.IntegrationName);
290286

291-
if (previousMax is null || tested.MaxVersion > previousMax)
287+
foreach (var selected in tested.SelectedVersions)
292288
{
293-
bumped++;
294-
var publishedDate = "(unknown)";
295-
if (queriedVersions.TryGetValue(packageName, out var versionsForPackage))
289+
// Compare per-slot: entries can have multiple selected versions (one per glob or
290+
// per major), e.g. AWSSDK.Core's 3.3.*, 3.*.*, 4.*.*. Bound the predecessor search
291+
// to same-major and <= selected so each slot's previous max is found independently
292+
// -- a 3.x backport is visible even when the 4.x slot is unchanged.
293+
var previousMax = previouslyTested
294+
.Where(v => v.Major == selected.Major && v <= selected)
295+
.OrderByDescending(v => v)
296+
.FirstOrDefault();
297+
298+
if (previousMax is null || selected > previousMax)
296299
{
297-
var match = versionsForPackage.FirstOrDefault(v => v.Version == tested.MaxVersion.ToString());
298-
if (match?.Published is not null)
300+
bumped++;
301+
DateTimeOffset? publishedDate = null;
302+
if (queriedVersions.TryGetValue(packageName, out var versionsForPackage))
299303
{
300-
publishedDate = match.Published.Value.UtcDateTime.ToString("yyyy-MM-dd");
304+
var match = versionsForPackage.FirstOrDefault(v => v.Version == selected.ToString());
305+
publishedDate = match?.Published;
301306
}
302-
}
303307

304-
Logger.Information(
305-
" {Package} {Previous} -> {Current} (published {Date}, https://www.nuget.org/packages/{Package}/{Current})",
306-
packageName,
307-
previousMax?.ToString() ?? "(new)",
308-
tested.MaxVersion,
309-
publishedDate,
310-
packageName,
311-
tested.MaxVersion);
312-
}
313-
else
314-
{
315-
unchanged++;
308+
versionGenerator.BumpReport.AddBump(new PackageBumpReport.BumpEntry(
309+
packageName,
310+
tested.IntegrationName,
311+
previousMax,
312+
selected,
313+
publishedDate));
314+
315+
Logger.Information(
316+
" {Package} {Previous} -> {Current} (published {Date}, https://www.nuget.org/packages/{Package}/{Current})",
317+
packageName,
318+
previousMax?.ToString() ?? "(new)",
319+
selected,
320+
publishedDate?.UtcDateTime.ToString("yyyy-MM-dd") ?? "(unknown)",
321+
packageName,
322+
selected);
323+
}
324+
else
325+
{
326+
unchanged++;
327+
}
316328
}
317329
}
318330

319331
Logger.Information("{Bumped} package(s) bumped, {Unchanged} unchanged", bumped, unchanged);
320332

321-
if (versionGenerator.CooldownReport.HasEntries)
333+
if (versionGenerator.BumpReport.CooldownEntries.Count > 0)
322334
{
323335
Logger.Warning(
324336
"{Count} package version(s) were excluded due to the {Days}-day cooldown period",
325-
versionGenerator.CooldownReport.Entries.Count,
337+
versionGenerator.BumpReport.CooldownEntries.Count,
326338
effectiveCooldownDays);
327339

328-
foreach (var entry in versionGenerator.CooldownReport.Entries)
340+
foreach (var entry in versionGenerator.BumpReport.CooldownEntries)
329341
{
330342
Logger.Warning(
331343
" {Package} {Version} overridden (published {Date})",
332344
entry.PackageName,
333345
entry.OverriddenVersion,
334346
entry.PublishedDate?.UtcDateTime.ToString("yyyy-MM-dd") ?? "unknown");
335347
}
348+
}
336349

337-
var reportPath = TemporaryDirectory / "cooldown_report.md";
338-
await versionGenerator.CooldownReport.SaveToFile(reportPath);
339-
Logger.Information("Cooldown report saved to {Path}", reportPath);
350+
if (versionGenerator.BumpReport.HasEntries)
351+
{
352+
var reportPath = TemporaryDirectory / "bump_report.md";
353+
await versionGenerator.BumpReport.SaveToFile(reportPath);
354+
Logger.Information("Bump report saved to {Path}", reportPath);
340355
}
341356

342357
var assemblies = MonitoringHomeDirectory

tracer/build/_build/GeneratePackageVersions/CooldownReport.cs

Lines changed: 0 additions & 81 deletions
This file was deleted.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// <copyright file="PackageBumpReport.cs" company="Datadog">
2+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
4+
// </copyright>
5+
6+
using System;
7+
using System.Collections.Generic;
8+
using System.IO;
9+
using System.Text;
10+
using System.Threading.Tasks;
11+
12+
namespace GeneratePackageVersions;
13+
14+
/// <summary>
15+
/// Collects the outcome of a package version regeneration run (packages that were
16+
/// bumped and packages that were skipped by the cooldown filter) and renders them
17+
/// as a markdown report for inclusion in the PR body.
18+
/// </summary>
19+
public class PackageBumpReport
20+
{
21+
private readonly int _cooldownDays;
22+
private readonly List<BumpEntry> _bumpedEntries = new();
23+
private readonly List<CooldownEntry> _cooldownEntries = new();
24+
25+
public PackageBumpReport(int cooldownDays)
26+
{
27+
_cooldownDays = cooldownDays;
28+
}
29+
30+
public bool HasEntries => _bumpedEntries.Count > 0 || _cooldownEntries.Count > 0;
31+
32+
public IReadOnlyList<BumpEntry> BumpedEntries => _bumpedEntries;
33+
34+
public IReadOnlyList<CooldownEntry> CooldownEntries => _cooldownEntries;
35+
36+
public void AddBump(BumpEntry entry)
37+
{
38+
_bumpedEntries.Add(entry);
39+
}
40+
41+
public void AddCooldown(CooldownEntry entry)
42+
{
43+
_cooldownEntries.Add(entry);
44+
}
45+
46+
public string ToMarkdown()
47+
{
48+
if (!HasEntries)
49+
{
50+
return string.Empty;
51+
}
52+
53+
var sb = new StringBuilder();
54+
55+
if (_bumpedEntries.Count > 0)
56+
{
57+
sb.AppendLine("## Package Version Updates");
58+
sb.AppendLine();
59+
sb.AppendLine("Bold entries indicate **major**-version bumps. `(new)` means no previous version existed.");
60+
sb.AppendLine();
61+
sb.AppendLine("| Package | Integration | Previous | New | Published |");
62+
sb.AppendLine("|---------|-------------|----------|-----|-----------|");
63+
64+
foreach (var entry in _bumpedEntries)
65+
{
66+
var previous = entry.PreviousVersion?.ToString() ?? "(new)";
67+
var newVersion = entry.IsMajorBump ? $"**{entry.NewVersion}**" : entry.NewVersion.ToString();
68+
var published = entry.PublishedDate?.UtcDateTime.ToString("yyyy-MM-dd") ?? "unknown";
69+
70+
sb.AppendLine($"| {entry.PackageName} | {entry.IntegrationName} | {previous} | {newVersion} | {published} |");
71+
}
72+
73+
sb.AppendLine();
74+
}
75+
76+
if (_cooldownEntries.Count > 0)
77+
{
78+
sb.AppendLine("## Package Version Cooldown Report");
79+
sb.AppendLine();
80+
sb.AppendLine($"The following versions were published less than **{_cooldownDays} days** ago and have been overridden.");
81+
sb.AppendLine("These require manual review before inclusion.");
82+
sb.AppendLine();
83+
sb.AppendLine("| Package | Integration | Overridden Version | Published | Age (days) |");
84+
sb.AppendLine("|---------|-------------|--------------------|-----------|------------|");
85+
86+
foreach (var entry in _cooldownEntries)
87+
{
88+
var published = entry.PublishedDate?.UtcDateTime.ToString("yyyy-MM-dd") ?? "unknown";
89+
var age = entry.PublishedDate.HasValue
90+
? ((int)(DateTimeOffset.UtcNow - entry.PublishedDate.Value).TotalDays).ToString()
91+
: "?";
92+
93+
sb.AppendLine($"| {entry.PackageName} | {entry.IntegrationName} | {entry.OverriddenVersion} | {published} | {age} |");
94+
}
95+
}
96+
97+
return sb.ToString();
98+
}
99+
100+
public async Task SaveToFile(string path)
101+
{
102+
var markdown = ToMarkdown();
103+
if (!string.IsNullOrEmpty(markdown))
104+
{
105+
// necessary to save to a file so that we can then output it in the PR description
106+
await File.WriteAllTextAsync(path, markdown);
107+
}
108+
}
109+
110+
public record BumpEntry(
111+
string PackageName,
112+
string IntegrationName,
113+
Version PreviousVersion,
114+
Version NewVersion,
115+
DateTimeOffset? PublishedDate)
116+
{
117+
public bool IsMajorBump => PreviousVersion is null || NewVersion.Major > PreviousVersion.Major;
118+
}
119+
120+
public record CooldownEntry(
121+
string PackageName,
122+
string IntegrationName,
123+
string OverriddenVersion,
124+
DateTimeOffset? PublishedDate);
125+
}

0 commit comments

Comments
 (0)