Skip to content

Conversation

GaoNeng-wWw
Copy link
Collaborator

@GaoNeng-wWw GaoNeng-wWw commented Sep 9, 2025

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)

PR Type

What kind of change does this PR introduce?

  • 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:

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

  • Documentation
    • Added a new “Disable demo mode” section to backend setup guides with clear steps to turn off demo restrictions.
    • Included diff-style examples to illustrate the minimal configuration adjustments required, while retaining existing authentication and permission protections.
    • Clarified scope: these updates affect documentation only and do not alter application behavior or public APIs.
    • Improved discoverability by placing the guidance adjacent to backend startup instructions.

Copy link

coderabbitai bot commented Sep 9, 2025

Walkthrough

Added a “关闭演示模式” section to two documentation files, showing how to disable demo mode by removing RejectRequestGuard from APP_GUARD in nestJS/src/app.module.ts. Included diff-style examples. No application code or behavior changed.

Changes

Cohort / File(s) Summary
Docs: Disable demo mode guidance
docs/tiny-pro-backend-dev-guideline.md, docs/tiny-pro.md
Added instructions and diff-style examples to disable demo mode by removing RejectRequestGuard from APP_GUARD in nestJS/src/app.module.ts. No runtime logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks (2 passed, 1 inconclusive)

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description Check ❓ Inconclusive The description is mainly a generic checklist for PR submission and labels indicating documentation updates, but it does not include specific details about the actual content changes (i.e., the new “关闭演示模式” section and code example). Please expand the description to summarize the specific documentation changes, such as the addition of the “关闭演示模式” section and the removal of RejectRequestGuard in the example code.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed Title accurately summarizes the main change by indicating that documentation now provides an example for disabling demo mode and follows the concise single-sentence guideline.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

A rabbit taps keys with a hop and a glow,
“Demo be gone,” in the docs it will show.
Guards in a row—remove just one,
Auth and Permissions still get it done.
Carrot-shaped bullets, merge and go! 🥕✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
		  - name: "Undocumented Breaking Changes"
			  mode: "warning"
			  instructions: |
				  Flag potential breaking changes that are not documented:
				  1. Identify changes to public APIs/exports, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints (including removed/renamed items and changes to types, required params, return values, defaults, or behavior).
				  2. Ignore purely internal/private changes (e.g., code not exported from package entry points or marked internal).
				  3. Verify documentation exists: a "Breaking Change" section in the PR description and updates to CHANGELOG.md.

Please share your feedback with us on this Discord post.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
docs/tiny-pro.md (1)

44-44: Verify casing of path segment.

当前文档中使用 nestJS/src/app.module.ts;前文项目结构展示为 nestJs。请统一为脚手架真实目录名的大小写,以免在区分大小写的系统上误导用户。

docs/tiny-pro-backend-dev-guideline.md (1)

63-86: Add a brief caution and cleanup note.

  • 提醒同时删除 RejectRequestGuard 的 import。
  • 简述关闭演示模式后将允许写操作,建议仅在可信环境启用。

I can append一个“注意事项”段落,保持与 tiny-pro.md 一致。要我直接补上吗?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21751b8 and 268c0d7.

📒 Files selected for processing (2)
  • docs/tiny-pro-backend-dev-guideline.md (1 hunks)
  • docs/tiny-pro.md (1 hunks)
🔇 Additional comments (1)
docs/tiny-pro.md (1)

42-66: Add two clarifications: import cleanup and guard order.

  • Readers should also删除对应的 RejectRequestGuard import,否则会出现未使用/找不到引用等报错。
  • 多个 APP_GUARD 的执行顺序与声明顺序一致,移除中间项后应确保 AuthGuard 仍先于 PermissionGuard 执行。

If helpful, I can add a short “注意事项”小节紧随代码块后,包含以上两点。需要我推送补丁吗?

