-
Notifications
You must be signed in to change notification settings - Fork 41
docs: provide how to disabled demo mode example #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughAdded 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Pre-merge checks (2 passed, 1 inconclusive)❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Poem
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.
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
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. Comment |
There was a problem hiding this 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
📒 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 “注意事项”小节紧随代码块后,包含以上两点。需要我推送补丁吗?
`TinyPro` 提供了一个 `RejectGuard` 的 `Guard`. 如果你需要关闭演示模式, 请在 `nestJS/src/app.module.ts` 中移除 L66~L69. 最终代码应当如下 | ||
|
There was a problem hiding this comment.
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.
`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.
`TinyPro` 提供了一个 `RejectGuard` 的 `Guard`. 如果你需要关闭演示模式, 请在 `nestJS/src/app.module.ts` 中移除 L66~L69. 最终代码应当如下 | ||
|
There was a problem hiding this comment.
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.
`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.
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit