diff --git a/src/RepoGovernance.Core/APIAccess/BaseAPI.cs b/src/RepoGovernance.Core/APIAccess/BaseApi.cs similarity index 87% rename from src/RepoGovernance.Core/APIAccess/BaseAPI.cs rename to src/RepoGovernance.Core/APIAccess/BaseApi.cs index e4235abe..570e5999 100644 --- a/src/RepoGovernance.Core/APIAccess/BaseAPI.cs +++ b/src/RepoGovernance.Core/APIAccess/BaseApi.cs @@ -9,8 +9,6 @@ public static class BaseApi T? obj = default; if (client != null && url != null) { - //Debug.WriteLine("Running url: " + client.BaseAddress.ToString() + url); - //Console.WriteLine("Running url: " + client.BaseAddress.ToString() + url); using (HttpResponseMessage response = await client.GetAsync(url)) { if (ignoreErrors == true || response.IsSuccessStatusCode == true) diff --git a/src/RepoGovernance.Core/APIAccess/CoverallsCodeCoverageAPI.cs b/src/RepoGovernance.Core/APIAccess/CoverallsCodeCoverageApi.cs similarity index 100% rename from src/RepoGovernance.Core/APIAccess/CoverallsCodeCoverageAPI.cs rename to src/RepoGovernance.Core/APIAccess/CoverallsCodeCoverageApi.cs diff --git a/src/RepoGovernance.Core/APIAccess/DevOpsMetricServiceAPI.cs b/src/RepoGovernance.Core/APIAccess/DevOpsMetricServiceApi.cs similarity index 100% rename from src/RepoGovernance.Core/APIAccess/DevOpsMetricServiceAPI.cs rename to src/RepoGovernance.Core/APIAccess/DevOpsMetricServiceApi.cs diff --git a/src/RepoGovernance.Core/APIAccess/SonarCloudAPI.cs b/src/RepoGovernance.Core/APIAccess/SonarCloudApi.cs similarity index 94% rename from src/RepoGovernance.Core/APIAccess/SonarCloudAPI.cs rename to src/RepoGovernance.Core/APIAccess/SonarCloudApi.cs index 10855412..743ca188 100644 --- a/src/RepoGovernance.Core/APIAccess/SonarCloudAPI.cs +++ b/src/RepoGovernance.Core/APIAccess/SonarCloudApi.cs @@ -46,8 +46,6 @@ public static class SonarCloudApi string? obj = null; if (client != null && url != null) { - //Debug.WriteLine("Running url: " + client.BaseAddress.ToString() + url); - //Console.WriteLine("Running url: " + client.BaseAddress.ToString() + url); using (HttpResponseMessage response = await client.GetAsync(url)) { if (ignoreErrors == true || response.IsSuccessStatusCode == true) diff --git a/src/RepoGovernance.Core/TableStorage/AzureTableStorageDA.cs b/src/RepoGovernance.Core/TableStorage/AzureTableStorageDA.cs index 16c2b628..e1fb072d 100644 --- a/src/RepoGovernance.Core/TableStorage/AzureTableStorageDA.cs +++ b/src/RepoGovernance.Core/TableStorage/AzureTableStorageDA.cs @@ -39,24 +39,9 @@ public static class AzureTableStorageDA AzureStorageTableModel row = new(partitionKey, rowKey, json); await tableBuildsDA.SaveItem(row); itemsAdded++; - //if (await tableBuildsDA.AddItem(row) == true) - //{ - // itemsAdded++; - //} - //else - //{ - // await tableBuildsDA.SaveItem(row); - // itemsAdded++; - //} return itemsAdded; } - ////TODO: Move this into Azure Storage - currently this is a single static list of repos - //public static List GetRepos(string user) - //{ - // return DatabaseAccess.GetRepos(user); - //} - } } diff --git a/src/RepoGovernance.Core/TableStorage/TableStorageCommonDA.cs b/src/RepoGovernance.Core/TableStorage/TableStorageCommonDA.cs index c74a7c58..443977ae 100644 --- a/src/RepoGovernance.Core/TableStorage/TableStorageCommonDA.cs +++ b/src/RepoGovernance.Core/TableStorage/TableStorageCommonDA.cs @@ -29,29 +29,14 @@ private CloudTable CreateConnection() CloudTable table = tableClient.GetTableReference(TableName); // Create the table if it doesn't exist - //table.CreateIfNotExists(); // DON"T use CreateIfNotExists, it throws an internal 409 in App insights: https://stackoverflow.com/questions/48893519/azure-table-storage-exception-409-conflict-unexpected + // DON"T use table.CreateIfNotExists, it throws an internal 409 in App insights: https://stackoverflow.com/questions/48893519/azure-table-storage-exception-409-conflict-unexpected if (!table.Exists()) { table.Create(); } return table; - } - - //public async Task AddItem(AzureStorageTableModel data, bool forceUpdate = false) - //{ - // //Check if the item exists in storage - // AzureStorageTableModel item = await GetItem(data.PartitionKey, data.RowKey); - // if (item == null || forceUpdate == true) - // { - // await SaveItem(data); - // return true; //data saved to table! - // } - // else - // { - // return false; //no updates needed - // } - //} + } public async Task GetItem(string partitionKey, string rowKey) { @@ -94,57 +79,13 @@ public async Task SaveItem(AzureStorageTableModel data) return true; } - ////public async Task DeleteItem(string tableName, string name) - ////{ - //// CloudTable table = CreateConnection(tableName); - - //// // Create a retrieve operation that expects a customer entity. - //// TableOperation retrieveOperation = TableOperation.Retrieve("Item", name); - - //// // Execute the operation. - //// TableResult retrievedResult = await table.ExecuteAsync(retrieveOperation); - - //// // Assign the result to a CustomerEntity object. - //// T deleteEntity = (T)retrievedResult.Result; - - //// if (deleteEntity != null) - //// { - //// // Create the TableOperation that inserts the customer entity. - //// TableOperation deleteOperation = TableOperation.Delete(deleteEntity); - - //// // Execute the delete operation. - //// await table.ExecuteAsync(deleteOperation); - //// } - //// return true; - ////} - public static string EncodePartitionKey(string text) { //The forward slash(/) character - //The backslash(\) character - //The number sign(#) character - //The question mark (?) character text = text.Replace("/", "_"); - //text = text.Replace("\\", "_"); - //text = text.Replace("#", "_"); - //text = text.Replace("?", "_"); - - ////Control characters from U+0000 to U+001F, including: - ////The horizontal tab(\t) character - //text = text.Replace("\t", "_"); - ////The linefeed(\n) character - //text = text.Replace("\n", "_"); - ////The carriage return (\r) character - //text = text.Replace("\r", "_"); - ////Control characters from U + 007F to U+009F return text; } - //public string DecodePartitionKey(string text) - //{ - // return text.Replace("_", "/"); - //} - } } \ No newline at end of file diff --git a/src/RepoGovernance.Web/Controllers/HomeController.cs b/src/RepoGovernance.Web/Controllers/HomeController.cs index cfa0a26d..b659cdf1 100644 --- a/src/RepoGovernance.Web/Controllers/HomeController.cs +++ b/src/RepoGovernance.Web/Controllers/HomeController.cs @@ -49,10 +49,6 @@ public async Task Index() } } } - //foreach (RepoLanguage repoLanguage in summaryItem.RepoLanguages) - //{ - // Debug.WriteLine(summaryItem.Repo + ":" + repoLanguage.Name + ":" + repoLanguage.Total); - //} } //Update the percent foreach (KeyValuePair sortedLanguage in repoLanguagesDictonary.OrderByDescending(x => x.Value)) @@ -73,11 +69,10 @@ public async Task Index() return View(summaryItemsIndex); } - //[HttpPost] public async Task UpdateRow(string user, string owner, string repo) { await _ServiceApiClient.UpdateSummaryItem(user, owner, repo); - return RedirectToAction("Index"); + return Redirect(Url.RouteUrl(new { controller = "Home", action = "Index" }) + "#" + repo); } public async Task UpdateAll() diff --git a/src/RepoGovernance.Web/Services/BaseServiceAPIClient.cs b/src/RepoGovernance.Web/Services/BaseServiceApiClient.cs similarity index 97% rename from src/RepoGovernance.Web/Services/BaseServiceAPIClient.cs rename to src/RepoGovernance.Web/Services/BaseServiceApiClient.cs index d01a338d..b8669cda 100644 --- a/src/RepoGovernance.Web/Services/BaseServiceAPIClient.cs +++ b/src/RepoGovernance.Web/Services/BaseServiceApiClient.cs @@ -22,7 +22,6 @@ public async Task> ReadMessageList(Uri url) StreamReader reader = new(stream); string text = reader.ReadToEnd(); return JsonConvert.DeserializeObject>(text); - //return await JsonSerializer.DeserializeAsync>(stream); } else { diff --git a/src/RepoGovernance.Web/Services/SummaryItemsServiceAPIClient.cs b/src/RepoGovernance.Web/Services/SummaryItemsServiceApiClient.cs similarity index 100% rename from src/RepoGovernance.Web/Services/SummaryItemsServiceAPIClient.cs rename to src/RepoGovernance.Web/Services/SummaryItemsServiceApiClient.cs diff --git a/src/RepoGovernance.Web/Views/Home/Index.cshtml b/src/RepoGovernance.Web/Views/Home/Index.cshtml index d51fa561..a2c44173 100644 --- a/src/RepoGovernance.Web/Views/Home/Index.cshtml +++ b/src/RepoGovernance.Web/Views/Home/Index.cshtml @@ -65,6 +65,7 @@
+ @item.Repo   @visibility  
@item.RepoSettings.description