protected override ValidationResult PopulateSettings(SettingsContainer settings) { var baseResult = base.PopulateSettings(settings); if (!baseResult.IsSuccess) { return(baseResult); } var fileSettings = FileSettingsCache.GetSettings(); var endpoint = Concat.FirstValue(ApiEndpoint, fileSettings.Api, settings.SourceControlServerSettings.Repository?.ApiUri.ToString()); var forkMode = ForkMode ?? fileSettings.ForkMode; var platform = Platform ?? fileSettings.Platform; if (!Uri.TryCreate(endpoint, UriKind.Absolute, out var baseUri)) { return(ValidationResult.Failure($"Bad Api Base '{endpoint}'")); } try { var collaborationResult = CollaborationFactory.Initialise( baseUri, PersonalAccessToken, forkMode, platform); if (!collaborationResult.IsSuccess) { return(collaborationResult); } } #pragma warning disable CA1031 catch (Exception ex) #pragma warning restore CA1031 { return(ValidationResult.Failure(ex.Message)); } if (CollaborationFactory.Settings.Token == null) { return(ValidationResult.Failure("The required access token was not found")); } settings.UserSettings.ConsolidateUpdatesInSinglePullRequest = Concat.FirstValue(Consolidate, fileSettings.Consolidate, false); const int defaultMaxPackageUpdates = 3; settings.PackageFilters.MaxPackageUpdates = Concat.FirstValue(MaxPackageUpdates, fileSettings.MaxPackageUpdates, defaultMaxPackageUpdates); var defaultLabels = new List <string> { "nukeeper" }; settings.SourceControlServerSettings.Labels = Concat.FirstPopulatedList(Label, fileSettings.Label, defaultLabels); var deleteBranchAfterMergeValid = PopulateDeleteBranchAfterMerge(settings); if (!deleteBranchAfterMergeValid.IsSuccess) { return(deleteBranchAfterMergeValid); } return(ValidationResult.Success); }