コード例 #1
0
ファイル: BuildRetryUtil.cs プロジェクト: riarenas/runfo
        public async Task ProcessBuildAsync(BuildKey buildKey)
        {
            var modelBuildAttempts = await TriageContextUtil
                                     .GetModelBuildAttemptsQuery(buildKey)
                                     .Include(x => x.ModelBuild)
                                     .ToListAsync()
                                     .ConfigureAwait(false);

            var modelBuild = modelBuildAttempts.FirstOrDefault()?.ModelBuild;

            if (modelBuild is null)
            {
                // This happens when we have no data on the build at all
                Logger.LogWarning($"No model for the build {buildKey}");
                return;
            }

            var failed = modelBuild.BuildResult == BuildResult.Failed || modelBuild.BuildResult == BuildResult.Canceled;

            if (!failed)
            {
                Logger.LogWarning($"Build did not fail so no retry is needed");
                return;
            }

            await RetryOsxDeprovisionAsync(modelBuild, modelBuildAttempts);
        }
コード例 #2
0
        public async Task TriageAsync(BuildKey buildKey, int modelTrackingIssueId)
        {
            var attempts = await TriageContextUtil
                           .GetModelBuildAttemptsQuery(buildKey)
                           .Include(x => x.ModelBuild)
                           .ToListAsync()
                           .ConfigureAwait(false);

            foreach (var attempt in attempts)
            {
                await TriageAsync(attempt.GetBuildAttemptKey(), modelTrackingIssueId).ConfigureAwait(false);
            }
        }