Skip to content

refactor: add CreateBaseUsage helper and migrate 4 providers#635

Merged
rygel merged 1 commit into
developfrom
feat/create-base-usage-helper
Jun 12, 2026
Merged

refactor: add CreateBaseUsage helper and migrate 4 providers#635
rygel merged 1 commit into
developfrom
feat/create-base-usage-helper

Conversation

@rygel

@rygel rygel commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add \CreateBaseUsage()\ helper to \ProviderBase\ for success-case \ProviderUsage\ creation, complementing the existing \CreateUnavailableUsage()\
  • Sets common fields: \ProviderId, \ProviderName, \IsAvailable, \PlanType, \IsQuotaBased, \RawJson, \HttpStatus\
  • Migrate 4 providers (7 creation sites) to use the helper:
    • Mistral (1 site)
    • DeepSeek (2 sites)
    • Xiaomi (1 site)
    • Kimi (3 sites)

Changes

  • Net reduction: -48 lines of repeated property initialization
  • Part of infrastructure audit findings (task-51 / finding F1 from \docs/research/infrastructure-audit-findings.md)
  • 1361 tests pass, 0 failures

Test plan

  • \dotnet build\ -- 0 errors
  • \dotnet test\ -- 1361 passed, 0 failed
  • CI pipeline passes

- Add CreateBaseUsage() to ProviderBase for success-case ProviderUsage
  creation, complementing existing CreateUnavailableUsage()
- Sets common fields: ProviderId, ProviderName, IsAvailable, PlanType,
  IsQuotaBased, RawJson, HttpStatus
- Migrate Mistral (1 site), DeepSeek (2 sites), Xiaomi (1 site),
  Kimi (3 sites) to use the helper
- Net reduction: 48 lines of repeated property initialization
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Large PR Detected

This PR contains 2412 lines changed across 82 files.

Details:

  • 📁 Files changed: 82
  • ➕ Insertions: 583
  • ➖ Deletions: 1829
  • 📊 Total: 2412 lines

Recommendation:
Consider splitting this PR into smaller, focused changes to make review easier and faster. PRs under 500 lines are ideal for thorough code review.


This is an automated message. Feel free to ignore if this PR is intentionally large.

@rygel
rygel merged commit e4cb68f into develop Jun 12, 2026
17 checks passed
@rygel
rygel deleted the feat/create-base-usage-helper branch June 12, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants