Skip to content

Commit 9e5fcf6

Browse files
authored
Merge pull request #88 from Akash29g/feat/round-3-coverage-gate
R3 CI/CD: coverage gate + lint/format (dotnet format + Prettier)
2 parents 71a0a2e + 2d86eed commit 9e5fcf6

239 files changed

Lines changed: 4073 additions & 3023 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.config/dotnet-tools.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-reportgenerator-globaltool": {
6+
"version": "5.4.6",
7+
"commands": [ "reportgenerator" ]
8+
}
9+
}
10+
}

.github/workflows/ci.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ concurrency:
1616
jobs:
1717
# ───────────────────────── Backend (.NET 10) ─────────────────────────
1818
backend:
19-
name: backend (build + test)
19+
name: backend (build + coverage + format)
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
@@ -33,16 +33,17 @@ jobs:
3333
- name: Build
3434
run: dotnet build DocAnalytics.slnx --no-restore --configuration Release
3535

36-
- name: Test (correctness projects)
37-
run: |
38-
dotnet test DocAnalytics.Domain.Tests/DocAnalytics.Domain.Tests.csproj --no-build --configuration Release
39-
dotnet test DocAnalytics.Data.Tests/DocAnalytics.Data.Tests.csproj --no-build --configuration Release
40-
dotnet test DocAnalytics.Service.Tests/DocAnalytics.Service.Tests.csproj --no-build --configuration Release
41-
dotnet test DocAnalytics.Api.Tests/DocAnalytics.Api.Tests.csproj --no-build --configuration Release
36+
- name: Format check (dotnet format)
37+
run: dotnet format DocAnalytics.slnx --verify-no-changes
38+
39+
- name: Test + coverage gate (per layer)
40+
shell: bash
41+
run: bash scripts/coverage-gate.sh
42+
4243

4344
# ──────────────────────── Frontend (Angular 22) ────────────────────────
4445
frontend:
45-
name: frontend (build + test)
46+
name: frontend (build + test + format)
4647
runs-on: ubuntu-latest
4748
defaults:
4849
run:
@@ -61,10 +62,13 @@ jobs:
6162
- name: Install (clean)
6263
run: npm ci
6364

65+
- name: Prettier format check
66+
run: npm run format:check
67+
6468
- name: Build
6569
run: npm run build
6670

67-
- name: Test (Vitest, single run)
71+
- name: Test (Vitest, single run + coverage thresholds)
6872
run: npx ng test --watch=false
6973

7074
# ──────────────────────── DevSecOps (scans) ────────────────────────

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,3 +497,8 @@ perf/jmeter-report/
497497
perf/html-report/
498498
results.jtl
499499
body.json
500+
501+
# coverage / test artifacts
502+
coverage-out/
503+
coverage-report/
504+
TestResults/

DocAnalytics.Api/Auth/JwtSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace DocAnalytics.Api.Auth;
1+
namespace DocAnalytics.Api.Auth;
22

33
public class JwtSettings
44
{

DocAnalytics.Api/BackgroundServices/AlertEvaluationBackgroundService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using DocAnalytics.Service.Alerts;
23

4+
35
namespace DocAnalytics.Api.BackgroundServices;
46

7+
[ExcludeFromCodeCoverage]
58
public sealed class AlertEvaluationBackgroundService : BackgroundService
69
{
710
private readonly IServiceScopeFactory _scopes;

DocAnalytics.Api/BackgroundServices/ExtractionWorker.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using DocAnalytics.Api.Common;
1+
using System.Diagnostics.CodeAnalysis;
2+
using DocAnalytics.Api.Common;
23
using DocAnalytics.Data;
34
using DocAnalytics.Domain.Common;
45
using DocAnalytics.Domain.Entities;
@@ -7,8 +8,10 @@
78
using DocAnalytics.Service.Storage;
89
using Microsoft.EntityFrameworkCore;
910

11+
1012
namespace DocAnalytics.Api.BackgroundServices;
1113

14+
[ExcludeFromCodeCoverage]
1215
public sealed class ExtractionWorker : BackgroundService
1316
{
1417
private readonly IExtractionQueue _queue;

DocAnalytics.Api/Common/ApiResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace DocAnalytics.Api.Common;
1+
namespace DocAnalytics.Api.Common;
22

33
public class ApiResponse<T>
44
{

DocAnalytics.Api/Common/BaseController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.AspNetCore.Mvc;
1+
using Microsoft.AspNetCore.Mvc;
22

33
namespace DocAnalytics.Api.Common;
44

DocAnalytics.Api/Common/CurrentUser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using DocAnalytics.Domain.Common;
1+
using DocAnalytics.Domain.Common;
22

33
namespace DocAnalytics.Api.Common;
44

DocAnalytics.Api/Configuration/SecurityFoundationExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
using Microsoft.AspNetCore.HttpOverrides;
1+
using System.Diagnostics.CodeAnalysis;
2+
3+
24

35
namespace DocAnalytics.Api.Configuration;
46

7+
[ExcludeFromCodeCoverage]
58
public static class SecurityFoundationExtensions
69
{
710
/// <summary>

0 commit comments

Comments
 (0)