Skip to content

fix: only fetch deployment settings on deployments page - #5466

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/model-development
Jun 12, 2026
Merged

fix: only fetch deployment settings on deployments page#5466
seefs001 merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/model-development

Conversation

@seefs001

@seefs001 seefs001 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

模型部署Guard缩小范围

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

  • Refactor
    • Internal restructuring of the models interface for improved code organization. No user-facing changes.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

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: 5bb9c3f9-418a-4821-8ad3-5bae16b66d40

📥 Commits

Reviewing files that changed from the base of the PR and between 1507229 and 46f1de4.

📒 Files selected for processing (1)
  • web/default/src/features/models/index.tsx

Walkthrough

The ModelsContent component is refactored to extract deployment-related logic into a new internal DeploymentsSection component. ModelsContent no longer directly calls useModelDeploymentSettings or manages the prefetch effect; instead, it delegates to DeploymentsSection when the deployments tab is active.

Changes

Deployments Section Extraction

Layer / File(s) Summary
Extract deployments logic into DeploymentsSection component
web/default/src/features/models/index.tsx
New DeploymentsSection component is created with useModelDeploymentSettings, query prefetch logic using connection state, and DeploymentAccessGuard wrapping. ModelsContent switches from inline DeploymentAccessGuard + DeploymentsTable rendering to using the new component. Deployment hook calls and related useQueryClient usage are removed from ModelsContent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A component grows too wide, deployments tucked inside,
So out we pull the logic, keep the structure neat and sleek,
DeploymentsSection takes the weight, the settings, prefetch, guard—
ModelsContent breathes easier now, its duties growing hard!

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: moving deployment settings fetching to only occur on the deployments page, which aligns with the refactoring of ModelsContent to conditionally render DeploymentsSection.
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.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@seefs001
seefs001 merged commit 51475c8 into QuantumNous:main Jun 12, 2026
1 of 2 checks passed
ruanhangjian pushed a commit to ruanhangjian/new-api that referenced this pull request Jul 11, 2026
noah-wung pushed a commit to noah-wung/new-api that referenced this pull request Jul 17, 2026
zhaodechao2008 pushed a commit to zhaodechao2008/new-api that referenced this pull request Jul 27, 2026
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
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.

1 participant