Skip to content

Maestro-configuration should not require no-pr if PR is already created #5984

@mmitche

Description

@mmitche

If a specific configuration branch is used for two subsequent commands and a PR for that branch->target already exists, the second command will fail to create a PR. Instead, it should detect whether a PR exists and avoid it automatically.

fail: Failed to create subscription.
      Microsoft.VisualStudio.Services.Common.VssServiceException: TF401179: An active pull request for the source and target branch already exists.
         at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
         at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
         at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
         at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
         at Microsoft.DotNet.DarcLib.AzureDevOpsClient.CreatePullRequestAsync(String repoUri, PullRequest pullRequest) in /_/src/Microsoft.DotNet.Darc/DarcLib/AzureDevOpsClient.cs:line 355
         at Microsoft.DotNet.DarcLib.ConfigurationRepository.RemoteGitRepo.CreatePullRequestAsync(String repositoryUri, String headBranch, String baseBranch, String prTitle, String prDescription) in /_/src/Microsoft.DotNet.Darc/DarcLib/ConfigurationRepository/RemoteGitRepo.cs:line 36
         at Microsoft.DotNet.MaestroConfiguration.Client.ConfigurationRepositoryManager.CreatePullRequest(IGitRepo gitRepo, String repositoryUri, String headBranch, String targetBranch, String title, String description)
         at Microsoft.DotNet.MaestroConfiguration.Client.ConfigurationRepositoryManager.PerformConfigurationRepositoryOperationInternal[TModel](ConfigurationRepositoryOperationParameters parameters, TModel yamlModel, Func`5 operation, String noPrOperationMessage, String prTitle)
         at Microsoft.DotNet.MaestroConfiguration.Client.ConfigurationRepositoryManager.AddSubscriptionAsync(ConfigurationRepositoryOperationParameters parameters, SubscriptionYamlParameters subscriptionParameters)
         at Microsoft.DotNet.Darc.Operations.AddSubscriptionOperation.ExecuteAsync() in /_/src/Microsoft.DotNet.Darc/Darc/Operations/AddSubscriptionOperation.cs:line 421

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions