Skip to content

Commit 10bae34

Browse files
authored
Merge pull request #437 from nanotaboada/feat/normalize-player-dataset
feat(data): normalize player dataset to 2022 FIFA World Cup Argentina squad (#435)
2 parents 2b84c0b + 075c766 commit 10bae34

File tree

10 files changed

+456
-122
lines changed

10 files changed

+456
-122
lines changed

.coderabbit.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,28 @@ reviews:
7777
- Ensure error messages are descriptive
7878
- Verify validators are registered in DI container
7979
80+
- path: "src/**/Mappings/**/*.cs"
81+
instructions: |
82+
- Profiles should inherit from AutoMapper Profile
83+
- Verify CreateMap<Source, Destination>() calls cover all DTOs in use
84+
- Check reverse mappings are defined where bidirectional mapping is needed
85+
- Ensure profiles are registered via AddAutoMapper() in the DI setup
86+
- Flag any manual property mappings that could be replaced by convention
87+
88+
- path: "src/**/Middlewares/**/*.cs"
89+
instructions: |
90+
- Middleware must implement InvokeAsync(HttpContext context) signature
91+
- Verify _next(context) is called unless the middleware intentionally short-circuits
92+
- Ensure exceptions are not swallowed — rethrow or translate to Problem Details
93+
- Middleware should be stateless; dependencies requiring request scope belong in services
94+
95+
- path: "src/**/Extensions/**/*.cs"
96+
instructions: |
97+
- Extension methods should target IServiceCollection and return IServiceCollection
98+
- Each method should encapsulate a single registration concern
99+
- Verify service lifetimes (Singleton/Scoped/Transient) match the dependency's usage
100+
- Follow the Add{Feature} naming convention (e.g. AddPlayerServices, AddRateLimiting)
101+
80102
- path: "test/**/*.cs"
81103
instructions: |
82104
- Tests should use xUnit, Moq, and FluentAssertions

.sonarcloud.properties

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# =============================================================================
2+
# SonarCloud Automatic Analysis configuration
3+
# https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/automatic-analysis/
4+
#
5+
# SonarCloud's automatic analysis (GitHub App, no CI workflow) reads THIS file.
6+
# Wildcard patterns are NOT supported here, so all exclusion paths must be
7+
# listed explicitly.
8+
# =============================================================================
9+
10+
sonar.sources=src/
11+
sonar.tests=test/
12+
sonar.sourceEncoding=UTF-8
13+
14+
# =============================================================================
15+
# Global exclusions
16+
# =============================================================================
17+
18+
sonar.exclusions=\
19+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\
20+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\
21+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\
22+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\
23+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\
24+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\
25+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\
26+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\
27+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs
28+
29+
# =============================================================================
30+
# Coverage exclusions
31+
# Test files and generated/infrastructure code should not count against
32+
# production code coverage metrics.
33+
# =============================================================================
34+
35+
sonar.coverage.exclusions=\
36+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs,\
37+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerServiceTests.cs,\
38+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerValidatorTests.cs,\
39+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/DatabaseFakes.cs,\
40+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs,\
41+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs,\
42+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerStubs.cs,\
43+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Usings.cs,\
44+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\
45+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\
46+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\
47+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\
48+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\
49+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\
50+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\
51+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\
52+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs,\
53+
src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerDbContext.cs,\
54+
src/Dotnet.Samples.AspNetCore.WebApi/Program.cs
55+
56+
# =============================================================================
57+
# Duplicate code (CPD) exclusions
58+
# Automatic analysis does not support wildcard patterns, so each file is
59+
# listed explicitly.
60+
#
61+
# Migrations — EF Core migration files are intentionally repetitive
62+
# (sequential InsertData/UpdateData/Sql calls).
63+
#
64+
# PlayerDbContext.cs — scaffolded EF Core infrastructure.
65+
#
66+
# PlayerData.cs — parallel WithId/without-Id method pairs mirror each other
67+
# by design; duplication is structural, not accidental.
68+
#
69+
# PlayerRequestModelValidator.cs — the "Create" and "Update" rule sets share
70+
# common rules by design; duplication is intentional.
71+
#
72+
# Test files — Fakes, Mocks, and Stubs are intentionally repetitive by design.
73+
# =============================================================================
74+
75+
sonar.cpd.exclusions=\
76+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\
77+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\
78+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\
79+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\
80+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\
81+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\
82+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\
83+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\
84+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs,\
85+
src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerDbContext.cs,\
86+
src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs,\
87+
src/Dotnet.Samples.AspNetCore.WebApi/Validators/PlayerRequestModelValidator.cs,\
88+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs,\
89+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerServiceTests.cs,\
90+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerValidatorTests.cs,\
91+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/DatabaseFakes.cs,\
92+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs,\
93+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs,\
94+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerStubs.cs,\
95+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Usings.cs

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ This project uses famous football stadiums (A-Z) that hosted FIFA World Cup matc
4949

5050
### Changed
5151

52+
- Normalize player dataset: add Lo Celso (squad 27), correct Fernández/Mac Allister/Messi team data, replace random UUIDs with deterministic UUID v5 values (#435)
53+
- Align CRUD test fixtures: Lo Celso (squad 27) for Create and Delete, Messi (squad 10) for Retrieve, Damián Martínez (squad 23) for Update (#435)
5254
- Bump `codecov/codecov-action` from 5.5.2 to 5.5.3 (#423)
5355

5456
### Fixed

sonar-project.properties

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)