Skip to content

Commit df38978

Browse files
authored
Merge branch 'main' into UseNETCoreAppTasks
2 parents 4ccb2a3 + a91f694 commit df38978

File tree

9 files changed

+123
-128
lines changed

9 files changed

+123
-128
lines changed

.vault-config/dnceng-partners-kv.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ secrets:
7171
location: EngKeyVault
7272
gitHubBotAccountName: dotnet-bot
7373

74+
# repo, workflow scopes (classic token)
75+
BotAccount-dotnet-renovate-bot-PAT:
76+
type: github-access-token
77+
parameters:
78+
gitHubBotAccountSecret:
79+
name: BotAccount-dotnet-renovate-bot
80+
location: EngKeyVault
81+
gitHubBotAccountName: dotnet-renovate-bot
82+
7483
roslyn-dn-bot-devdiv-build-r-release-r-code-r:
7584
type: azure-devops-access-token
7685
parameters:

.vault-config/product-builds-engkeyvault.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ secrets:
2222
parameters:
2323
Name: dotnet-bot
2424

25+
BotAccount-dotnet-renovate-bot:
26+
type: github-account
27+
parameters:
28+
Name: dotnet-renovate-bot
29+
2530
#Publish-Build-Assets
2631
BotAccount-dotnet-maestro-bot-PAT:
2732
type: github-access-token