Comment on lines +65 to +66
`TinyPro` 提供了一个 `RejectGuard``Guard`. 如果你需要关闭演示模式, 请在 `nestJS/src/app.module.ts` 中移除 L66~L69. 最终代码应当如下

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Same guard name mismatch and brittle line-number reference.

与另一篇文档相同,说明文字应使用 RejectRequestGuard,且不应引用“L66~L69”。

Apply:

-`TinyPro` 提供了一个 `RejectGuard` 的 `Guard`. 如果你需要关闭演示模式, 请在 `nestJS/src/app.module.ts` 中移除 L66~L69. 最终代码应当如下
+`TinyPro` 提供了一个名为 `RejectRequestGuard` 的 Guard。若需关闭演示模式,请在 `nestJS/src/app.module.ts` 的 `@Module` 中移除 `APP_GUARD` 的 `useClass: RejectRequestGuard` 提供者项。最终代码应当如下:
📝 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
`TinyPro` 提供了一个 `RejectGuard``Guard`. 如果你需要关闭演示模式, 请在 `nestJS/src/app.module.ts` 中移除 L66~L69. 最终代码应当如下
`TinyPro` 提供了一个名为 `RejectRequestGuard` 的 Guard。若需关闭演示模式,请在 `nestJS/src/app.module.ts` `@Module` 中移除 `APP_GUARD``useClass: RejectRequestGuard` 提供者项。最终代码应当如下
🤖 Prompt for AI Agents
In docs/tiny-pro-backend-dev-guideline.md around lines 65-66, the text
incorrectly names the guard as "RejectGuard" and uses a brittle line-number
reference "L66~L69"; update the wording to reference the correct guard name
"RejectRequestGuard" and remove any hard-coded line numbers—instead instruct
readers to remove the RejectRequestGuard registration/usage from
nestJS/src/app.module.ts (e.g., delete the import and global provider/guard
registration that applies the RejectRequestGuard) so the guidance is robust and
accurate.

Comment on lines +44 to +45
`TinyPro` 提供了一个 `RejectGuard``Guard`. 如果你需要关闭演示模式, 请在 `nestJS/src/app.module.ts` 中移除 L66~L69. 最终代码应当如下

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix guard name and wording; remove brittle line-number reference.

  • Text says “RejectGuard 的 Guard” but the example uses RejectRequestGuard. This mismatch can confuse readers.
  • Referring to “L66~L69” in another file is brittle and will rot.

Apply:

-`TinyPro` 提供了一个 `RejectGuard` 的 `Guard`. 如果你需要关闭演示模式, 请在 `nestJS/src/app.module.ts` 中移除 L66~L69. 最终代码应当如下
+`TinyPro` 提供了一个名为 `RejectRequestGuard` 的 Guard。若需关闭演示模式,请在 `nestJS/src/app.module.ts` 的 `@Module` 中移除 `APP_GUARD` 的 `useClass: RejectRequestGuard` 提供者项(如下所示的删除块)。最终代码应当如下:
📝 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
`TinyPro` 提供了一个 `RejectGuard``Guard`. 如果你需要关闭演示模式, 请在 `nestJS/src/app.module.ts` 中移除 L66~L69. 最终代码应当如下
`TinyPro` 提供了一个名为 `RejectRequestGuard` 的 Guard。若需关闭演示模式,请在 `nestJS/src/app.module.ts` `@Module` 中移除 `APP_GUARD``useClass: RejectRequestGuard` 提供者项(如下所示的删除块)。最终代码应当如下
🤖 Prompt for AI Agents
In docs/tiny-pro.md around lines 44-45, the text mistakenly says "RejectGuard 的
Guard" while the example uses RejectRequestGuard and also points to brittle line
numbers "L66~L69" in another file; update the wording to reference the correct
guard name (e.g., "RejectRequestGuard") and remove the exact line-number
reference, instead instructing readers to remove the demo-mode guard
registration from nestJS/src/app.module.ts (e.g., remove the RejectRequestGuard
import/registration or entry in providers/guards) so the instruction remains
stable as the file changes.

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