Skip to content

feat(backend-shared): add CUBEJS_AUTO_RUN_MODE env variable#11062

Open
keydunov wants to merge 2 commits into
masterfrom
artyom/auto-run-mode-env
Open

feat(backend-shared): add CUBEJS_AUTO_RUN_MODE env variable#11062
keydunov wants to merge 2 commits into
masterfrom
artyom/auto-run-mode-env

Conversation

@keydunov

Copy link
Copy Markdown
Member

Description

Adds a new CUBEJS_AUTO_RUN_MODE environment variable to @cubejs-backend/shared, resolvable via getEnv('autoRunMode').

It controls whether queries are executed automatically without requiring an explicit user confirmation. Defaults to true (current behavior); set to false to require confirmation.

The flag will be consumed downstream (exposed via the runtime settings endpoint alongside defaultLimit / maxLimit).

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@keydunov keydunov requested a review from a team as a code owner June 11, 2026 04:51
@github-actions github-actions Bot added the javascript Pull requests that update Javascript code label Jun 11, 2026
@claude

claude Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keydunov's task in 33s —— View job


Code Review

  • Read PR diff
  • Check consistency with surrounding env vars
  • Post review

Verdict: LGTM — 0 high, 0 medium, 1 low.

Details

Summary

Adds CUBEJS_AUTO_RUN_MODE boolean env var resolvable via getEnv('autoRunMode'). The implementation matches the existing pattern in env.ts (.default('true').asBoolStrict()), placement is reasonable, and the JSDoc describes the intent clearly.

Findings

Low — naming
autoRunMode / CUBEJS_AUTO_RUN_MODE is slightly ambiguous as a boolean — "mode" usually suggests an enum (e.g. auto/manual). Since this is true/false, a name like CUBEJS_AUTO_RUN (autoRun) reads more naturally and matches the boolean shape. Not blocking — just worth a thought before this ships and the name becomes a public env var that's hard to change. Per the PR description, downstream wiring (runtime settings endpoint) is still pending, so renaming now is essentially free.

Quality / Security / Performance / Tests / Docs

  • Quality: Clean, follows existing convention.
  • Security: N/A — boolean flag, no input handled.
  • Performance: N/A.
  • Tests: No tests added; consistent with how the surrounding boolean flags in this file are handled (none have dedicated tests either), so not a regression.
  • Docs: No docs update in this PR. Once consumed downstream, the env var should be added to docs-mintlify reference. Reasonable to defer until the consumer lands.
• Branch: `artyom/auto-run-mode-env`

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 58.50%. Comparing base (d91df4b) to head (251a8ad).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
packages/cubejs-backend-shared/src/env.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11062      +/-   ##
==========================================
- Coverage   58.51%   58.50%   -0.02%     
==========================================
  Files         216      216              
  Lines       17265    17270       +5     
  Branches     3524     3524              
==========================================
+ Hits        10102    10103       +1     
- Misses       6648     6652       +4     
  Partials      515      515              
Flag Coverage Δ
cube-backend 58.50% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude

claude Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keydunov's task in 31s —— View job


Code Review

Verdict: LGTM — 0 high, 0 medium, 1 low (carried over).

Details

Changes since last review

Latest commit (251a8ad) only refines the JSDoc on autoRunMode to clarify the flag is Cube Cloud only. No functional change.

-   * explicit user confirmation.
+   * explicit user confirmation. Only used in Cube Cloud.

Findings

Low — naming (carried over)
autoRunMode / CUBEJS_AUTO_RUN_MODE reads as an enum, but the value is boolean. CUBEJS_AUTO_RUN (autoRun) would match the shape more naturally. Still cheap to rename before downstream wiring lands; not blocking.

Quality / Security / Performance / Tests / Docs

  • Quality: Clean, follows the surrounding .default('...').asBoolStrict() convention in env.ts.
  • Security / Performance: N/A.
  • Tests: None added; consistent with sibling boolean flags in this file.
  • Docs: JSDoc now notes Cube Cloud scope, which is helpful. Public-facing docs in docs-mintlify can wait until the downstream consumer lands.
• Branch: `artyom/auto-run-mode-env`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant