Skip to content

docs: add run script documentation#2892

Merged
AviPeltz merged 1 commit into
superset-sh:mainfrom
vitorvavolizza:docs/run-script-config
Mar 26, 2026
Merged

docs: add run script documentation#2892
AviPeltz merged 1 commit into
superset-sh:mainfrom
vitorvavolizza:docs/run-script-config

Conversation

@vitorvavolizza
Copy link
Copy Markdown
Contributor

@vitorvavolizza vitorvavolizza commented Mar 26, 2026

Summary

  • Documents the run field in .superset/config.json, which was previously undocumented
  • Explains how run scripts differ from setup/teardown (on-demand via Run button, restartable, dedicated pane)
  • Adds the missing SUPERSET_WORKSPACE_PATH environment variable to the reference table
  • Updates page title from "Setup & Teardown Scripts" to "Setup, Teardown & Run Scripts"

Test plan

  • Verify the docs page renders correctly at /docs/setup-teardown-scripts
  • Confirm all JSON examples are valid

🤖 Generated with Claude Code

Summary by CodeRabbit

Documentation

  • New run command support: Adds an on-demand, restartable run action triggered via a Run button in a dedicated terminal pane, separate from automatic setup/teardown.
  • Lifecycle behavior clarified: setup and teardown run automatically in sequence on workspace create/delete.
  • Environment & config guidance: Documents SUPERSET_WORKSPACE_PATH, includes run in config priority order, full config examples, and tips to use run for dev servers.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 680b30a3-db28-47cc-ba0c-8707c1342a59

📥 Commits

Reviewing files that changed from the base of the PR and between 41539d7 and dd66a16.

📒 Files selected for processing (1)
  • apps/docs/content/docs/setup-teardown-scripts.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/docs/content/docs/setup-teardown-scripts.mdx

📝 Walkthrough

Walkthrough

Docs updated to add a new on-demand, restartable run command alongside automatic setup and teardown; setup/teardown run on workspace create/delete, run is triggered manually via a Run button in a terminal pane. Added config examples, SUPERSET_WORKSPACE_PATH, and expanded priority order to include run.

Changes

Cohort / File(s) Summary
Documentation
apps/docs/content/docs/setup-teardown-scripts.mdx
Adds run command docs and examples ("run": ["./.superset/run.sh"]), clarifies execution semantics (setup/teardown automatic; run on-demand/restartable via Run button in a terminal pane), adds SUPERSET_WORKSPACE_PATH env var, updates config priority order to include run, provides full config example and tips for using run for dev servers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 I nibble keys and tap a drum,
A run at will — hooray! — not glum,
Setup wakes, teardown bows,
I hop between the terminal rows,
Dev servers dance; the rabbit hums. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: documentation for the previously undocumented run script feature.
Description check ✅ Passed The description covers the required sections (summary of changes and test plan) and provides clear context, though the Type of Change checkbox formatting differs from template structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Copy link
Copy Markdown
Contributor

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/docs/content/docs/setup-teardown-scripts.mdx (1)

102-109: ⚠️ Potential issue | 🟠 Major

Documentation contradicts actual implementation behavior.

Line 109 states "No merging occurs between levels—the first config found is used entirely," but the implementation in setup.ts shows key-level merging with inheritance. Per the code comment: "Higher-priority configs override only the keys they explicitly define. Missing keys inherit from lower-priority sources."

This means if a worktree config defines only setup, the run and teardown fields would still be inherited from the main repo config—not replaced entirely as documented here.

Suggested fix
 ### Priority Order

-Config is resolved in this order (first found wins, for setup, teardown, and run):
+Config is resolved in this order (higher priority overrides lower, per key):
 1. `~/.superset/projects/<project-id>/config.json` — user override
 2. `<worktree>/.superset/config.json` — worktree-specific
 3. `<repo>/.superset/config.json` — project default

-No merging occurs between levels—the first config found is used entirely.
+Higher-priority configs override only the keys they explicitly define. Missing keys inherit from lower-priority sources. For example, if the worktree config defines only `setup`, the `teardown` and `run` from the main repo config are still used.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/setup-teardown-scripts.mdx` around lines 102 - 109,
The docs incorrectly state "No merging occurs..." but the implementation in
setup.ts performs key-level merging/inheritance: higher-priority configs
override only the keys they define and missing keys (e.g., run, teardown)
inherit from lower-priority sources; update the section to describe this
behavior (mentioning setup.ts and the keys 'setup', 'run', 'teardown') and
provide the correct priority/resolution wording explaining key-level inheritance
rather than whole-file replacement.
🧹 Nitpick comments (1)
apps/docs/content/docs/setup-teardown-scripts.mdx (1)

130-146: Consider adding run examples to local config section.

The implementation supports before/after syntax for run commands as well (see mergeConfigs in setup.ts which iterates over ["setup", "teardown", "run"]), but the examples only show setup and teardown. Adding a run example would make the documentation more complete.

Example addition
 {
   "setup": {
     "before": ["echo 'running pre-setup'"],
     "after": ["./.superset/my-post-setup.sh"]
   },
   "teardown": {
     "after": ["./.superset/my-cleanup.sh"]
-  }
+  },
+  "run": {
+    "before": ["echo 'starting services'"]
+  }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/setup-teardown-scripts.mdx` around lines 130 - 146,
Add an example showing the `run` key with `before`/`after` arrays to mirror the
existing `setup`/`teardown` example because `mergeConfigs` processes
`["setup","teardown","run"]`; update the docs example to include a `"run": {
"before": [...], "after": [...] }` block using the same style and note that
unspecified keys pass through unchanged so readers see `before` → committed run
scripts → `after` behavior for `run` as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@apps/docs/content/docs/setup-teardown-scripts.mdx`:
- Around line 102-109: The docs incorrectly state "No merging occurs..." but the
implementation in setup.ts performs key-level merging/inheritance:
higher-priority configs override only the keys they define and missing keys
(e.g., run, teardown) inherit from lower-priority sources; update the section to
describe this behavior (mentioning setup.ts and the keys 'setup', 'run',
'teardown') and provide the correct priority/resolution wording explaining
key-level inheritance rather than whole-file replacement.

---

Nitpick comments:
In `@apps/docs/content/docs/setup-teardown-scripts.mdx`:
- Around line 130-146: Add an example showing the `run` key with
`before`/`after` arrays to mirror the existing `setup`/`teardown` example
because `mergeConfigs` processes `["setup","teardown","run"]`; update the docs
example to include a `"run": { "before": [...], "after": [...] }` block using
the same style and note that unspecified keys pass through unchanged so readers
see `before` → committed run scripts → `after` behavior for `run` as well.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e73696d0-9472-4b14-a2ee-2ba8164e38cd

📥 Commits

Reviewing files that changed from the base of the PR and between 48b7861 and 41539d7.

📒 Files selected for processing (1)
  • apps/docs/content/docs/setup-teardown-scripts.mdx

The `run` field in `.superset/config.json` was undocumented. This adds
a section explaining how run scripts work (on-demand via Run button,
restartable, dedicated pane) and how they differ from setup/teardown.
Also adds the missing `SUPERSET_WORKSPACE_PATH` environment variable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vitorvavolizza vitorvavolizza force-pushed the docs/run-script-config branch from 41539d7 to dd66a16 Compare March 26, 2026 09:11
@michalkopanski
Copy link
Copy Markdown
Contributor

You beat me to it! Looks good 👍

@AviPeltz
Copy link
Copy Markdown
Collaborator

lgtm

@AviPeltz AviPeltz merged commit b7810d4 into superset-sh:main Mar 26, 2026
12 of 14 checks passed
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.

3 participants