Skip to content

Fix: rollback added instance when add model failed - #20129

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
Lynn-Inf:fix/rollback-instance
Sep 23, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
Lynn-Inf:fix/rollback-instance

Conversation

@Lynn-Inf

Copy link
Copy Markdown
Contributor

Summary

As title.

@Lynn-Inf
Lynn-Inf requested a review from wangq8 September 23, 2026 11:33
@Lynn-Inf Lynn-Inf added the ci Continue Integration label Sep 23, 2026
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9ab95403-d9c9-4074-ab29-8f877ebb941f

📥 Commits

Reviewing files that changed from the base of the PR and between 9785a0d and d3eac18.

📒 Files selected for processing (2)
  • internal/service/model_service.go
  • internal/service/model_service_test.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Provider instance creation now uses a helper to add submitted models or applicable defaults. If model creation fails, the service attempts to delete the instance and its associated models. A new test checks that duplicate model creation leaves no instance or model rows.

Changes

Provider instance creation

Layer / File(s) Summary
Model population
internal/service/model_service.go
A helper adds submitted models or applicable factory defaults. It skips defaults for Bedrock API-key authentication, selects siliconflow_intl for international Siliconflow, and adds no defaults when factory data is missing.
Failure rollback and validation
internal/service/model_service.go, internal/service/model_service_test.go
CreateProviderInstance attempts to delete the instance and its models when model creation fails. A test verifies that duplicate model creation leaves neither the instance row nor the model rows.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: jinhai-cn

Merge Risk: ⚪ Minimal · up to d3eac

Failed model creation is designed to remove the new provider instance and its models. No established issue currently prevents merging after normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description identifies the intended fix but does not provide the required background context or a substantive summary. The text “As title.” is too brief for the repository template. Replace “As title.” with a brief summary that explains the model-creation failure scenario, the instance rollback behavior, and the purpose of the change.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: rolling back the newly added instance when model creation fails.
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.
  • Fix all pre-merge checks with AI

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

A rabbit checks the model rows,
Then watches rollback as it goes.
The instance leaves, the models too,
When duplicate names block the queue.
All clear; the rabbit thumps its feet.

Comment @coderabbitai help to get the list of available commands.

@wangq8
wangq8 merged commit bd7db4f into infiniflow:main Sep 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants