From a3b6f9ec05733871c0d0c9e998c36bef1bc2ca34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 18 Dec 2024 18:37:26 +0100 Subject: [PATCH] Configure Renovate to update .NET framework-specific packages in a .NET framework-aware way (Lombiq Technologies: OCORE-218) (#17249) --- ...targetframeworks.md => target_frameworks.md} | 15 +++++++++++++++ renovate.json5 | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) rename .github/ISSUE_TEMPLATE/{targetframeworks.md => target_frameworks.md} (58%) diff --git a/.github/ISSUE_TEMPLATE/targetframeworks.md b/.github/ISSUE_TEMPLATE/target_frameworks.md similarity index 58% rename from .github/ISSUE_TEMPLATE/targetframeworks.md rename to .github/ISSUE_TEMPLATE/target_frameworks.md index 83b5b157d7f..d5628bfa8f8 100644 --- a/.github/ISSUE_TEMPLATE/targetframeworks.md +++ b/.github/ISSUE_TEMPLATE/target_frameworks.md @@ -17,3 +17,18 @@ Use the minimal SDK version required, the `rollForward` rule will pick the lates - [ ] Update docker file base images. - [ ] Update documentation pages specifying a TFM (search for ``). - [ ] Add a note about the supported .NET versions to the upcoming release notes. +- [ ] When dual-targeting framework versions, configure Renovate in the `renovate.json5` file (in the repository root) to update packages targeting the older framework only up to their compatible versions. An example package rule for the `packageRules` section that will update the <9.0.0 (i.e. 8.x) version of the matching packages only up to 8.x: + ```json5 + { + // The .NET 8 versions of these packages need to stay on 8.x. We maintain a separate reference to the + // .NET 9 versions in Directory.Packages.props, which is only active when building for .NET 9. + matchPackageNames: [ + '/^Microsoft\\.AspNetCore.*$/', + '/^Microsoft\\.Extensions.*$/', + 'Serilog.AspNetCore', + 'System.Text.Json', + ], + allowedVersions: '<9.0.0', + matchCurrentVersion: '<9.0.0', + } + ``` diff --git a/renovate.json5 b/renovate.json5 index 65ede691523..766ff693dba 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -9,9 +9,22 @@ // See https://docs.renovatebot.com/configuration-options/#configmigration. configMigration: true, packageRules: [ + // Disable certain updates. { + // The .NET 8 versions of these packages need to stay on 8.x. We maintain a separate reference to the + // .NET 9 versions in Directory.Packages.props, only active when building for .NET 9. + matchPackageNames: [ + '/^Microsoft\\.AspNetCore.*$/', + '/^Microsoft\\.Extensions.*$/', + 'Serilog.AspNetCore', + 'System.Text.Json', + ], + allowedVersions: '<9.0.0', + matchCurrentVersion: '<9.0.0', + }, + { + // See the corresponding comment in Directory.Packages.props. matchPackageNames: [ - // See the corresponding comment in Directory.Packages.props. 'System.Drawing.Common', ], enabled: false, @@ -85,5 +98,5 @@ schedule: [ 'before 5am on Sunday', ], - labels: ['dependencies'], + addLabels: ['dependencies'], }