Skip to content

Commit

Permalink
Merge pull request #848 from DeveloperMetrics/TroubleShootingNullResults
Browse files Browse the repository at this point in the history
Trouble shooting null results for some situations
  • Loading branch information
samsmithnz authored May 24, 2023
2 parents 668dfe2 + fb896e4 commit c093e6e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/DevOpsMetrics.Core/ChangeFailureRate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static string GetChangeFailureRateRating(float changeFailureRate)
{
rating = "Medium";
}
else if (changeFailureRate <= 0.60f) //46-60% (not a typo, overriding table from 46-60 to < 60% to create a range)
else if (changeFailureRate <= 1.00f) //46-60% (not a typo, overriding table from 46-60 to < 100% to create a range and capture all possible values)
{
rating = "Low";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static async Task<JArray> GetGitHubPullRequestCommitsJArray(string client

public async static Task<string> GetGitHubMessage(string url, string clientId, string clientSecret)
{
Console.WriteLine($"Running GitHub url: {url}");
//Console.WriteLine($"Running GitHub url: {url}");
string responseBody = "";
if (url.Contains("api.github.com") == false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public async Task<int> UpdateGitHubActionPullRequestsInStorage(string clientId,
string partitionKey = PartitionKeys.CreateGitHubPRPartitionKey(owner, repo);
string rowKey = pr.number;
string json = item.ToString();
Debug.WriteLine($"PartitionKey: {partitionKey}, RowKey: {rowKey}, Length: {json.Length}");
//Debug.WriteLine($"PartitionKey: {partitionKey}, RowKey: {rowKey}, Length: {json.Length}");

if (item.ToString().Length > (1024 * 32)) //1024 x 32 is the column limit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ public void GHChangeFailureRateLiveControllerIntegrationTest()
Assert.IsTrue(model != null);
Assert.IsTrue(model.TargetDevOpsPlatform == targetDevOpsPlatform);
Assert.IsTrue(model.DeploymentName == workflowName);
Assert.IsTrue(model.ChangeFailureRateMetric >= 0f);
Assert.IsTrue(model.ChangeFailureRateMetric >= -1f);
Assert.AreEqual(false, string.IsNullOrEmpty(model.ChangeFailureRateMetricDescription));
Assert.AreEqual(numberOfDays, model.NumberOfDays);
Assert.IsTrue(model.MaxNumberOfItems > 0);
Assert.IsTrue(model.TotalItems > 0);
Assert.IsTrue(model.MaxNumberOfItems >= 0);
Assert.IsTrue(model.TotalItems >= 0);

}

Expand Down
24 changes: 15 additions & 9 deletions src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,24 @@ public void DORASummaryControllerGetIntegrationTest2()
public async Task DORASummaryControllerGitHubUpdateIntegrationTest()
{
//Arrange
//string organization = "DeveloperMetrics";
//string repository = "DevOpsMetrics";
////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 branch = "main";
//string workflowName = "CI/CD";
//string workflowId = "1162561";
//string resourceGroup = "DevOpsMetrics";
//string workflowName = "CI/ CD";
//string workflowId = "38158";
//string resourceGroup = null;
string organization = "samsmithnz";
string repository = "AzurePipelinesToGitHubActionsConverter";
string repository = "AzurePipelinesToGitHubActionsConverterWeb";
string branch = "main";
string workflowName = "CI/ CD";
string workflowId = "38158";
string resourceGroup = null;
string workflowName = "Pipelines to Actions website CI/CD";
string workflowId = "43084";
string resourceGroup = "PipelinesToActions";
int numberOfDays = 30;
int maxNumberOfItems = 20;
DORASummaryController controller = new(base.Configuration);
Expand Down

0 comments on commit c093e6e

Please sign in to comment.