Skip to content

Commit

Permalink
Remove the VMR component list generator
Browse files Browse the repository at this point in the history
This is not needed anymore (dotnet/sdk#45391) and only inflates the VMR size
  • Loading branch information
premun committed Dec 10, 2024
1 parent 4a445a7 commit 74a729c
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ await _vmrInitializer.InitializeRepository(
_options.Recursive,
new NativePath(_options.SourceMappings),
additionalRemotes,
_options.ComponentTemplate,
_options.TpnTemplate,
_options.GenerateCodeowners,
_options.GenerateCredScanSuppressions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ await _vmrUpdater.UpdateRepository(
barId: null,
_options.Recursive,
additionalRemotes,
_options.ComponentTemplate,
_options.TpnTemplate,
_options.GenerateCodeowners,
_options.GenerateCredScanSuppressions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ internal abstract class VmrSyncCommandLineOptions<T> : VmrCommandLineOptions<T>,
"Omitting REVISION will synchronize the repo to current HEAD.")]
public IEnumerable<string> Repositories { get; set; }

[Option("component-template", Required = false, HelpText = "Path to a template for generating VMRs Component.md file. Leave empty to skip generation.")]
public string ComponentTemplate { get; set; }

[Option("tpn-template", Required = false, HelpText = "Path to a template for generating VMRs THIRD-PARTY-NOTICES file. Leave empty to skip generation.")]
public string TpnTemplate { get; set; }

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public interface IVmrInitializer
/// <param name="initializeDependencies">When true, initializes dependencies (from Version.Details.xml) recursively</param>
/// <param name="sourceMappingsPath">Path to the source-mappings.json file</param>
/// <param name="additionalRemotes">Additional git remotes to use when fetching</param>
/// <param name="componentTemplatePath">Path to VMR's README.md template</param>
/// <param name="tpnTemplatePath">Path to VMR's THIRD-PARTY-NOTICES.md template</param>
/// <param name="generateCodeowners">Whether to generate a CODEOWNERS file</param>
/// <param name="generateCredScanSuppressions">Whether to generate a .config/CredScanSuppressions.json file</param>
Expand All @@ -33,7 +32,6 @@ Task InitializeRepository(
bool initializeDependencies,
LocalPath sourceMappingsPath,
IReadOnlyCollection<AdditionalRemote> additionalRemotes,
string? componentTemplatePath,
string? tpnTemplatePath,
bool generateCodeowners,
bool generateCredScanSuppressions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public interface IVmrUpdater
/// <param name="barId">Bar id of the build that's being flown, if applicable</param>
/// <param name="updateDependencies">When true, updates dependencies (from Version.Details.xml) recursively</param>
/// <param name="additionalRemotes">Additional git remotes to use when fetching</param>
/// <param name="componentTemplatePath">Path to VMR's Component.md template</param>
/// <param name="tpnTemplatePath">Path to VMR's THIRD-PARTY-NOTICES.md template</param>
/// <param name="generateCodeowners">Whether to generate a CODEOWNERS file</param>
/// <param name="generateCredScanSuppressions">Whether to generate a .config/CredScanSuppressions.json file</param>
Expand All @@ -36,7 +35,6 @@ Task<bool> UpdateRepository(
int? barId,
bool updateDependencies,
IReadOnlyCollection<AdditionalRemote> additionalRemotes,
string? componentTemplatePath,
string? tpnTemplatePath,
bool generateCodeowners,
bool generateCredScanSuppressions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ protected override async Task<bool> SameDirectionFlowAsync(
build.Id,
updateDependencies: false,
additionalRemotes: additionalRemotes,
componentTemplatePath: null,
tpnTemplatePath: _vmrInfo.VmrPath / VmrInfo.ThirdPartyNoticesTemplatePath,
generateCodeowners: false,
generateCredScanSuppressions: true,
Expand Down Expand Up @@ -303,7 +302,6 @@ await FlowCodeAsync(
build.Id,
updateDependencies: false,
additionalRemotes,
componentTemplatePath: null,
tpnTemplatePath: _vmrInfo.VmrPath / VmrInfo.ThirdPartyNoticesTemplatePath,
generateCodeowners: false,
generateCredScanSuppressions: false,
Expand Down Expand Up @@ -379,7 +377,6 @@ .. submodules.Select(s => s.Path).Distinct().Select(VmrPatchHandler.GetExclusion
build.Id,
updateDependencies: false,
additionalRemote,
componentTemplatePath: null,
tpnTemplatePath: _vmrInfo.VmrPath / VmrInfo.ThirdPartyNoticesTemplatePath,
generateCodeowners: false,
generateCredScanSuppressions: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public class VmrInfo : IVmrInfo
public const string IgnoreAttribute = "vmr-ignore";

// TODO (https://github.com/dotnet/arcade-services/issues/4186): Read these from source-mappings.json
public const string ComponentTemplatePath = "src/sdk/src/VirtualMonoRepo/Component.template.md";
public const string ThirdPartyNoticesTemplatePath = "src/sdk/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt";

public const string ComponentListPath = "Components.md";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public VmrInitializer(
IVersionDetailsParser versionDetailsParser,
IRepositoryCloneManager cloneManager,
IThirdPartyNoticesGenerator thirdPartyNoticesGenerator,
IComponentListGenerator readmeComponentListGenerator,
ICodeownersGenerator codeownersGenerator,
ICredScanSuppressionsGenerator credScanSuppressionsGenerator,
ILocalGitClient localGitClient,
Expand All @@ -65,7 +64,7 @@ public VmrInitializer(
ILogger<VmrUpdater> logger,
ISourceManifest sourceManifest,
IVmrInfo vmrInfo)
: base(vmrInfo, sourceManifest, dependencyTracker, patchHandler, versionDetailsParser, thirdPartyNoticesGenerator, readmeComponentListGenerator, codeownersGenerator, credScanSuppressionsGenerator, localGitClient, localGitRepoFactory, dependencyFileManager, barClient, fileSystem, logger)
: base(vmrInfo, sourceManifest, dependencyTracker, patchHandler, versionDetailsParser, thirdPartyNoticesGenerator, codeownersGenerator, credScanSuppressionsGenerator, localGitClient, localGitRepoFactory, dependencyFileManager, barClient, fileSystem, logger)
{
_vmrInfo = vmrInfo;
_barClient = barClient;
Expand All @@ -84,7 +83,6 @@ public async Task InitializeRepository(
bool initializeDependencies,
LocalPath sourceMappingsPath,
IReadOnlyCollection<AdditionalRemote> additionalRemotes,
string? componentTemplatePath,
string? tpnTemplatePath,
bool generateCodeowners,
bool generateCredScanSuppressions,
Expand Down Expand Up @@ -154,7 +152,6 @@ public async Task InitializeRepository(
await InitializeRepository(
update,
additionalRemotes,
componentTemplatePath,
tpnTemplatePath,
generateCodeowners,
generateCredScanSuppressions,
Expand Down Expand Up @@ -184,7 +181,6 @@ await InitializeRepository(
private async Task InitializeRepository(
VmrDependencyUpdate update,
IReadOnlyCollection<AdditionalRemote> additionalRemotes,
string? componentTemplatePath,
string? tpnTemplatePath,
bool generateCodeowners,
bool generateCredScanSuppressions,
Expand Down Expand Up @@ -223,7 +219,6 @@ await UpdateRepoToRevisionAsync(
author: null,
commitMessage,
restoreVmrPatches: false,
componentTemplatePath,
tpnTemplatePath,
generateCodeowners,
generateCredScanSuppressions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public abstract class VmrManagerBase
private readonly IVmrPatchHandler _patchHandler;
private readonly IVersionDetailsParser _versionDetailsParser;
private readonly IThirdPartyNoticesGenerator _thirdPartyNoticesGenerator;
private readonly IComponentListGenerator _componentListGenerator;
private readonly ICodeownersGenerator _codeownersGenerator;
private readonly ICredScanSuppressionsGenerator _credScanSuppressionsGenerator;
private readonly ILocalGitClient _localGitClient;
Expand All @@ -48,7 +47,6 @@ protected VmrManagerBase(
IVmrPatchHandler vmrPatchHandler,
IVersionDetailsParser versionDetailsParser,
IThirdPartyNoticesGenerator thirdPartyNoticesGenerator,
IComponentListGenerator componentListGenerator,
ICodeownersGenerator codeownersGenerator,
ICredScanSuppressionsGenerator credScanSuppressionsGenerator,
ILocalGitClient localGitClient,
Expand All @@ -65,7 +63,6 @@ protected VmrManagerBase(
_patchHandler = vmrPatchHandler;
_versionDetailsParser = versionDetailsParser;
_thirdPartyNoticesGenerator = thirdPartyNoticesGenerator;
_componentListGenerator = componentListGenerator;
_codeownersGenerator = codeownersGenerator;
_credScanSuppressionsGenerator = credScanSuppressionsGenerator;
_localGitClient = localGitClient;
Expand All @@ -83,7 +80,6 @@ public async Task<IReadOnlyCollection<VmrIngestionPatch>> UpdateRepoToRevisionAs
(string Name, string Email)? author,
string commitMessage,
bool restoreVmrPatches,
string? componentTemplatePath,
string? tpnTemplatePath,
bool generateCodeowners,
bool generateCredScanSuppressions,
Expand Down Expand Up @@ -115,11 +111,6 @@ public async Task<IReadOnlyCollection<VmrIngestionPatch>> UpdateRepoToRevisionAs

_dependencyInfo.UpdateDependencyVersion(update);

if (componentTemplatePath != null)
{
await _componentListGenerator.UpdateComponentList(componentTemplatePath);
}

var filesToAdd = new List<string>
{
VmrInfo.GitInfoSourcesDir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ private static IServiceCollection AddVmrManagers(
services.TryAddTransient<IVmrRepoVersionResolver, VmrRepoVersionResolver>();
services.TryAddTransient<IWorkBranchFactory, WorkBranchFactory>();
services.TryAddTransient<IThirdPartyNoticesGenerator, ThirdPartyNoticesGenerator>();
services.TryAddTransient<IComponentListGenerator, ComponentListGenerator>();
services.TryAddTransient<ICodeownersGenerator, CodeownersGenerator>();
services.TryAddTransient<ICredScanSuppressionsGenerator, CredScanSuppressionsGenerator>();
services.TryAddTransient<IFileSystem, FileSystem>();
Expand Down
Loading

0 comments on commit 74a729c

Please sign in to comment.