-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
script to change the database and add partitions (#144)
* script to change the database and add partitions * added one more partition for 2024 * background service to create partitions and relevant integration test * refactor program.cs, partitioncreationhostedservice * log for checking the dispose error * fixed dispose and updated list to readonlylist * Fix failing tests, remove unnecessary files * Update build-analyze.yml to use linux runner (#146) * Update build-analyze.yml to use linux runner * removed unecessary commands * updated comment and removed empty lines * add webjobs package * logging for testing * remove noincremental from build * update the test report path * update sonar reportspaths * removed admin from app datasource * fixed pr comments * fixed PR comments * Fixed PR comments and removed unecessary methods * Removed postgressqlsettings, added new setting format in development json --------- Co-authored-by: acn-dgopa <acn-dgopa@dev-acn-tje-14>
- Loading branch information
Showing
86 changed files
with
1,313 additions
and
15,981 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Altinn.Auth.AuditLog.Core.Models | ||
{ | ||
/// <summary> | ||
/// Used for partition creation | ||
/// </summary> | ||
public sealed record Partition | ||
{ | ||
public required string Name { get; set; } | ||
public required DateOnly StartDate { get; set; } | ||
public required DateOnly EndDate { get; set;} | ||
public required string SchemaName { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/Altinn.Auth.AuditLog.Core/Repositories/Interfaces/IPartitionManagerRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Altinn.Auth.AuditLog.Core.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Altinn.Auth.AuditLog.Core.Repositories.Interfaces | ||
{ | ||
/// <summary> | ||
/// Interface for PostgresSQL operations on partition management | ||
/// </summary> | ||
public interface IPartitionManagerRepository | ||
{ | ||
/// <summary> | ||
/// Checks and creates necessary partition for authentication event table | ||
/// </summary> | ||
/// <param name="partitions">the list of partitions to be created</param> | ||
/// <param name="cancellationToken">A <see cref="CancellationToken"/>.</param> | ||
/// <returns>true if the partition is created</returns> | ||
Task CreatePartitions(IReadOnlyList<Partition> partitions, CancellationToken cancellationToken = default); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/Altinn.Auth.AuditLog.Core/Services/AuthenticationEventService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Altinn.Auth.AuditLog.Core/Services/Interfaces/IAuthenticationEventService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
src/Altinn.Auth.AuditLog.Persistence/Altinn.Auth.AuditLog.Persistence.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Altinn.Authorization.ServiceDefaults" Version="2.6.1" /> | ||
<PackageReference Include="Altinn.Authorization.ServiceDefaults.Npgsql" Version="2.6.1" /> | ||
<PackageReference Include="Altinn.Authorization.ServiceDefaults.Npgsql.Yuniql" Version="2.6.1" /> | ||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" /> | ||
<PackageReference Include="Npgsql" Version="8.0.5" /> | ||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.10" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Altinn.Auth.AuditLog.Core\Altinn.Auth.AuditLog.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<InternalsVisibleTo Include="$(AssemblyName).Tests" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="Migration/**/*.sql" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.