Skip to content

RI-8189 Disable tutorial Run + bulk-imports on production connections#5933

Merged
KrumTy merged 1 commit into
mainfrom
fe/feature/RI-8189/disable-tutorial-write-actions-on-prod
May 19, 2026
Merged

RI-8189 Disable tutorial Run + bulk-imports on production connections#5933
KrumTy merged 1 commit into
mainfrom
fe/feature/RI-8189/disable-tutorial-write-actions-on-prod

Conversation

@KrumTy
Copy link
Copy Markdown
Contributor

@KrumTy KrumTy commented May 18, 2026

What

Wire useDatabaseMode into the three write-data surfaces tied to tutorials / sample data, so they are disabled with a tooltip when the connected database mode is production. All other modes (fast, unmarked, disabled) keep today's behaviour.

Gated surfaces:

  • CodeButtonBlock — the Run button on tutorial code blocks.
  • RedisUploadButton — the in-tutorial bulk-upload control rendered by the redis-upload markdown directive.
  • LoadSampleData — the "Load sample data" button shown in the browser empty-state.

Tooltip copy (PRD-verbatim): "Button disabled for your production database to avoid accidental data modifications."

Non-prod Prod
Screenshot 2026-05-18 at 17 48 48 Screenshot 2026-05-18 at 17 47 44
Screenshot 2026-05-18 at 17 48 54 Screenshot 2026-05-18 at 17 55 56

Testing

  1. Toggle the dev-prodMode feature flag on.
  2. Mark a connected database as production (RI-8180 toggle on the connection form).
  3. Open a built-in tutorial → Run button is disabled with the prod tooltip on hover.
  4. Open a tutorial that contains a redis-upload directive (e.g. a sample-data tutorial) → bulk-upload button is disabled with the prod tooltip; clicking does nothing and no telemetry fires.
  5. In /browser, on an empty database (no keys) → "Load sample data" button is disabled with the prod tooltip.
  6. Switch to a non-production connection (or toggle the flag off) → all three controls return to today's behaviour.

Unit tests: 30/30 passing.


Closes #RI-8189


Note

Medium Risk
Changes user-facing execution paths by disabling tutorial run/bulk-import controls in production mode; risk is mainly regressions around incorrectly disabling actions or tooltip/telemetry behavior.

Overview
Prevents write-affecting tutorial/sample-data actions on production connections by wiring useDatabaseMode into the tutorial Run button (CodeButtonBlock), the redis-upload bulk-import button (RedisUploadButton), and the browser empty-state Load sample data control (LoadSampleData).

In production, these buttons are now disabled and show a consistent tooltip message; clicks no longer open their confirmation popovers or trigger the associated actions/telemetry. Unit tests were extended to cover production vs non-prod behavior and tooltip visibility.

Reviewed by Cursor Bugbot for commit 48e1460. Bugbot is set up for automated code reviews on this repo. Configure here.

@KrumTy KrumTy requested a review from a team as a code owner May 18, 2026 14:49
@KrumTy KrumTy added the AI-Made label May 18, 2026
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 18, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

dantovska
dantovska previously approved these changes May 18, 2026
@KrumTy KrumTy force-pushed the fe/feature/RI-8189/disable-tutorial-write-actions-on-prod branch from 6f6ed8e to ae6934f Compare May 18, 2026 15:08
@KrumTy KrumTy requested a review from dantovska May 18, 2026 15:09
Wire useDatabaseMode into the three tutorial/sample-data write surfaces
so they are disabled with a tooltip when the connected database mode is
'production':

- CodeButtonBlock (Run button on tutorial code blocks)
- RedisUploadButton (bulk-upload directive inside tutorial markdown)
- LoadSampleData (browser empty-state "Load sample data" button)

Other modes keep today's behaviour.

References: #RI-8189
@KrumTy KrumTy force-pushed the fe/feature/RI-8189/disable-tutorial-write-actions-on-prod branch from ae6934f to 48e1460 Compare May 19, 2026 06:54
@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.84% 24653/29758
🟡 Branches 68.09% 10362/15219
🟡 Functions 78.03% 6662/8538
🟢 Lines 83.31% 24074/28898

Test suite run success

6967 tests passing in 801 suites.

Report generated by 🧪jest coverage report action from 48e1460

@KrumTy KrumTy merged commit bd43cc4 into main May 19, 2026
21 checks passed
@KrumTy KrumTy deleted the fe/feature/RI-8189/disable-tutorial-write-actions-on-prod branch May 19, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants