Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[preview] #1900 Add workaround for missing repository properties #1954

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private IEnumerable<TaskGroup> FilterOutIncompatibleTaskGroups(IEnumerable<TaskG
{
Log.LogWarning(
@"{DefinitionType} ""{DefinitionName}"" cannot be migrated because the Task(s) ""{MissingTaskNames}"" are not available. This usually happens if the extension for the task is not installed.",
typeof(TaskGroup).Name, g.Name ,string.Join(",", missingTasksNames));
typeof(TaskGroup).Name, g.Name, string.Join(",", missingTasksNames));
return false;
}
return true;
Expand Down Expand Up @@ -303,13 +303,15 @@ private async Task<IEnumerable<Mapping>> CreateBuildPipelinesAsync(IEnumerable<M
// Replace taskgroup and variablegroup sIds with tIds
foreach (var definitionToBeMigrated in definitionsToBeMigrated)
{
var sourceConnectedServiceId = definitionToBeMigrated.Repository.Properties.ConnectedServiceId;
var sourceConnectedServiceId = definitionToBeMigrated.Repository?.Properties?.ConnectedServiceId;
var targetConnectedServiceId = targetServiceConnections.FirstOrDefault(s => sourceServiceConnections
.FirstOrDefault(c => c.Id == sourceConnectedServiceId)?.Name == s.Name)?.Id;
definitionToBeMigrated.Repository.Properties.ConnectedServiceId = targetConnectedServiceId;


MapRepositoriesInBuidDefinition(sourceRepositories, targetRepositories, definitionToBeMigrated);
if (definitionToBeMigrated.Repository?.Properties != null)
{
definitionToBeMigrated.Repository.Properties.ConnectedServiceId = targetConnectedServiceId;
MapRepositoriesInBuidDefinition(sourceRepositories, targetRepositories, definitionToBeMigrated);
}

if (TaskGroupMapping is not null)
{
Expand Down
Loading