Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
samsmithnz committed Jun 21, 2023
1 parent 323ab3d commit 5664273
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/DevOpsMetrics.Cmd/ServiceApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public async Task<List<GitHubSettings>> GetGitHubSettings()
}

public async Task<ProcessingResult> UpdateDORASummaryItem(
string owner, string project, string repository,
string branch, string workflowName, string workflowId,
string resourceGroup, int numberOfDays, int maxNumberOfItems,
string owner, string project, string repository,
string branch, string workflowName, string workflowId,
string resourceGroup, int numberOfDays, int maxNumberOfItems,
bool isGitHub = true)
{
string url = $"/api/DORASummary/UpdateDORASummaryItem?owner={owner}&project={project}&repository={repository}&branch={branch}&workflowName={workflowName}&workflowId={workflowId}&resourceGroup={resourceGroup}&numberOfDays={numberOfDays}&maxNumberOfItems={maxNumberOfItems}&log=&useCache=true&isGitHub={isGitHub}";
Expand Down
1 change: 0 additions & 1 deletion src/DevOpsMetrics.Function/AzureAlertProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using DevOpsMetrics.Core.DataAccess.TableStorage;
using DevOpsMetrics.Core.Models.Common;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down
2 changes: 1 addition & 1 deletion src/DevOpsMetrics.Function/NightlyProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static async Task Run(
{
log.LogInformation($"Processing Azure DevOps organization {azSetting.Organization}, project {azSetting.Project}");
ProcessingResult ghResult = await serviceApiClient.UpdateDORASummaryItem(
azSetting.Organization, azSetting.Project, azSetting.Repository,
azSetting.Organization, azSetting.Project, azSetting.Repository,
azSetting.Branch, azSetting.BuildName, azSetting.BuildId,
azSetting.ProductionResourceGroup,
numberOfDays, maxNumberOfItems, false);
Expand Down
7 changes: 3 additions & 4 deletions src/DevOpsMetrics.Function/ServiceApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using DevOpsMetrics.Core.Models.Common;
using DevOpsMetrics.Core.Models.GitHub;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

namespace DevOpsMetrics.Function
Expand Down Expand Up @@ -40,9 +39,9 @@ public async Task<List<GitHubSettings>> GetGitHubSettings()
}

public async Task<ProcessingResult> UpdateDORASummaryItem(
string owner, string project, string repository,
string branch, string workflowName, string workflowId,
string resourceGroup, int numberOfDays, int maxNumberOfItems,
string owner, string project, string repository,
string branch, string workflowName, string workflowId,
string resourceGroup, int numberOfDays, int maxNumberOfItems,
bool isGitHub = true)
{
string url = $"/api/DORASummary/UpdateDORASummaryItem?owner={owner}&project={project}&repository={repository}&branch={branch}&workflowName={workflowName}&workflowId={workflowId}&resourceGroup={resourceGroup}&numberOfDays={numberOfDays}&maxNumberOfItems={maxNumberOfItems}&log=&useCache=true&isGitHub={isGitHub}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public async Task<bool> UpdateAzureDevOpsProjectLog(string organization, string
}

[HttpGet("GetGitHubProjectLog")]
public async Task< List<ProjectLog>> GetGitHubProjectLog(string owner, string repo)
public async Task<List<ProjectLog>> GetGitHubProjectLog(string owner, string repo)
{
string partitionKey = PartitionKeys.CreateGitHubSettingsPartitionKey(owner, repo);

Expand Down
2 changes: 1 addition & 1 deletion src/DevOpsMetrics.Tests/Service/TableStorageDATests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public async Task AzGetPRCommitsDAIntegrationTest()
{
AzureDevOpsPR pullRequest = JsonConvert.DeserializeObject<AzureDevOpsPR>(item.ToString());
string pullRequestId = pullRequest.PullRequestId;
JArray list =await da.GetTableStorageItemsFromStorage(tableStorageConfig, tableStorageConfig.TableAzureDevOpsPRCommits, PartitionKeys.CreateAzureDevOpsPRCommitPartitionKey(organization, project, pullRequestId));
JArray list = await da.GetTableStorageItemsFromStorage(tableStorageConfig, tableStorageConfig.TableAzureDevOpsPRCommits, PartitionKeys.CreateAzureDevOpsPRCommitPartitionKey(organization, project, pullRequestId));
if (list.Count > 0)
{
itemsAdded = list.Count;
Expand Down
3 changes: 0 additions & 3 deletions src/DevOpsMetrics.Web/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
using DevOpsMetrics.Core.Models.AzureDevOps;
using DevOpsMetrics.Core.Models.Common;
using DevOpsMetrics.Core.Models.GitHub;
using DevOpsMetrics.Service.Controllers;
using DevOpsMetrics.Web.Models;
using DevOpsMetrics.Web.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using NuGet.Protocol;

namespace DevOpsMetrics.Web.Controllers
{
Expand Down

0 comments on commit 5664273

Please sign in to comment.