Skip to content

Commit

Permalink
Merge pull request #862 from DeveloperMetrics/ProcessingBugFix
Browse files Browse the repository at this point in the history
Processing bug fix
  • Loading branch information
samsmithnz authored Jun 2, 2023
2 parents a07d871 + 1ca38bc commit d794906
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
15 changes: 13 additions & 2 deletions src/DevOpsMetrics.Service/Controllers/DORASummaryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.Build.Framework;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;

namespace DevOpsMetrics.Service.Controllers
{
Expand Down Expand Up @@ -215,10 +216,20 @@ public async Task<ProcessingResult> UpdateDORASummaryItem(
owner, repo, branch, workflowName,
numberOfDays, maxNumberOfItems);

await Task.WhenAll(deploymentFrequencyTask, leadTimeForChangesTask, meanTimeToRestoreTask, changeFailureRateTask);
if (meanTimeToRestoreTask != null)
{
await Task.WhenAll(deploymentFrequencyTask, leadTimeForChangesTask, meanTimeToRestoreTask, changeFailureRateTask);
}
else
{
await Task.WhenAll(deploymentFrequencyTask, leadTimeForChangesTask, changeFailureRateTask);
}
deploymentFrequencyModel = await deploymentFrequencyTask;
leadTimeForChangesModel = await leadTimeForChangesTask;
meanTimeToRestoreModel = await meanTimeToRestoreTask;
if (meanTimeToRestoreTask != null)
{
meanTimeToRestoreModel = await meanTimeToRestoreTask;
}
changeFailureRateModel = await changeFailureRateTask;
}
else
Expand Down
22 changes: 11 additions & 11 deletions src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ public async Task DORASummaryControllerGetIntegrationTest2()
public async Task DORASummaryControllerGitHubUpdateIntegrationTest()
{
//Arrange
string organization = "DeveloperMetrics";
string repository = "DevOpsMetrics";
string branch = "main";
string workflowName = "CI/CD";
string workflowId = "1162561";
string resourceGroup = "DevOpsMetrics";
//string organization = "samsmithnz";
//string repository = "AzurePipelinesToGitHubActionsConverter";
//string organization = "DeveloperMetrics";
//string repository = "DevOpsMetrics";
//string branch = "main";
//string workflowName = "CI/ CD";
//string workflowId = "38158";
//string resourceGroup = null;
//string workflowName = "CI/CD";
//string workflowId = "1162561";
//string resourceGroup = "DevOpsMetrics";
string organization = "samsmithnz";
string repository = "AzurePipelinesToGitHubActionsConverter";
string branch = "main";
string workflowName = "CI/ CD";
string workflowId = "38158";
string resourceGroup = null;
//string organization = "samsmithnz";
//string repository = "AzurePipelinesToGitHubActionsConverterWeb";
//string branch = "main";
Expand Down

0 comments on commit d794906

Please sign in to comment.