feat(demo): add environment-controlled demo mode - #559
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (19)
📝 WalkthroughWalkthroughDemo mode is configured through ChangesDemo mode runtime and configuration
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Environment
participant Run
participant App
participant DashboardRuntimeConfig
participant Dashboard
Environment->>Run: read GOMODEL_DEMO_MODE
Run->>Run: start periodic demo warnings
Run->>App: pass DemoMode
App->>DashboardRuntimeConfig: build DEMO_MODE
App->>Dashboard: construct demo-mode handler
Dashboard->>Dashboard: render warning banner
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8)docs/openapi.jsonTraceback (most recent call last): 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 |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@run/demo.go`:
- Around line 13-16: The demo-mode environment variable is misspelled and must
consistently use the `_MODE` suffix. Rename the constant value in run/demo.go,
update the demo target in Makefile, and update the configuration table and
description in docs/advanced/configuration.mdx to reference GOMODEL_DEMO_MODE.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 48b827b8-ff33-4cb6-927b-e4d28f3ba43c
📒 Files selected for processing (18)
Makefilecmd/gomodel/docs/docs.godocs/advanced/configuration.mdxdocs/openapi.jsoninternal/admin/dashboard/dashboard.gointernal/admin/dashboard/dashboard_test.gointernal/admin/dashboard/static/css/dashboard.cssinternal/admin/dashboard/static/js/modules/workflows.jsinternal/admin/dashboard/static/js/modules/workflows.test.cjsinternal/admin/dashboard/templates/layout.htmlinternal/admin/handler.gointernal/admin/handler_test.gointernal/app/app.gointernal/app/app_test.gorun/demo.gorun/demo_test.gorun/flags_test.gorun/run.go
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
87b4d65 to
00226a9
Compare
Summary
GOMODEL_DEMO_MODEL, disabled by defaultDEMO_MODEthrough the allowlisted dashboard runtime configurationmake demo, configuration docs, and OpenAPI schemasBehavior
GOMODEL_DEMO_MODEL=trueenables demo mode. The removed--demoflag is rejected. Demo mode communicates that demo data is reset regularly, but it does not perform storage deletion itself; deployments must schedule resets separately.Testing
go test ./...node --test internal/admin/dashboard/static/js/modules/*.test.cjsSummary by CodeRabbit
GOMODEL_DEMO_MODE=true, including recurring warning logs.noindexmeta tag.DEMO_MODE, and reflected in the OpenAPI schema.GOMODEL_DEMO_MODEbehavior and runtime config exposure (DEMO_MODE=on).