Skip to content

feat(go): Add DeepSeek models and Gitee alias metadata tests - #15885

Merged
JinHai-CN merged 3 commits into
infiniflow:mainfrom
Harry-Hz-Zhang:feat-all-models-deepseek
Jun 10, 2026
Merged

JinHai-CN merged 3 commits into
infiniflow:mainfrom
Harry-Hz-Zhang:feat-all-models-deepseek

Conversation

@Harry-Hz-Zhang

@Harry-Hz-Zhang Harry-Hz-Zhang commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

This PR expands conf/all_models.json with DeepSeek model entries and provider aliases.

Changes:

  • Added DeepSeek model entries across V4, V3.2, V3.1, V3, R1, Coder, Math, VL, OCR, Prover, MoE, and LLM series.
  • Normalized model name values to lowercase canonical IDs.
  • Added alias values for official DeepSeek/Hugging Face names and provider-specific names from OpenRouter, VolcEngine, SiliconFlow, HuaweiCloud, and QiniuCloud.
  • Preserved model metadata such as max_tokens, model_types, and thinking where applicable.
  • Added Gitee ListModels tests to verify DeepSeek aliases map back to model metadata from all_models.json.
  • Added an optional Gitee integration test gated by GITEE_LIST_MODELS_INTEGRATION=1.

Test:

/usr/local/go/bin/go clean -cache
/usr/local/go/bin/go test ./internal/entity/models -run 'TestGiteeListModels(MapsAllDeepSeekAliasesToModelMetadata|KeepsOwnedBySuffixAfterAliasMetadataLookup| Integration)'

#15853

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends the model registry by adding DeepSeek base variants and expanded aliases, then introduces comprehensive tests validating Gitee provider model listing with proper alias-to-metadata mapping and metadata field propagation.

Changes

DeepSeek Model Registry and Gitee Provider Tests

Layer / File(s) Summary
DeepSeek Model Registry Updates
conf/all_models.json
Updated deepseek-v4-flash with additional aliases, added deepseek-v4-flash-base and deepseek-v4-pro-base entries, removed thinking block from deepseek-v4-pro, and inserted a large collection of new DeepSeek chat/OCR/image2text models with corresponding alias, max_tokens, and model_types metadata.
JSON Alias Reformatting
conf/all_models.json
Reformatted alias arrays for bge-m3, bge-reranker-v2-m3, qwen3-asr-1.7b, and paddleocr-vl-0.9b from compact single-line to multi-line JSON format without semantic changes.
Gitee Provider ListModels Test Suite
internal/entity/models/gitee_test.go
Added test file with helper functions for provider setup and DeepSeek alias mapping, unit tests validating deterministic alias-to-metadata mapping with correct MaxTokens, ModelTypes, and Thinking propagation, name suffix preservation after metadata lookup, and optional integration test against live Gitee endpoint.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • infiniflow/ragflow#15862: The new gitee_test.go validates ListModels output structure that was refined in #15862 (e.g., joinModelNames helper and return signature compatibility changes).
  • infiniflow/ragflow#15131: Both PRs target the Gitee provider model-listing pathway; #15131 implements ListModels while this PR adds comprehensive test coverage for that behavior.
  • infiniflow/ragflow#15786: Both PRs overlap on conf/all_models.json by adding/updating DeepSeek model entries with aliases and metadata that the model-listing and lookup logic consumes.

Suggested labels

💞 feature, size:L, 🧪 test

Suggested reviewers

  • Haruko386
  • yingfeng

Poem

🐰 Deep into the SeekV4 warren we hop,
New aliases bloom where old ones stop,
Base variants join the testing flow,
Gitee models map from metadata below,
A comprehensive suite validates all! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding DeepSeek models to the registry and implementing Gitee alias metadata tests.
Description check ✅ Passed The description adequately covers the PR objectives, explains the changes made to conf/all_models.json, describes the new tests, and includes test invocation details.
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.

@Harry-Hz-Zhang Harry-Hz-Zhang added the ci Continue Integration label Jun 10, 2026
@Harry-Hz-Zhang
Harry-Hz-Zhang marked this pull request as draft June 10, 2026 05:00
@Harry-Hz-Zhang
Harry-Hz-Zhang marked this pull request as ready for review June 10, 2026 05:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/entity/models/gitee_test.go`:
- Around line 107-109: In the httptest handler in
internal/entity/models/gitee_test.go replace the call to t.Fatalf("encode
response: %v", err) inside the goroutine with t.Errorf("encode response: %v",
err) and return immediately after logging the error to stop further handler
work; locate the json.NewEncoder(w).Encode(resp) call in the
httptest.NewServer(http.HandlerFunc(...)) handler and swap t.Fatalf for t.Errorf
plus a return so the test failure is reported from the handler goroutine without
calling Fatalf.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7e3a5f37-735e-46fa-bc61-b0e1a27adfbb

📥 Commits

Reviewing files that changed from the base of the PR and between 7f4bf69 and 630422f.

📒 Files selected for processing (2)
  • conf/all_models.json
  • internal/entity/models/gitee_test.go

Comment on lines +107 to +109
if err := json.NewEncoder(w).Encode(resp); err != nil {
t.Fatalf("encode response: %v", err)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify handler-goroutine Fatal* usage in model tests.
rg -nP --type=go 'httptest\.NewServer\(http\.HandlerFunc\(' internal/entity/models -C4
rg -nP --type=go 't\.Fatalf\(' internal/entity/models/*_test.go -C2

Repository: infiniflow/ragflow

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the specific location mentioned in the review comment
sed -n '90,130p' internal/entity/models/gitee_test.go

# Confirm whether any t.Fatalf exists anywhere under internal/entity/models/*_test.go
rg -n --type=go 't\.Fatalf\(' internal/entity/models/*_test.go

Repository: infiniflow/ragflow

Length of output: 42745


Avoid t.Fatalf in net/http handler goroutines (use t.Errorf instead).

internal/entity/models/gitee_test.go calls t.Fatalf("encode response: %v", err) inside the httptest.NewServer(http.HandlerFunc(...)) handler. Replace it so the test failure is reported reliably from that handler goroutine.

Suggested patch
-		if err := json.NewEncoder(w).Encode(resp); err != nil {
-			t.Fatalf("encode response: %v", err)
-		}
+		if err := json.NewEncoder(w).Encode(resp); err != nil {
+			t.Errorf("encode response: %v", err)
+		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if err := json.NewEncoder(w).Encode(resp); err != nil {
t.Fatalf("encode response: %v", err)
}
if err := json.NewEncoder(w).Encode(resp); err != nil {
t.Errorf("encode response: %v", err)
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/entity/models/gitee_test.go` around lines 107 - 109, In the httptest
handler in internal/entity/models/gitee_test.go replace the call to
t.Fatalf("encode response: %v", err) inside the goroutine with t.Errorf("encode
response: %v", err) and return immediately after logging the error to stop
further handler work; locate the json.NewEncoder(w).Encode(resp) call in the
httptest.NewServer(http.HandlerFunc(...)) handler and swap t.Fatalf for t.Errorf
plus a return so the test failure is reported from the handler goroutine without
calling Fatalf.

Source: Learnings

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (d56aeb2) to head (630422f).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15885   +/-   ##
=======================================
  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 Harness.
📢 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.

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

Labels

ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants