Skip to content

Conversation

@lu-yg
Copy link
Collaborator

@lu-yg lu-yg commented Dec 30, 2025

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • [x Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Bug Fixes
    • Improved app creation with corrected tenant validation that uses login context information instead of app configuration data.
    • Enhanced error handling for missing tenant context scenarios.
    • Automatic default platform history assignment for newly created applications.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The AppServiceImpl.createApp method modifies tenant validation to use the login context's tenant ID instead of the app's tenant ID. When tenant ID is missing, it returns error code CM337 instead of CM002. The method now propagates the validated tenant ID to the app and assigns a default platformHistoryId of "1" before persistence.

Changes

Cohort / File(s) Summary
App Creation Tenant Validation
base/src/main/java/com/tinyengine/it/service/app/impl/AppServiceImpl.java
Updated tenant validation source from app.getTenantId() to loginUserContext.getTenantId(); changed missing tenant error code from CM002 to CM337; added explicit tenant ID propagation via app.setTenantId(...); added default platformHistoryId assignment ("1") before app persistence

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • msslulu

Poem

🐰 A tenant now validated from context so true,
Default histories assigned, platformId anew—
From CM002 to CM337 we hop,
With tenant IDs flowing, never a stop!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4191663 and e8b6a83.

📒 Files selected for processing (1)
  • base/src/main/java/com/tinyengine/it/service/app/impl/AppServiceImpl.java

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.

@lu-yg lu-yg merged commit d60612a into opentiny:develop Dec 30, 2025
1 check passed
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.

2 participants