Skip to content

PM-33964 - Fix silent switch defaults in Seeder with fail-fast throws#7277

Merged
theMickster merged 1 commit intomainfrom
server-PM-33964/fix-switch-defaults
Mar 23, 2026
Merged

PM-33964 - Fix silent switch defaults in Seeder with fail-fast throws#7277
theMickster merged 1 commit intomainfrom
server-PM-33964/fix-switch-defaults

Conversation

@theMickster
Copy link
Copy Markdown
Contributor

@theMickster theMickster commented Mar 23, 2026

🎟️ Tracking

PM-33964

📔 Objective

Enforce the Seeder's default: throw rule by replacing 12 silent _ => fallbacks across 6 files with explicit throw statements, preventing future enum or string additions from silently producing incorrect data. Three IdentityDataGenerator switches that were actively hit by MiddleEast, Africa, and Global regions now have explicit cases preserving the original behavior before the throw guard. One intentional fallback in PlanFeatures.cs (covering 20+ legacy plan types) was documented with a comment rather than changed.

@theMickster theMickster added the ai-review-vnext Request a Claude code review using the vNext workflow label Mar 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 23, 2026

Overall Assessment: APPROVE

This PR replaces 12 silent _ => switch defaults across 6 Seeder utility files with explicit throw statements, enforcing fail-fast behavior when unexpected enum or string values are encountered. Where the default branch was actively reached by valid values (MiddleEast, Africa, Global regions in IdentityDataGenerator), explicit cases were added to preserve existing behavior before the throw guard. The one intentional fallback in PlanFeatures.cs covering 20+ legacy plan types was documented with a comment rather than changed.

All changes are confined to util/Seeder/ tooling code. No production code is affected.

Code Review Details

No findings. The changes are mechanical, behavior-preserving, and well-scoped.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

Logo
Checkmarx One – Scan Summary & Detailsf3a6a652-ba1a-4a8d-9e3e-1b9f74d489dd

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.72%. Comparing base (552a2c1) to head (912cc0f).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7277      +/-   ##
==========================================
- Coverage   57.72%   57.72%   -0.01%     
==========================================
  Files        2042     2042              
  Lines       89817    89817              
  Branches     7985     7985              
==========================================
- Hits        51845    51844       -1     
- Misses      36114    36115       +1     
  Partials     1858     1858              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@theMickster theMickster merged commit 8310ea1 into main Mar 23, 2026
48 checks passed
@theMickster theMickster deleted the server-PM-33964/fix-switch-defaults branch March 23, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants