Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clear queue end point #157

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Deployment/templates/functional-test-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ steps:
jsonTargetFiles: '**/appsettings.json'

- task: UseDotNet@2
displayName: 'Use .NET 6.0.x sdk'
displayName: 'Use .NET 8.0.x sdk'
inputs:
packageType: sdk
version: 6.0.x
version: 8.0.x

- task: DotNetCoreCLI@2
displayName: "Run Functional tests"
Expand Down
41 changes: 41 additions & 0 deletions NVDSuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,46 @@
</notes>
<packageUrl regex="true">^pkg:nuget/Azure\.Identity@.*$</packageUrl>
<vulnerabilityName>CVE-2024-29992</vulnerabilityName>
<vulnerabilityName>CVE-2024-35255</vulnerabilityName>
</suppress>
<suppress>
<notes>
<![CDATA[
file name: Azure.Identity.dll
Will be fixed with package updates as part of update to .NET 8
]]>
</notes>
<packageUrl regex="true">^pkg:generic/Azure\.Identity@.*$</packageUrl>
<cve>CVE-2024-35255</cve>
</suppress>
<suppress>
<notes>
<![CDATA[
file name: Microsoft.Identity.Client.Extensions.Msal.dll
Will be fixed with package updates as part of update to .NET 8
]]>
</notes>
<packageUrl regex="true">^pkg:generic/Microsoft\.Identity\.Client\.Extensions\.Msal@.*$</packageUrl>
<cve>CVE-2024-35255</cve>
</suppress>
<suppress>
<notes>
<![CDATA[
file name: Microsoft.Identity.Client.dll
Will be fixed with package updates as part of update to .NET 8
]]>
</notes>
<packageUrl regex="true">^pkg:generic/Microsoft\.Identity\.Client@.*$</packageUrl>
<cve>CVE-2024-35255</cve>
</suppress>
<suppress>
<notes>
<![CDATA[
file name: Microsoft.Identity.Client.dll
Will be fixed with package updates as part of update to .NET 8
]]>
</notes>
<packageUrl regex="true">^pkg:generic/Microsoft\.Identity\.Client@.*$</packageUrl>
<cve>CVE-2024-35255</cve>
</suppress>
</suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,13 @@ public IActionResult CommandToReturnStatus(string subject, HttpStatusCode? httpS
_logger.LogInformation("Command distributor webhook request not stored in memory for Subject: {Subject}", subject);
return BadRequestResponse();
}

[HttpGet("clear-queue")]
public IActionResult ClearDistributorQueue()
{
_logger.LogInformation("GET call to clear the queue");
_distributionService.ClearDistributorQueue();
return OkResponse();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ public bool SaveCommandDistributorRequest(string subject, HttpStatusCode? httpSt
{
return s_commandDistributionList.LastOrDefault(a => a.Subject == subject);
}

public void ClearDistributorQueue()
{
_logger.LogInformation("Starting to Clear the distributor queue");
var distQueue = s_recordDistributorRequestQueue.ToList();

if (distQueue.Count > 0)
{
foreach (var dist in distQueue)
{
s_recordDistributorRequestQueue.Remove(dist);
jrippington marked this conversation as resolved.
Show resolved Hide resolved
_logger.LogInformation("Item with subject {subject} deleted", dist.Subject);
}
}
}
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Storage.Queues" Version="12.17.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
<PackageReference Include="Microsoft.Azure.EventGrid" Version="3.2.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.1" />
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.6.0" />
<PackageReference Include="Elastic.Apm" Version="1.26.0" />
<PackageReference Include="Elastic.Apm.AspNetCore" Version="1.26.0" />
Expand All @@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
<PackageReference Include="Microsoft.Azure.Services.AppAuthentication" Version="1.6.2" />
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="6.0.29" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.59.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="3.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.22.0" />
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.11.0" />
<PackageReference Include="Azure.Storage.Queues" Version="12.17.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.1" />
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.6.0" />
<PackageReference Include="Elastic.Apm" Version="1.26.0" />
<PackageReference Include="Elastic.Apm.Azure.Storage" Version="1.26.0" />
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ stages:
workspace:
clean: all
variables:
- group: "ENS-QA-Variables"
- group: "ENS-QA-TF-Variables"
- group: "ENS-QA-Variables"
- group: "ENS-QA-APIM-SOLAS-Variables"
strategy:
Expand Down Expand Up @@ -762,7 +762,7 @@ stages:
- template: Deployment/templates/continuous-deployment-apim.yml
parameters:
ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }}
AzureSubscription: "UKHO-APIM-SOLAS-NonLive"
AzureSubscription: "UKHO-APIM-SOLAS-Live"
TerraformKeyVault: $(APIM_SOLAS_TERRAFORM_KEYVAULT)
APIMResourceGroup: $(APIM_SOLAS_RESOURCE_GROUP_NAME)
APIMServiceInstance: $(APIM_SOLAS_SERVICE_NAME)
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.421",
"version": "8.0.204",
"rollForward": "latestFeature"
}
}