scratch/Program.cs
/// <summary>
/// Now that builds have associated issues need to migrate all of the existing tracking issues 
/// to associated issues
/// </summary>
/// <returns></returns>
Now that builds have associated issues need to migrate all of the existing tracking issues
to associated issues
Now that builds have associated issues need to migrate all of the existing tracking issues to associated issues
internal async Task MigrateTrackingToAssociatedIssues()
        {
            var list = await TriageContext
                .ModelTrackingIssueResults
                .Where(x => x.IsPresent && x.ModelTrackingIssue.GitHubIssueNumber.HasValue)
                .Include(x => x.ModelTrackingIssue)
                .Include(x => x.ModelBuildAttempt)
                .ThenInclude(x => x.ModelBuild)
                .ToListAsync();
            var set = new HashSet<(BuildKey, GitHubIssueKey)>();
            foreach (var result in list)
            {
                var buildKey = result.ModelBuildAttempt.ModelBuild.GetBuildKey();
                var issueKey = result.ModelTrackingIssue.GetGitHubIssueKey()!.Value;
                if (issueKey.IssueUri.Contains("jaredpar"))
                {
                    continue;
                }
                if (set.Add((buildKey, issueKey)))
                {
                    Console.WriteLine($"{buildKey.BuildUri} - {issueKey.IssueUri}");
                    var modelBuild = await TriageContextUtil.GetModelBuildAsync(buildKey);
                    await TriageContextUtil.EnsureGitHubIssueAsync(modelBuild, issueKey, saveChanges: true);
                }
            }
        }
internal async Task MigrateTrackingToAssociatedIssues ( ) { var list = await TriageContext . ModelTrackingIssueResults . Where ( x => x . IsPresent && x . ModelTrackingIssue . GitHubIssueNumber . HasValue ) . Include ( x => x . ModelTrackingIssue ) . Include ( x => x . ModelBuildAttempt ) . ThenInclude ( x => x . ModelBuild ) . ToListAsync ( ) ; var set = new HashSet < ( BuildKey , GitHubIssueKey ) > ( ) ; foreach ( var result in list ) { var buildKey = result . ModelBuildAttempt . ModelBuild . GetBuildKey ( ) ; var issueKey = result . ModelTrackingIssue . GetGitHubIssueKey ( ) ! . Value ; if ( issueKey . IssueUri . Contains ( " " ) ) { continue ; } if ( set . Add ( ( buildKey , issueKey ) ) ) { Console . WriteLine ( $" { buildKey . BuildUri }  -  { issueKey . IssueUri } " ) ; var modelBuild = await TriageContextUtil . GetModelBuildAsync ( buildKey ) ; await TriageContextUtil . EnsureGitHubIssueAsync ( modelBuild , issueKey , saveChanges : true ) ; } } }
Now that builds have associated issues need to migrate all of the existing tracking issues
to associated issues
Now that builds have associated issues need to migrate all of the existing tracking issues to associated issues
None