Skip to content

Remove unused codes - #15579

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
JinHai-CN:fix444
Jun 3, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
JinHai-CN:fix444

Conversation

@JinHai-CN

Copy link
Copy Markdown
Member

What problem does this PR solve?

Remove unused code.

Type of change

  • Refactoring

Signed-off-by: Jin Hai <[email protected]>
@JinHai-CN JinHai-CN added the ci Continue Integration label Jun 3, 2026
@coderabbitai

coderabbitai Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5ffa5a1-a862-4147-9c78-3818bbb45309

📥 Commits

Reviewing files that changed from the base of the PR and between d736f35 and 56dcb3a.

📒 Files selected for processing (9)
  • cmd/ingestion_server.go
  • cmd/server_main.go
  • internal/dao/database.go
  • internal/dao/model_provider.go
  • internal/handler/llm.go
  • internal/router/router.go
  • internal/server/model_provider.go
  • internal/service/dataset.go
  • internal/service/model_service.go
💤 Files with no reviewable changes (7)
  • internal/dao/model_provider.go
  • internal/server/model_provider.go
  • internal/handler/llm.go
  • cmd/server_main.go
  • cmd/ingestion_server.go
  • internal/router/router.go
  • internal/dao/database.go

📝 Walkthrough

Walkthrough

This pull request removes the model provider configuration and LLM factory initialization framework, eliminates associated API routes and handlers, cleans up startup sequences, and centralizes UUID generation across the codebase. The changes represent a complete removal of in-memory model provider caching and JSON-based factory configuration loading.

Changes

Model Provider Framework and UUID Refactoring

Layer / File(s) Summary
Core Infrastructure and DAO Cleanup
internal/dao/database.go, internal/handler/llm.go
Removes the InitLLMFactory() function that read conf/llm_factories.json, parsed LLM factory data, and persisted it to the database. Cleans up database imports and handler dependencies on the DAO layer.
Handler and Route Removal
internal/handler/llm.go, internal/router/router.go
Deletes the Factories handler method and the entire /v1/llm API route group (including /my_llms, /factories, /list, and /set_api_key endpoints).
Startup Sequence Cleanup
cmd/ingestion_server.go
Removes the dao.InitLLMFactory() initialization call from the ingestion server startup, transitioning directly from database setup to doc engine initialization.
UUID Generation Centralization
internal/service/dataset.go, internal/service/model_service.go
Replaces local generateUUID1Hex() helper functions with centralized utility.GenerateUUID1() in dataset creation and four model service ID generation paths (AddModelProvider, CreateProviderInstance, UpdateModelStatus, AddModel).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

☯️ refactor, size:L

Suggested reviewers

  • Magicbook1108
  • buua436
  • Lynn-Inf

Poem

🐰 The model factory closes its doors,
UUID centralization restores,
Routes and handlers fade to dust,
Clean startup sequences we trust,
One utility UUID beats them all!

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete and lacks sufficient detail about the scope, rationale, and impact of the refactoring. Required template sections are present but minimally filled. Expand the description to explain which components/features are being removed (LLM factory initialization, model provider system, related endpoints/routes) and why they're no longer needed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Remove unused codes' is overly vague and generic, using non-descriptive language that doesn't convey the specific scope or impact of the refactoring changes. Clarify the title to specify what unused code is being removed, e.g., 'Remove unused LLM factory initialization and model provider code' or 'Remove unused LLM-related factory and provider initialization'.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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.

@JinHai-CN
JinHai-CN marked this pull request as ready for review June 3, 2026 08:39
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 3, 2026
@JinHai-CN
JinHai-CN marked this pull request as draft June 3, 2026 08:39
@dosubot dosubot Bot added the ☯️ refactor Pull request that refactor/refine code label Jun 3, 2026
@JinHai-CN
JinHai-CN marked this pull request as ready for review June 3, 2026 08:39
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (d736f35) to head (56dcb3a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15579   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          668      668           
  Misses         29       29           
  Partials       20       20           

☔ 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.

@JinHai-CN
JinHai-CN merged commit 2061edd into infiniflow:main Jun 3, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration ☯️ refactor Pull request that refactor/refine code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant