protected virtual Schedule CreateScheduleFromDefinition(BuildDefinition definition) { var bucket = definition.Id % TotalBuckets; var startHours = bucket / BucketsPerHour; var startMinutes = bucket % BucketsPerHour; var schedule = new Schedule { DaysToBuild = (ScheduleDays)31, // Schedule M-F ScheduleOnlyWithChanges = true, StartHours = FirstSchedulingHour + startHours, StartMinutes = startMinutes * BucketSizeInMinutes, TimeZoneId = "Pacific Standard Time", }; schedule.BranchFilters.Add($"+{Context.Branch}"); return(schedule); }
protected override Schedule CreateScheduleFromDefinition(BuildDefinition definition) { var bucket = definition.Id % TotalBuckets; var startHours = bucket / BucketsPerHour; var startMinutes = bucket % BucketsPerHour; var schedule = new Schedule { DaysToBuild = ScheduleDays.Saturday | ScheduleDays.Sunday, ScheduleOnlyWithChanges = true, StartHours = FirstSchedulingHour + startHours, StartMinutes = startMinutes * BucketSizeInMinutes, TimeZoneId = "Pacific Standard Time", }; schedule.BranchFilters.Add("+master"); return(schedule); }
private async Task ProcessSingleDefinition(BuildDefinition definition, IList <Guid> taskIds, IList <BuildDefinition> definitionsContainingTask) { switch (definition.Process.Type) { case ProcessType.Designer: if (SarchForTaskInDesignerProcess(taskIds, definition.Process as DesignerProcess)) { definitionsContainingTask.Add(definition); } break; case ProcessType.Yaml: if (await SearchForTaskInYamlDefinition(taskIds, definition.Process as YamlProcess, definition.Repository.Id)) { definitionsContainingTask.Add(definition); } break; } }
private async Task <WebApiTeam> EnsureTeamExists( BuildDefinition pipeline, string suffix, TeamPurpose purpose, IEnumerable <WebApiTeam> teams, bool persistChanges) { var result = teams.FirstOrDefault( team => { // Swallowing exceptions because parse errors on // free form text fields which might be non-yaml text // are not exceptional var metadata = YamlHelper.Deserialize <TeamMetadata>(team.Description, swallowExceptions: true); return(metadata?.PipelineId == pipeline.Id && metadata?.Purpose == purpose); }); if (result == default) { logger.LogInformation("Team Not Found Suffix = {0}", suffix); var teamMetadata = new TeamMetadata { PipelineId = pipeline.Id, Purpose = purpose, }; var newTeam = new WebApiTeam { Description = YamlHelper.Serialize(teamMetadata), // Ensure team name fits within maximum 64 character limit // https://docs.microsoft.com/en-us/azure/devops/organizations/settings/naming-restrictions?view=azure-devops#teams Name = StringHelper.MaxLength($"{pipeline.Name} -- {suffix}", MaxTeamNameLength), }; logger.LogInformation("Create Team for Pipeline PipelineId = {0} Purpose = {1}", pipeline.Id, purpose); if (persistChanges) { result = await service.CreateTeamForProjectAsync(pipeline.Project.Id.ToString(), newTeam); } } return(result); }
public void AddTriggers( BuildDefinition definition, CustomBuildDefinitionPayload payload) { if (payload.CITriggers != null) { foreach (var trg in payload.CITriggers) { var trigger = new ContinuousIntegrationTrigger(); trigger.BranchFilters.AddRange(trg.BranchFilter); trigger.PathFilters.AddRange(trg.PathFilter); trigger.SettingsSourceType = 1; trigger.BatchChanges = false; trigger.MaxConcurrentBuildsPerBranch = 1; trigger.PollingInterval = 0; definition.Triggers.Add(trigger); } } if (payload.ScheduleTriggers != null) { var schTriggers = new ScheduleTrigger { Schedules = new List <Schedule>() }; foreach (var trg in payload.ScheduleTriggers) { var sch = new Schedule(); sch.BranchFilters.AddRange(trg.BranchFilter); sch.StartHours = trg.Hours; sch.StartMinutes = trg.Minutes; sch.TimeZoneId = trg.TimeZone; sch.DaysToBuild = GetScheduleDay(trg.DayOfTheWeek); schTriggers.Schedules.Add(sch); } definition.Triggers.Add(schTriggers); } }
private bool EnsureReportBuildStatus(BuildDefinition definition) { var hasChanges = false; if (definition.Repository.Properties.TryGetValue(ReportBuildStatusKey, out var reportBuildStatusString)) { if (!bool.TryParse(reportBuildStatusString, out var reportBuildStatusValue) || !reportBuildStatusValue) { definition.Repository.Properties[ReportBuildStatusKey] = "true"; hasChanges = true; } } else { definition.Repository.Properties.Add(ReportBuildStatusKey, "true"); hasChanges = true; } return(hasChanges); }
public CITriggers GetCITriggers(BuildDefinition definition) { var result = new List <CITriggers>(); foreach (var trigger in definition.Triggers) { if (trigger is ContinuousIntegrationTrigger continuousIntegrationTrigger) { var t = new CITriggers { BranchFilter = continuousIntegrationTrigger.BranchFilters, PathFilter = continuousIntegrationTrigger.PathFilters }; return(t); } } return(null); }
public IEnumerable <EventRegistration> GetRegistrations(ModifiedFileModel modifiedFile) { List <EventRegistration> registrations = new List <EventRegistration>(); foreach (Subscription subscription in Subscriptions.GetSubscriptions(modifiedFile)) { BuildDefinition buildDefinition = GetBuildDefinition(subscription); string parameters = VsoParameterGenerator.GetParameters(subscription.VsoParameters); registrations.Add(new EventRegistration() { VsoInstance = buildDefinition.VsoInstance, VsoProject = buildDefinition.VsoProject, BuildDefinitionId = buildDefinition.BuildDefinitionId, VsoParameters = parameters }); } return(registrations); }
public async Task GetTaskGroup(BuildDefinition definition, CustomBuildDefinitionPayload payload) { var buildClient = await _azureClient.GetBuildClientAsync(); var tgClient = await _azureClient.GetTaskAgentAsync(); var taskGroups = await tgClient.GetTaskGroupsAsync(ProvisioningProject); var props = await buildClient.GetDefinitionPropertiesAsync(project : payload.Project, definition.Id); if (props == null || !props.ContainsKey("tg_name")) { throw new Exception("Build definition does not have the metadata necessary"); } var tgName = props["tg_name"] as string; var amount = taskGroups.Count(x => x.Name.Equals(tgName, StringComparison.CurrentCultureIgnoreCase)); if (amount > 1) { throw new Exception($"There are more than one TaskGroup with the name {tgName} in the provisioning repository"); } if (amount == 0) { throw new Exception($"There is no TaskGroup with the name {tgName} in the provisioning repository"); } var tg = taskGroups.FirstOrDefault(x => x.Name.Equals(tgName, StringComparison.InvariantCultureIgnoreCase)); if (tg != null) { payload.BuildTemplate = tg.Name; payload.TaskGroupRevision = tg.Revision.ToString(); } }
protected virtual Task <bool> ApplyConventionAsync(BuildDefinition definition, SdkComponent component) { bool hasChanges = false; if (EnsureVariableGroups(definition)) { hasChanges = true; } if (Context.SetManagedVariables && EnsureManagedVariables(definition, component)) { hasChanges = true; } if (EnsureReportBuildStatus(definition)) { hasChanges = true; } if (definition.Path != this.Context.DevOpsPath) { definition.Path = this.Context.DevOpsPath; hasChanges = true; } if (definition.Repository.Properties.TryGetValue(ReportBuildStatusKey, out var reportBuildStatusString)) { if (!bool.TryParse(reportBuildStatusString, out var reportBuildStatusValue) || !reportBuildStatusValue) { definition.Repository.Properties[ReportBuildStatusKey] = "true"; hasChanges = true; } } else { definition.Repository.Properties.Add(ReportBuildStatusKey, "true"); hasChanges = true; } return(Task.FromResult(hasChanges)); }
public async static void UpdateBuildDefinitionTrigger(string teamProject, int mainBuildId, int buildTriggerId) { var tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(collectionUrl)); var bhc = tpc.GetClient <BuildHttpClient>(); BuildDefinition buildDef = (await bhc.GetDefinitionAsync(teamProject, mainBuildId)); BuildDefinition buildDefTrigger = (await bhc.GetDefinitionAsync(teamProject, buildTriggerId)); BuildCompletionTrigger buildTriggerToAdd = new BuildCompletionTrigger(); List <string> branchFilters = new List <string>(); branchFilters.Add("+refs/heads/master"); buildTriggerToAdd.Definition = buildDefTrigger; buildTriggerToAdd.BranchFilters = branchFilters; buildTriggerToAdd.RequiresSuccessfulBuild = true; buildDef.Triggers.Add(buildTriggerToAdd); await bhc.UpdateDefinitionAsync(buildDef, teamProject); }
protected override async Task <bool> ApplyConventionAsync(BuildDefinition definition, SdkComponent component) { var hasChanges = await base.ApplyConventionAsync(definition, component); if (EnsureDefaultPullRequestTrigger(definition, overrideYaml: true, securePipeline: true)) { hasChanges = true; } if (EnsureDefaultCITrigger(definition)) { hasChanges = true; } if (!Context.NoSchedule && EnsureDefaultScheduledTrigger(definition)) { hasChanges = true; } return(hasChanges); }
public static async Task RunAdminOperation() { var optionList = BuildDefinition.MakeBuildTargetAPIOptions(); var sb = new System.Text.StringBuilder(); for (int i = 0; i < optionList.Count; i++) { sb.AppendLine(string.Format("-------- option[{0}] -------", i)); sb.AppendLine(optionList[i].ToString()); } Debug.WriteLine(sb.ToString()); #if false optionList.RemoveRange(1, optionList.Count - 1); //test #endif //await RemoveBuildTarget(); await CreateBuildTarget(optionList); //await DumpCredentials("../../DumpCredential.txt"); }
protected bool EnsureDefaultScheduledTrigger(BuildDefinition definition) { bool hasChanges = false; var scheduleTriggers = definition.Triggers.OfType <ScheduleTrigger>(); // Only add the schedule trigger if one doesn't exist. if (scheduleTriggers == default || !scheduleTriggers.Any()) { var computedSchedule = CreateScheduleFromDefinition(definition); definition.Triggers.Add(new ScheduleTrigger { Schedules = new List <Schedule> { computedSchedule } }); hasChanges = true; } return(hasChanges); }
private void definitionsLV_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!manuallyselected) { definitionsLV.SelectedIndex = -1; return; } if (sender != null) { ListView lv = sender as ListView; ItemDetails bdName = lv.SelectedItem as ItemDetails; if (bdName != null && bdName.Name != null) { BuildDefinition bd = buildDefList.Find(x => x.Name.ToLowerInvariant().Equals(bdName.Name.ToLowerInvariant())); if (bd != null) { Frame.Navigate(typeof(BD_BuildsPage), bd); } } } }
private async Task <WebApiTeam> EnsureTeamExists( BuildDefinition pipeline, string suffix, TeamPurpose purpose, IEnumerable <WebApiTeam> teams, bool persistChanges) { var result = teams.FirstOrDefault( team => { // Swallowing exceptions because parse errors on // free form text fields which might be non-yaml text // are not exceptional var metadata = YamlHelper.Deserialize <TeamMetadata>(team.Description, swallowExceptions: true); return(metadata?.PipelineId == pipeline.Id && metadata?.Purpose == purpose); }); if (result == default) { logger.LogInformation("Team Not Found Suffix = {0}", suffix); var teamMetadata = new TeamMetadata { PipelineId = pipeline.Id, Purpose = purpose, }; var newTeam = new WebApiTeam { Description = YamlHelper.Serialize(teamMetadata), Name = $"{pipeline.Name} -- {suffix}", }; logger.LogInformation("Create Team for Pipeline PipelineId = {0} Purpose = {1}", pipeline.Id, purpose); if (persistChanges) { result = await service.CreateTeamForProjectAsync(pipeline.Project.Id.ToString(), newTeam); } } return(result); }
public void BuildDefinition_Constructor_2017_Tfvc() { // Arrange var ps = BaseTests.PrepPowerShell(); var obj = BaseTests.LoadJson("Get-BuildDefinition_2017.json"); // Act var actual = new BuildDefinition(obj[1], "Project Name", ps); // Assert Assert.IsNull(actual.Tags, "Tags"); Assert.IsNotNull(actual.Demands, "Demands"); Assert.AreEqual(1, actual.Demands.Count, "Demands.Count"); Assert.IsNotNull(actual.Queue, "Queue"); Assert.IsNotNull(actual.Variables, "Variables"); Assert.IsNotNull(actual.AuthoredBy, "AuthoredBy"); Assert.IsNotNull(actual.Repository, "Repository"); Assert.IsNull(actual.GitRepository, "GitRepository"); Assert.IsNotNull(actual.RetentionRules, "RetentionRules"); Assert.AreEqual("8/23/2020 10:30:31 pm", actual.CreatedOn.ToString("M/d/yyyy h:mm:ss tt").ToLower(), "CreatedOn"); Assert.AreEqual(5, actual.JobCancelTimeoutInMinutes, "JobCancelTimeoutInMinutes"); Assert.AreEqual("projectCollection", actual.JobAuthorizationScope, "JobAuthorizationScope"); Assert.AreEqual("$(date:yyyyMMdd)$(rev:.r)", actual.BuildNumberFormat, "BuildNumberFormat"); Assert.IsNotNull(actual.Options, "Options"); Assert.AreEqual(4, actual.Options.Count, "Options.Count"); Assert.IsNull(actual.Triggers, "Triggers"); Assert.AreEqual(18, actual.Id, "Id"); Assert.AreEqual("\\", actual.Path, "Path"); Assert.AreEqual("TFVC-CI", actual.Name, "Name"); Assert.AreEqual(2, actual.Revision, "Revision"); Assert.IsNull(actual.Process, "Process"); }
private static void FixTriggerRepositories(BuildDefinition item) { foreach (var triggerItem in item.Triggers) { if (triggerItem is ContinuousIntegrationTrigger) { var convertedTrigger = triggerItem as ContinuousIntegrationTrigger; // Update Branch Filters on CI Trigger for (int i = 0; i < convertedTrigger.PathFilters.Count; i++) { convertedTrigger.PathFilters[i] = FixRepositoryPath(convertedTrigger.PathFilters[i]); } for (int i = 0; i < convertedTrigger.BranchFilters.Count; i++) { convertedTrigger.BranchFilters[i] = FixRepositoryPath(convertedTrigger.BranchFilters[i]); } } else if (triggerItem is GatedCheckInTrigger) { var convertedTrigger = triggerItem as GatedCheckInTrigger; for (int i = 0; i < convertedTrigger.PathFilters.Count; i++) { convertedTrigger.PathFilters[i] = FixRepositoryPath(convertedTrigger.PathFilters[i]); } } else if (triggerItem is ScheduleTrigger) { var convertedTrigger = triggerItem as ScheduleTrigger; foreach (var scheduleTrigger in convertedTrigger.Schedules) { for (int i = 0; i < scheduleTrigger.BranchFilters.Count; i++) { scheduleTrigger.BranchFilters[i] = FixRepositoryPath(scheduleTrigger.BranchFilters[i]); } } } } }
public static void WithBuildDefinition(this TestCompositionRoot root, string name, string repositoryName, string url = "https://dev.azure.com/build/{0}", string id = null, string organization = "jrolstad", string project = "the-project") { var item = new BuildDefinition { name = name, id = id ?? Base64Encode(name), RepositoryId = Base64Encode(repositoryName), project = new Project { name = name, id = Base64Encode(name) }, _links = WithLinks(string.Format(url, name)) }; WithItem(organization, project, root.Context.BuildDefinitions, item); }
protected bool EnsureDefaultCITrigger(BuildDefinition definition) { bool hasChanges = false; var ciTrigger = definition.Triggers.OfType <ContinuousIntegrationTrigger>().SingleOrDefault(); if (ciTrigger == null) { definition.Triggers.Add(new ContinuousIntegrationTrigger() { SettingsSourceType = 2 // Get CI trigger data from yaml file }); hasChanges = true; } else { if (ciTrigger.SettingsSourceType != 2) { ciTrigger.SettingsSourceType = 2; hasChanges = true; } } return(hasChanges); }
protected override async Task <bool> ApplyConventionAsync(BuildDefinition definition, SdkComponent component) { // NOTE: Not happy with this code at all, I'm going to look for a reasonable // API that can do equality comparisons (without having to do all the checks myself). var hasChanges = await base.ApplyConventionAsync(definition, component); var prTrigger = definition.Triggers.OfType <PullRequestTrigger>().SingleOrDefault(); if (prTrigger == null) { // TODO: We should probably be more complete here. definition.Triggers.Add(new PullRequestTrigger() { SettingsSourceType = 2, // HACK: See above. Forks = new Forks() { AllowSecrets = false, Enabled = true } }); hasChanges = true; } else { // TODO: We should probably be more complete here. if (prTrigger.SettingsSourceType != 2 || prTrigger.Forks.AllowSecrets != false || prTrigger.Forks.Enabled != true) { prTrigger.SettingsSourceType = 2; prTrigger.Forks.AllowSecrets = false; prTrigger.Forks.Enabled = true; hasChanges = true; } } return(hasChanges); }
private async Task AnalyseDefinitionAsync(BuildDefinition definition) { await RaiseEventAsync(BuildEvent, new BuildEventArgs() { Code = BuildEventCode.BuildInstanceRetrievalStart, Name = definition.Name }); try { var last2Builds = await GetLastBuildInstanceAsync(definition); if (last2Builds.Any()) { UpdateLastBuildStatusAsync(last2Builds[0]); await RaiseBuildEventAsync(definition, last2Builds.Count > 1?last2Builds[1] : null, last2Builds[0]); } else { await RaiseEventAsync(BuildEvent, new BuildEventArgs() { Code = BuildEventCode.NoBuildsFound, Name = definition.Name }); } } catch (Exception ex) { await RaiseBuildEventAsync(definition, null, null, ex); } finally { await RaiseEventAsync(BuildEvent, new BuildEventArgs() { Code = BuildEventCode.BuildInstanceRetrievalEnd, Name = definition.Name }); } }
public async static void CreateBuildDefinition(string teamProject) { var tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(collectionUrl)); var bhc = tpc.GetClient <BuildHttpClient>(); string templateProject = "TEMPLATE_PROJECT"; int templateId = FindBuildDefinitionId(templateProject, "TEMPLATE_BUILD"); BuildDefinition buildDefTemplate = (await bhc.GetDefinitionAsync(templateProject, templateId)); buildDefTemplate.Project = null; buildDefTemplate.Name = "NewBuild"; var repository = buildDefTemplate.Repository; buildDefTemplate.Repository = null; repository.Url = null; repository.Id = null; repository.Name = teamProject; buildDefTemplate.Repository = repository; var queue = buildDefTemplate.Queue; buildDefTemplate.Queue = null; AgentPoolQueue newQueue = new AgentPoolQueue(); newQueue.Name = queue.Name; buildDefTemplate.Queue = newQueue; buildDefTemplate.Variables.Clear(); BuildDefinitionVariable var1 = new BuildDefinitionVariable(); var1.Value = "value"; buildDefTemplate.Variables.Add("key", var1); await bhc.CreateDefinitionAsync(buildDefTemplate, teamProject); }
private void PrepareDefinition(MigrationContext context, BuildDefinition definition) { //Reset the core properties definition.Project = context.TargetProject; definition.Id = 0; definition.Queue = null; //Map the task groups foreach (var step in definition.Steps) { var mapping = Settings.TaskGroups.FirstOrDefault(g => g.SourceGroupId == step.TaskDefinition.Id); if (mapping != null) { step.TaskDefinition.Id = mapping.TargetGroupId; } } ; //Set the target agent queue definition.Queue = new AgentPoolQueue() { Name = Settings.TargetAgentQueue }; //Should we add a trigger for the build //var trigger = new ScheduleTrigger(); //var schedule = new Schedule() { // StartHours = 3, // DaysToBuild = ScheduleDays.Monday | ScheduleDays.Tuesday | ScheduleDays.Wednesday | ScheduleDays.Thursday | ScheduleDays.Friday //}; //schedule.BranchFilters.Add(); //trigger.Schedules.Add(schedule); //definition.Triggers.Clear(); }
private void BuildDefinition() { var files = FilesManager.GetFilesInfo(_context.Settings.GetApplicationFolderPath()); var definitions = new BuildDefinition(); definitions.Entries = new BuildDefinitionEntry[files.Length + 1]; for (var i = 0; i < files.Length; i++) { var file = files[i]; definitions.Entries[i] = new BuildDefinitionEntry() { Attributes = file.Attributes, Hash = Hashing.GetFileHash(PathsManager.Combine(_context.Settings.GetApplicationFolderPath(), file.RelativePath)), LastWriting = file.LastWriting, RelativePath = file.RelativePath, Size = file.Size }; _context.ReportProgress(string.Format(_context.LocalizedMessages.BuildDefinitionProcessed, PathsManager.GetFilename(file.RelativePath))); } var versionFile = FilesManager.GetFileInfo(_context.Settings.GetVersionFilePath(_context.BuildVersion)); definitions.Entries[files.Length] = new BuildDefinitionEntry() { Attributes = versionFile.Attributes, Hash = Hashing.GetFileHash(_context.Settings.GetVersionFilePath(_context.BuildVersion)), LastWriting = versionFile.LastWriting, RelativePath = versionFile.RelativePath, Size = versionFile.Size }; _context.ReportProgress(string.Format(_context.LocalizedMessages.BuildDefinitionProcessed, PathsManager.GetFilename(versionFile.RelativePath))); File.WriteAllText(_context.Settings.GetBuildDefinitionPath(_context.BuildVersion), _context.Serializer.Serialize(definitions)); }
protected bool EnsureVariableGroups(BuildDefinition definition) { var hasChanges = false; var definitionVariableGroupSet = definition.VariableGroups .Select(group => group.Id) .ToHashSet(); var parameterGroupSet = this.Context.VariableGroups.ToHashSet(); var idsToAdd = parameterGroupSet.Except(definitionVariableGroupSet); if (idsToAdd.Any()) { hasChanges = true; } var groupsToAdd = idsToAdd.Select(id => new VariableGroup { Id = id }); definition.VariableGroups.AddRange(groupsToAdd); return(hasChanges); }
public void QueueCommitBuild() { IBuildRequest request = BuildDefinition.CreateBuildRequest(); IQueuedBuild queuedBuild = BuildDefinition.BuildServer.QueueBuild(request); }
public TriggerWrapper(BuildDefinition buildDefinition, TriggerDefinition triggerDefinition) { this.buildDefinition = buildDefinition; this.triggerDefinition = triggerDefinition; }
public ProjectConfigurationViewModel(ProjectViewModel project, BuildDefinition buildDefinition) { this.project = project; this.buildDefinition = buildDefinition; }
public static Task <BuildDefinition> AddDefinitionAsync(this BuildHttpClient source, BuildDefinition definition, CancellationToken cancellationToken) => source.CreateDefinitionAsync(definition, cancellationToken: cancellationToken);
protected bool EnsureDefautPullRequestTrigger(BuildDefinition definition, bool overrideYaml = true, bool securePipeline = true) { bool hasChanges = false; var prTriggers = definition.Triggers.OfType <PullRequestTrigger>(); if (prTriggers == default || !prTriggers.Any()) { var newTrigger = new PullRequestTrigger(); if (overrideYaml) { newTrigger.SettingsSourceType = 1; // Override what is in the yaml file and use what is in the pipeline definition newTrigger.BranchFilters.Add("+*"); } else { newTrigger.SettingsSourceType = 2; // Pull settings from yaml } newTrigger.Forks = new Forks { AllowSecrets = securePipeline, Enabled = true }; newTrigger.RequireCommentsForNonTeamMembersOnly = false; newTrigger.IsCommentRequiredForPullRequest = securePipeline; definition.Triggers.Add(newTrigger); hasChanges = true; } else { foreach (var trigger in prTriggers) { if (overrideYaml) { if (trigger.SettingsSourceType != 1 || trigger.BranchFilters.Contains("+*")) { // Override what is in the yaml file and use what is in the pipeline definition trigger.SettingsSourceType = 1; trigger.BranchFilters.Add("+*"); } } else { if (trigger.SettingsSourceType != 2) { // Pull settings from yaml trigger.SettingsSourceType = 2; hasChanges = true; } } if (trigger.RequireCommentsForNonTeamMembersOnly != false || trigger.Forks.AllowSecrets != securePipeline || trigger.Forks.Enabled != true || trigger.IsCommentRequiredForPullRequest != securePipeline ) { trigger.Forks.AllowSecrets = securePipeline; trigger.Forks.Enabled = true; trigger.RequireCommentsForNonTeamMembersOnly = false; trigger.IsCommentRequiredForPullRequest = securePipeline; hasChanges = true; } } } return(hasChanges); }
public static Task DeleteDefinitionAsync(this BuildHttpClient source, BuildDefinition definition, CancellationToken cancellationToken) => source.DeleteDefinitionAsync(definition.Project.Id, definition.Id, cancellationToken: cancellationToken);
public void AddToBuildDefinitions(BuildDefinition buildDefinition) { base.AddObject("BuildDefinitions", buildDefinition); }
public static BuildDefinition CreateBuildDefinition(string project, string definition) { BuildDefinition buildDefinition = new BuildDefinition(); buildDefinition.Project = project; buildDefinition.Definition = definition; return buildDefinition; }