Skip to content

feat(data): normalize player dataset to 2022 FIFA World Cup Argentina squad (#435)#437

Merged
nanotaboada merged 7 commits intomasterfrom
feat/normalize-player-dataset
Mar 30, 2026
Merged

feat(data): normalize player dataset to 2022 FIFA World Cup Argentina squad (#435)#437
nanotaboada merged 7 commits intomasterfrom
feat/normalize-player-dataset

Conversation

@nanotaboada
Copy link
Copy Markdown
Owner

@nanotaboada nanotaboada commented Mar 29, 2026

Summary

  • Add Lo Celso (squad 27) to player dataset and test fixtures as the canonical Create/Delete fixture
  • Correct Fernández (Chelsea → SL Benfica / Liga Portugal), Mac Allister (Liverpool → Brighton), and Messi (Inter Miami → PSG / Ligue 1) to November 2022 World Cup snapshot values
  • Replace all 26 random UUIDs with deterministic UUID v5 values (namespace: FIFA_WORLD_CUP_QATAR_2022_ARGENTINA_SQUAD)
  • Add EF Core migration NormalizePlayerDataset to apply all data changes incrementally
  • Rebuild storage/players-sqlite3.db from migrations (27 players)
  • Align PlayerFakes.MakeNew() to Lo Celso (squad 27) and update Delete controller test accordingly

Test plan

  • dotnet build --configuration Release — passes (0 warnings, 0 errors)
  • dotnet test --settings .runsettings — 39/39 passed
  • Database rebuilt from migrations — 27 players with canonical UUID v5 values verified via SQLite query

Closes #435

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Giovani Lo Celso (squad 27) to the substitute roster.
  • Bug Fixes

    • Corrected team and league assignments for multiple players.
  • Changed

    • Switched to deterministic player identifiers (UUID v5) for consistency.
  • Tests

    • Aligned CRUD test fixtures and updated unit test setups accordingly.
  • Chores

    • Updated changelog, repository review rules, and code-analysis/coverage configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2026

Warning

Rate limit exceeded

@nanotaboada has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cb2471b6-4160-4a26-870a-3c099b3a8800

📥 Commits

Reviewing files that changed from the base of the PR and between be21405 and 075c766.

📒 Files selected for processing (1)
  • .sonarcloud.properties

Walkthrough

Normalize in-repo player fixtures to the canonical 2022 Argentina squad: add Giovani Lo Celso (squad 27), correct three players' team/league values, replace hardcoded UUIDs with deterministic UUID v5 in PlayerData, align test fixtures/usages to use squad 27 for Create/Delete, update CHANGELOG and SonarCloud/.coderabbit config.

Changes

Cohort / File(s) Summary
Player Dataset Normalization
src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs
Added Giovani Lo Celso (squad 27) to substitutes; corrected Enzo Fernández, Alexis Mac Allister, Lionel Messi team/league strings; replaced many hardcoded GUIDs with deterministic UUID v5 values; minor JSON/options reformatting.
Test Fixture Alignment
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs
MakeNew() now selects squad 27 (Lo Celso) instead of squad 5; updated XML docs/messages and minor formatting changes.
Controller Test Updates
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs
Delete_PlayerBySquadNumber_Existing_Returns204NoContent uses MakeResponseModelForCreate() and derives squadNumber from response.Dorsal (reflects squad 27).
Changelog
CHANGELOG.md
Added two lines under [Unreleased] documenting dataset normalization and CRUD fixture alignment.
CI / Review Config
.coderabbit.yaml
Added three new reviews.path_instructions blocks targeting src/**/Mappings/**, src/**/Middlewares/**, and src/**/Extensions/** describing review rules for AutoMapper, middleware, and extension-method patterns.
Static Analysis Config
sonar-project.properties, .sonarcloud.properties
Removed legacy sonar-project.properties; added .sonarcloud.properties with explicit sonar.sources/tests and path-based exclusions for migrations, generated files, test utilities, Program/DbContext, and CPD/coverage exclusion lists.

Sequence Diagram(s)

(omitted — changes are data/fixture updates and test/config adjustments without new multi-component control flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
Add missing player Giovani Lo Celso (squad 27) with correct profile fields and UUID v5 (#435)
Correct team/league data for Enzo Fernández, Alexis Mac Allister, and Lionel Messi (#435)
Replace all hardcoded random UUIDs with deterministic UUID v5 values (27 players) (#435)
Implement EF Core migration to persist normalized data and rebuild SQLite database (#435) No EF Core migration or DB seed update included; changes are in-memory/test fixtures and PlayerData only.

Out-of-scope changes

Code Change Explanation
Added review rules for AutoMapper/Middleware/Extensions (.coderabbit.yaml) CI/review-tooling configuration not requested by #435; unrelated to dataset normalization or migration.
Removed sonar-project.properties and added .sonarcloud.properties (sonar config) Static analysis configuration changes; not part of dataset normalization, UUID migration, or EF Core migration objectives.

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title uses the Conventional Commits format (feat:) and is descriptive about normalizing the player dataset. However, it exceeds the 80-character limit at 82 characters. Shorten the title to stay within 80 characters. Consider: 'feat(data): normalize player dataset to 2022 Argentina World Cup squad (#435)' (79 chars).
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 95.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/normalize-player-dataset
  • 🛠️ sync documentation: Commit on current branch
  • 🛠️ sync documentation: Create PR
  • 🛠️ enforce http error handling: Commit on current branch
  • 🛠️ enforce http error handling: Create PR
  • 🛠️ idiomatic review: Commit on current branch
  • 🛠️ idiomatic review: Create PR
  • 🛠️ verify api contract: Commit on current branch
  • 🛠️ verify api contract: Create PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nanotaboada nanotaboada force-pushed the feat/normalize-player-dataset branch from 2b35c8a to 27dbb85 Compare March 29, 2026 19:45
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs (1)

868-903: ⚠️ Potential issue | 🟡 Minor

Data inconsistency: MakeStarting11FromDeserializedJson() still contains outdated team/league values.

The embedded JSON literal was not updated to match the November 2022 snapshot corrections applied to MakeStarting11() and MakeStarting11WithId():

Player Current JSON value Expected value
Enzo Fernández Chelsea FC / Premier League SL Benfica / Liga Portugal
Mac Allister Liverpool FC Brighton & Hove Albion
Messi Inter Miami CF / Major League Soccer Paris Saint-Germain / Ligue 1

This could cause confusion if this method is used for testing or demonstration purposes.

🛠️ Suggested fix
                 {
                     "firstName": "Enzo",
                     "middleName": "Jeremías",
                     "lastName": "Fernández",
                     "dateOfBirth": "2001-01-16T00:00:00.000Z",
                     "squadNumber": 24,
                     "position": "Central Midfield",
                     "abbrPosition": "CM",
-                    "team": "Chelsea FC",
-                    "league": "Premier League",
+                    "team": "SL Benfica",
+                    "league": "Liga Portugal",
                     "starting11": true
                 },
                 {
                     "firstName": "Alexis",
                     "middleName": null,
                     "lastName": "Mac Allister",
                     "dateOfBirth": "1998-12-23T00:00:00.000Z",
                     "squadNumber": 20,
                     "position": "Central Midfield",
                     "abbrPosition": "CM",
-                    "team": "Liverpool FC",
+                    "team": "Brighton & Hove Albion",
                     "league": "Premier League",
                     "starting11": true
                 },
                 {
                     "firstName": "Lionel",
                     "middleName": "Andrés",
                     "lastName": "Messi",
                     "dateOfBirth": "1987-06-23T00:00:00.000Z",
                     "squadNumber": 10,
                     "position": "Right Winger",
                     "abbrPosition": "RW",
-                    "team": "Inter Miami CF",
-                    "league": "Major League Soccer",
+                    "team": "Paris Saint-Germain",
+                    "league": "Ligue 1",
                     "starting11": true
                 },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs` around lines
868 - 903, Update the embedded JSON literal inside
MakeStarting11FromDeserializedJson() so the team/league entries match the
corrected snapshot used by MakeStarting11() and MakeStarting11WithId(): change
Enzo Fernández's team/league to "SL Benfica" / "Liga Portugal", change Alexis
Mac Allister's team to "Brighton & Hove Albion", and change Lionel Messi's
team/league to "Paris Saint-Germain" / "Ligue 1"; ensure the JSON keys
(firstName, lastName, squadNumber, position, abbrPosition, team, league,
starting11) remain unchanged and the literal parses correctly when deserialized.
🧹 Nitpick comments (1)
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs (1)

489-490: Test alignment with Lo Celso (squad 27) looks correct.

The change properly aligns the delete test with the new canonical Create/Delete fixture. However, consider deriving squadNumber from the response model to ensure consistency if the fixture ever changes:

♻️ Optional: derive squadNumber from response
-        var squadNumber = 27;
         var response = PlayerFakes.MakeResponseModelForCreate();
+        var squadNumber = response.Dorsal;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs`
around lines 489 - 490, The test currently hardcodes var squadNumber = 27 while
also calling PlayerFakes.MakeResponseModelForCreate(); update the test to derive
squadNumber from the response model (e.g., read the squad number property off
the object returned by PlayerFakes.MakeResponseModelForCreate()) so the
Create/Delete fixture remains consistent if the fake changes; locate where
squadNumber is declared and replace the literal with
response.<squadNumberProperty> (use the actual property name on the response
model).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs`:
- Around line 868-903: Update the embedded JSON literal inside
MakeStarting11FromDeserializedJson() so the team/league entries match the
corrected snapshot used by MakeStarting11() and MakeStarting11WithId(): change
Enzo Fernández's team/league to "SL Benfica" / "Liga Portugal", change Alexis
Mac Allister's team to "Brighton & Hove Albion", and change Lionel Messi's
team/league to "Paris Saint-Germain" / "Ligue 1"; ensure the JSON keys
(firstName, lastName, squadNumber, position, abbrPosition, team, league,
starting11) remain unchanged and the literal parses correctly when deserialized.

---

Nitpick comments:
In `@test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs`:
- Around line 489-490: The test currently hardcodes var squadNumber = 27 while
also calling PlayerFakes.MakeResponseModelForCreate(); update the test to derive
squadNumber from the response model (e.g., read the squad number property off
the object returned by PlayerFakes.MakeResponseModelForCreate()) so the
Create/Delete fixture remains consistent if the fake changes; locate where
squadNumber is declared and replace the literal with
response.<squadNumberProperty> (use the actual property name on the response
model).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7bf9ce87-d038-4bfd-a48e-fa26e1eedf25

📥 Commits

Reviewing files that changed from the base of the PR and between 2b84c0b and 2b35c8a.

⛔ Files ignored due to path filters (6)
  • src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs is excluded by !**/Migrations/**
  • src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs is excluded by !**/Migrations/**
  • src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs is excluded by !**/Migrations/**
  • src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs is excluded by !**/Migrations/**, !**/*.Designer.cs
  • src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs is excluded by !**/Migrations/**
  • src/Dotnet.Samples.AspNetCore.WebApi/storage/players-sqlite3.db is excluded by !**/*.db, !**/storage/**, !**/*.db
📒 Files selected for processing (9)
  • CHANGELOG.md
  • src/Dotnet.Samples.AspNetCore.WebApi/Configurations/AuthorizeCheckOperationFilter.cs
  • src/Dotnet.Samples.AspNetCore.WebApi/Controllers/PlayerController.cs
  • src/Dotnet.Samples.AspNetCore.WebApi/Extensions/ServiceCollectionExtensions.cs
  • src/Dotnet.Samples.AspNetCore.WebApi/Middlewares/ExceptionMiddleware.cs
  • src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs
  • src/Dotnet.Samples.AspNetCore.WebApi/Utilities/SwaggerUtilities.cs
  • test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs
  • test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@nanotaboada nanotaboada force-pushed the feat/normalize-player-dataset branch from 27dbb85 to 14efe16 Compare March 29, 2026 19:54
Repository owner deleted a comment from sonarqubecloud Bot Mar 29, 2026
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@nanotaboada nanotaboada force-pushed the feat/normalize-player-dataset branch from 957fb83 to 690e8f6 Compare March 29, 2026 20:11
Repository owner deleted a comment from sonarqubecloud Bot Mar 29, 2026
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
sonar-project.properties (1)

43-44: Recheck Program.cs coverage exclusion scope.

At Line 44, excluding **/Program.cs is only safe if startup is boilerplate. If it contains custom middleware/auth/DI wiring, keep it covered (or cover via integration tests) so configuration regressions are visible.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sonar-project.properties` around lines 43 - 44, Review Program.cs for any
non-boilerplate startup code (custom middleware, auth setup, DI wiring, hosted
service registration); if it contains such logic, remove the exclusion pattern
"**/Program.cs" from sonar-project.properties so SonarQube measures its
coverage, or narrow the exclusion to a safe subset instead of excluding the
whole file; if you prefer to keep it excluded, add integration tests that
exercise the middleware/DI/auth paths (the startup wiring in Program.cs) so
configuration regressions are covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@sonar-project.properties`:
- Around line 43-44: Review Program.cs for any non-boilerplate startup code
(custom middleware, auth setup, DI wiring, hosted service registration); if it
contains such logic, remove the exclusion pattern "**/Program.cs" from
sonar-project.properties so SonarQube measures its coverage, or narrow the
exclusion to a safe subset instead of excluding the whole file; if you prefer to
keep it excluded, add integration tests that exercise the middleware/DI/auth
paths (the startup wiring in Program.cs) so configuration regressions are
covered.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df579ad0-74a6-451d-b5c3-bde2fbf3cada

📥 Commits

Reviewing files that changed from the base of the PR and between 14efe16 and 9586e35.

📒 Files selected for processing (4)
  • .coderabbit.yaml
  • sonar-project.properties
  • src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs
  • test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs
✅ Files skipped from review due to trivial changes (1)
  • .coderabbit.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs

nanotaboada and others added 3 commits March 29, 2026 18:01
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…435)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…ture (#435)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.sonarcloud.properties (1)

21-30: Wildcard patterns aren't supported in .sonarcloud.properties; use SonarCloud UI or migrate to CI-based config for maintainable exclusions.

Manually enumerating every migration and test utility file is unsustainable. .sonarcloud.properties doesn't support wildcard patterns (*, **) for sonar.exclusions, sonar.test.exclusions, or sonar.cpd.exclusions—paths must be explicitly listed.

Two recommended alternatives:

  1. SonarCloud UI (simpler): Project Administration → General Settings → Analysis Scope → exclude paths like **/Migrations/*.cs (supports full wildcard patterns). No code changes needed.
  2. CI-based analysis: Migrate to a CI workflow with sonar-project.properties (e.g., GitHub Actions), which supports wildcards in SonarScanner properties.

Alternatively, generate these lists via a build step, but the UI or CI approach is preferred for maintainability.

Also applies to: 38-57, 78-98

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.sonarcloud.properties around lines 21 - 30, The .sonarcloud.properties file
is using sonar.exclusions to list many paths but that file does not support
wildcard patterns—move these exclusions out of the checked-in
.sonarcloud.properties and either (A) configure the wildcard exclusions in the
SonarCloud UI under Project Administration → General Settings → Analysis Scope
using patterns like **/Migrations/*.cs, or (B) migrate analysis to a CI-based
sonar-project.properties (used by your SonarScanner in the pipeline) where
sonar.exclusions, sonar.test.exclusions and sonar.cpd.exclusions can contain
wildcards; update the repo by removing or minimizing the long explicit lists
from .sonarcloud.properties and implement one of the two alternatives so future
migration/test files can be excluded with wildcards.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.sonarcloud.properties:
- Around line 9-10: Update the stale comment in .sonarcloud.properties that
references "sonar-project.properties": remove or reword the line
"sonar-project.properties is kept for documentation and as a fallback if
CI-based analysis is ever introduced." so it no longer claims a file that this
PR deletes; ensure the comment accurately reflects current repo state (either
drop the fallback note or point to the correct alternate file/location).

---

Nitpick comments:
In @.sonarcloud.properties:
- Around line 21-30: The .sonarcloud.properties file is using sonar.exclusions
to list many paths but that file does not support wildcard patterns—move these
exclusions out of the checked-in .sonarcloud.properties and either (A) configure
the wildcard exclusions in the SonarCloud UI under Project Administration →
General Settings → Analysis Scope using patterns like **/Migrations/*.cs, or (B)
migrate analysis to a CI-based sonar-project.properties (used by your
SonarScanner in the pipeline) where sonar.exclusions, sonar.test.exclusions and
sonar.cpd.exclusions can contain wildcards; update the repo by removing or
minimizing the long explicit lists from .sonarcloud.properties and implement one
of the two alternatives so future migration/test files can be excluded with
wildcards.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cc95be09-3e02-4c5d-ba24-966480cb96aa

📥 Commits

Reviewing files that changed from the base of the PR and between 9586e35 and be21405.

⛔ Files ignored due to path filters (2)
  • src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs is excluded by !**/Migrations/**
  • src/Dotnet.Samples.AspNetCore.WebApi/storage/players-sqlite3.db is excluded by !**/*.db, !**/storage/**, !**/*.db
📒 Files selected for processing (3)
  • .sonarcloud.properties
  • sonar-project.properties
  • src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs
💤 Files with no reviewable changes (1)
  • sonar-project.properties
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs

Comment thread .sonarcloud.properties Outdated
…#435)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize player dataset to 2022 FIFA World Cup Argentina squad (26 players)

1 participant