Documentation/Renovate.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Renovate Dependency Update Tool
2+
3+
## Introduction
4+
5+
This document outlines the integration of [Renovate](https://github.com/renovatebot/renovate) into Arcade to automate dependency updates.
6+
Renovate is an automated dependency update tool that generates PRs for updating dependencies from a wide variety of sources.
7+
8+
Renovate is similar to Dependabot in its purpose.
9+
Dependabot should be used when possible.
10+
However, Renovate supports a much broader range of [dependency types](https://docs.renovatebot.com/modules/datasource/), most notably Docker and GitHub releases.
11+
For example, Renovate can automatically generate a PR to update a referenced Docker image when a newer version is available.
12+
13+
### Example Scenarios
14+
15+
Here are two scenarios demonstrating the usefulness of Renovate automatically making dependency updates:
16+
17+
#### Container Tags
18+
19+
Repos that reference container tags from the [dotnet/dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repo need to maintain those tags to ensure they are supported.
20+
21+
This can be as simple as automatically updating to a new major version of Linux distro:
22+
23+
```diff
24+
-mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-helix-amd64
25+
+mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64
26+
```
27+
28+
Or automatically pinning to the latest version of a tag by it's digest value:
29+
30+
```diff
31+
-mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64@sha256:b99da50c4cb425e72ee69c2b8c1fdf99e0f71059aee19798e2f9310141ea48fb
32+
+mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64@sha256:6bb6fef390e6f09a018f385e346b0fe5999d7662acd84ca2655e9a3c3e622b71
33+
```
34+
35+
Renovate can detect when these new container images are available and submit PRs to update sources accordingly.
36+
37+
Related issue: [Automatically update image references in consuming repos (#1321)](https://github.com/dotnet/dotnet-buildtools-prereqs-docker/issues/1321)
38+
39+
#### GitHub Release
40+
41+
There are many cases where a version of OSS published via GitHub releases is being referenced by a .NET repository.
42+
Those versions can be kept updated automatically as new releases occur.
43+
44+
For example, there are Dockerfiles in the [dotnet/dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repo which reference the LLVM version that can be maintained by having Renovate automatically check for new [LLVM releases](https://github.com/llvm/llvm-project/releases).
45+
46+
```diff
47+
-LLVM_VERSION=19.1.7
48+
+LLVM_VERSION=20.1.0
49+
```
50+
51+
## Design
52+
53+
### Fork Mode
54+
55+
Protecting GitHub repositories in the dotnet organization from direct access by the Renovate tool is crucial.
56+
Renovate will be used in fork mode, limiting its permissions to forked repositories.
57+
This avoids giving write permissions to Renovate on any dotnet repository.
58+
This means that Renovate acts as though it's any other outside contributor, not requiring any special permissions in the dotnet organization or repositories.
59+
60+
A GitHub bot account, `dotnet-renovate-bot`, is used to manage the Renovate operations.
61+
This account has the ability to create forks from dotnet repositories, which will be the source of the head branch for PRs that are created.
62+
The PRs generated by Renovate will be done using this bot account.
63+
Renovate also handles synchronization from the upstream branch automatically.
64+
GitHub scopes required by this account: `repo`, `workflow`.
65+
66+
### Repo Usage
67+
68+
Arcade provides an Azure DevOps pipeline YAML job template that repositories should utilize when making use of Renovate.
69+
This template handles the execution of Renovate, ensuring a standardized approach across all repositories.
70+
Repositories wishing to make use of Renovate can reference this template from a pipeline YAML file, setting the schedule trigger as desired.
71+
Consuming repositories are responsible for providing their own [Renovate configuration file](https://docs.renovatebot.com/configuration-options/) that describes which dependencies should be updated.
72+
73+
Repositories are in control of how often Renovate will run via the pipeline schedule trigger (once a day, once a week, etc).
74+
Typically, a pipeline would be configured to update all dependencies at once in which case all dependencies are described in one Renovate config file.
75+
But in some cases, it may be desired to have certain dependencies updated on a different schedule than others.
76+
In that case, the repo maintainer would define multiple pipelines with those separate schedules, all configured to run Renovate.
77+
Importantly, each of those pipelines would need to reference a separate Renovate config file which defines the scope of the updates that will be targeted.
78+
Lastly, a maintainer is free to manually run the pipeline if an expected update is needed right away.
79+
80+
## Renovate Configuration Patterns
81+
82+
TBD

eng/common/core-templates/job/source-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
pool:
6161
${{ if eq(variables['System.TeamProject'], 'public') }}:
6262
name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')]
63-
demands: ImageOverride -equals build.ubuntu.2204.amd64
63+
demands: ImageOverride -equals Azure-Linux-3-Amd64-Public
6464
${{ if eq(variables['System.TeamProject'], 'internal') }}:
6565
name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore1ESPool-Svc-Internal'), False, 'NetCore1ESPool-Internal')]
6666
image: Azure-Linux-3-Amd64
@@ -69,10 +69,10 @@ jobs:
6969
pool:
7070
${{ if eq(variables['System.TeamProject'], 'public') }}:
7171
name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')]
72-
demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open
72+
demands: ImageOverride -equals Azure-Linux-3-Amd64-Public
7373
${{ if eq(variables['System.TeamProject'], 'internal') }}:
7474
name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore1ESPool-Svc-Internal'), False, 'NetCore1ESPool-Internal')]
75-
demands: ImageOverride -equals Build.Ubuntu.2204.Amd64
75+
demands: ImageOverride -equals Azure-Linux-3-Amd64
7676
${{ if ne(parameters.platform.pool, '') }}:
7777
pool: ${{ parameters.platform.pool }}
7878

src/Microsoft.DotNet.Arcade.Sdk/tools/Sign.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<CertificatesSignInfo Include="MacDeveloperVNextHardenWithNotarization" MacCertificate="MacDeveloperVNextHarden" MacNotarizationAppName="dotnet" />
3333
<!-- Certificates Which support detached signatures -->
3434
<CertificatesSignInfo Include="LinuxSignTar" SupportsDetachedSignature="true" />
35+
<CertificatesSignInfo Include="LinuxSign500180PGP" SupportsDetachedSignature="true" />
3536
</ItemGroup>
3637

3738
<!-- Only publish packages that contain this build's Target RID in the name.

src/Microsoft.DotNet.Arcade.Sdk/tools/TargetingPacks.BeforeCommonTargets.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<Project>
22

33
<PropertyGroup>
4+
<!-- Update downlevel known packs when building from source in the VMR and targeting a non-current .NETCoreApp TFM. -->
45
<UpdateDownlevelKnownPacks Condition="'$(UpdateDownlevelKnownPacks)' == '' and
56
'$(DotNetBuildSourceOnly)' == 'true' and
7+
'$(DotNetBuildFromVMR)' == 'true' and
68
'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
79
'$(TargetFrameworkVersion)' != '' and
810
$([MSBuild]::VersionLessThan('$(TargetFrameworkVersion)', '$(BundledNETCoreAppTargetFrameworkVersion)'))">true</UpdateDownlevelKnownPacks>
@@ -153,4 +155,4 @@
153155
</KnownILLinkPack>
154156
</ItemGroup>
155157

156-
</Project>
158+
</Project>

src/Microsoft.DotNet.Arcade.Sdk/tools/TargetingPacks.targets

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)