Skip to content

Commit 548dcc9

Browse files
lbussellCopilot
andauthored
Add automatic KB/LCU download URL fetching in UpdateDependencies (#1251)
Co-authored-by: Copilot <[email protected]>
1 parent b5b62ed commit 548dcc9

11 files changed

+469
-383
lines changed

Microsoft.DotNet.Framework.Docker.sln

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Framework.UpdateDependencies", "eng\update-dependencies\Microsoft.DotNet.Framework.UpdateDependencies.csproj", "{41061718-0920-4131-A70C-F52E46C89E31}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Framework.Docker.Tests", "tests\Microsoft.DotNet.Framework.Docker.Tests\Microsoft.DotNet.Framework.Docker.Tests.csproj", "{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Debug|x64 = Debug|x64
14+
Debug|x86 = Debug|x86
15+
Release|Any CPU = Release|Any CPU
16+
Release|x64 = Release|x64
17+
Release|x86 = Release|x86
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{41061718-0920-4131-A70C-F52E46C89E31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{41061718-0920-4131-A70C-F52E46C89E31}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{41061718-0920-4131-A70C-F52E46C89E31}.Debug|x64.ActiveCfg = Debug|Any CPU
23+
{41061718-0920-4131-A70C-F52E46C89E31}.Debug|x64.Build.0 = Debug|Any CPU
24+
{41061718-0920-4131-A70C-F52E46C89E31}.Debug|x86.ActiveCfg = Debug|Any CPU
25+
{41061718-0920-4131-A70C-F52E46C89E31}.Debug|x86.Build.0 = Debug|Any CPU
26+
{41061718-0920-4131-A70C-F52E46C89E31}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{41061718-0920-4131-A70C-F52E46C89E31}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{41061718-0920-4131-A70C-F52E46C89E31}.Release|x64.ActiveCfg = Release|Any CPU
29+
{41061718-0920-4131-A70C-F52E46C89E31}.Release|x64.Build.0 = Release|Any CPU
30+
{41061718-0920-4131-A70C-F52E46C89E31}.Release|x86.ActiveCfg = Release|Any CPU
31+
{41061718-0920-4131-A70C-F52E46C89E31}.Release|x86.Build.0 = Release|Any CPU
32+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Debug|x64.ActiveCfg = Debug|Any CPU
35+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Debug|x64.Build.0 = Debug|Any CPU
36+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Debug|x86.ActiveCfg = Debug|Any CPU
37+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Debug|x86.Build.0 = Debug|Any CPU
38+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Release|x64.ActiveCfg = Release|Any CPU
41+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Release|x64.Build.0 = Release|Any CPU
42+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Release|x86.ActiveCfg = Release|Any CPU
43+
{ACB9C5B2-6D27-4487-94A1-6F397AC4D733}.Release|x86.Build.0 = Release|Any CPU
44+
EndGlobalSection
45+
GlobalSection(SolutionProperties) = preSolution
46+
HideSolutionNode = FALSE
47+
EndGlobalSection
48+
EndGlobal

eng/update-dependencies/CustomFileRegexUpdater.cs

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

eng/update-dependencies/DependencyUpdater.cs

Lines changed: 0 additions & 189 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace Microsoft.DotNet.Framework.UpdateDependencies;
6+
7+
/// <summary>
8+
/// Provides access to a collection of named variables that can be retrieved
9+
/// and modified. Variables support recursive resolution, allowing one variable
10+
/// to reference another using the $(variableName) syntax.
11+
/// </summary>
12+
internal interface IVariableContext
13+
{
14+
/// <summary>
15+
/// Retrieves or updates a variable by name. When retrieving, any embedded
16+
/// variable references are resolved recursively. When setting, the
17+
/// underlying content is updated to reflect the change.
18+
/// </summary>
19+
/// <param name="key">
20+
/// The name of the variable to access.
21+
/// </param>
22+
/// <returns>
23+
/// The resolved value of the variable, or an empty string if not found.
24+
/// </returns>
25+
string this[string key] { get; set; }
26+
27+
/// <summary>
28+
/// Enumerates all available variable names in this context.
29+
/// </summary>
30+
IEnumerable<string> AllVariables { get; }
31+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace Microsoft.DotNet.Framework.UpdateDependencies;
6+
7+
internal interface IVariableUpdater
8+
{
9+
/// <summary>
10+
/// Determines whether a variable should be updated based on its name.
11+
/// </summary>
12+
/// <param name="variableKey">
13+
/// The name of the variable being checked for update eligibility.
14+
/// </param>
15+
/// <param name="variables">
16+
/// All variables in the current context, in case the updater needs to
17+
/// reference other variables when determining if an update is needed.
18+
/// </param>
19+
/// <returns>
20+
/// True if the variable should be updated.
21+
/// </returns>
22+
bool ShouldUpdate(string variableKey, IVariableContext variables);
23+
24+
/// <summary>
25+
/// Computes a new value for a variable based on its current name and the
26+
/// surrounding context. This method is only called for variables whose
27+
/// names match the <see cref="KeyPattern"/>.
28+
/// </summary>
29+
/// <param name="variableKey">
30+
/// The name of the variable being updated.
31+
/// </param>
32+
/// <param name="variables">
33+
/// All variables in the current context. Used to reference other variables
34+
/// when generating a new value.
35+
/// </param>
36+
/// <returns>
37+
/// The new value that should be assigned to the variable.
38+
/// </returns>
39+
Task<string> GetNewValueAsync(string variableKey, IVariableContext variables);
40+
}

0 commit comments

Comments
 (0)