Skip to content

Commit 0ebc38b

Browse files
author
Quentin Ambard
committed
Surface silent failures in installer + dashboard skill
install.sh — two silent-fail paths now fail loudly: 1. The interactive "Experimental channel" radio-select did `exec bash <(curl -fsSL ...)`. If curl 404'd / 5xx'd / DNS hiccupped, `exec bash` ran an empty script and returned to the user's prompt with no output. Now we curl to a tmp file with `|| die` and check the file is non-empty before exec'ing. 2. The git-clone fallback in setup-mcp (and the FORCE refresh path) swallowed errors. A failed re-clone left $REPO_DIR missing, downstream `uv pip install -e "$REPO_DIR/..."` would explode with an unrelated error. Now both fallback clones `|| die` with a clear "Could not clone branch '<X>' from <URL>" message. databricks-aibi-dashboards SKILL.md — `--dataset-catalog` and `--dataset-schema` are FLAG-ONLY (no JSON-body equivalent). The CLI silently warns "unknown field" and proceeds, creating a broken dashboard whose queries can't resolve catalog.schema. Made the rule explicit in both the Quick Reference row and the Step 5 canonical comment block: --dataset-catalog / --dataset-schema : FLAG-ONLY (REQUIRED; CLI silently drops them if put in --json). parent_path : JSON-ONLY (no flag). display_name / warehouse_id / serialized_dashboard : either form. Live-verified the silent-drop behavior on CLI v0.296. Co-authored-by: Isaac
1 parent 7b07f18 commit 0ebc38b

2 files changed

Lines changed: 33 additions & 13 deletions

File tree

databricks-skills/databricks-aibi-dashboards/SKILL.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A dashboard should be showing something relevant for a human, typically some KPI
1717
| List tables | `databricks experimental aitools tools query --warehouse WH "SHOW TABLES IN catalog.schema"` |
1818
| Get schema | `databricks experimental aitools tools discover-schema catalog.schema.table1 catalog.schema.table2` |
1919
| Test query | `databricks experimental aitools tools query --warehouse WH "SELECT..."` |
20-
| Create dashboard | `databricks lakeview create --display-name "X" --warehouse-id "WH" --dataset-catalog CATALOG --dataset-schema SCHEMA --serialized-dashboard "$(cat file.json)" --json '{"parent_path": "/Workspace/Users/<you>/path"}'``parent_path` is JSON-only (no flag); everything else stays as flags. Queries must use bare table names. |
20+
| Create dashboard | `databricks lakeview create --display-name "X" --warehouse-id "WH" --dataset-catalog CATALOG --dataset-schema SCHEMA --serialized-dashboard "$(cat file.json)" --json '{"parent_path": "/Workspace/Users/<you>/path"}'``--dataset-catalog` / `--dataset-schema` are **flag-only** (REQUIRED; CLI silently drops them if put in `--json`); `parent_path` is JSON-only (no flag). Queries must use bare table names. |
2121
| Update dashboard | `databricks lakeview update DASHBOARD_ID --serialized-dashboard "$(cat file.json)"` |
2222
| Publish | `databricks lakeview publish DASHBOARD_ID --warehouse-id WH` |
2323
| Delete | `databricks lakeview trash DASHBOARD_ID` |
@@ -120,11 +120,18 @@ After deploying, the same `lakeview` subcommands manage the dashboard's lifecycl
120120

121121
```bash
122122
# Deploy: creates the dashboard in the workspace and returns a dashboard ID.
123-
# Canonical form — everything is a flag EXCEPT parent_path (JSON-only, no flag;
124-
# without it the dashboard lands at /Users/<you>/<display-name>).
125-
# --dataset-catalog/--dataset-schema inject the catalog/schema into each saved
126-
# dataset; queries inside dashboard.json MUST use bare table names only (e.g.,
127-
# "FROM trips"), NOT "FROM schema.trips" or "FROM catalog.schema.trips".
123+
# Canonical form — MIX flags + --json. Each field has exactly ONE valid place:
124+
# --dataset-catalog / --dataset-schema : FLAG-ONLY (REQUIRED — no JSON field).
125+
# The CLI silently warns "unknown field" and drops them if put in --json,
126+
# leaving every dataset query unable to resolve its catalog.schema.
127+
# parent_path : JSON-ONLY (no flag). Without it, dashboard lands at
128+
# /Users/<you>/<display-name>.
129+
# display_name / warehouse_id / serialized_dashboard : either form works;
130+
# prefer flags for readability.
131+
# Queries inside dashboard.json MUST use bare table names ("FROM trips", never
132+
# "FROM schema.trips" or "FROM catalog.schema.trips") — --dataset-catalog and
133+
# --dataset-schema only fill in missing parts, they do NOT rewrite hardcoded
134+
# prefixes.
128135
databricks lakeview create \
129136
--display-name "My Dashboard" \
130137
--warehouse-id "abc123def456" \

install.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,16 +1309,20 @@ check_deps() {
13091309
setup_mcp() {
13101310
step "Setting up MCP server"
13111311

1312-
# Clone or update repo
1312+
# Clone or update repo. Fallback clones must `|| die` — a silent failure
1313+
# leaves $REPO_DIR missing and downstream `uv pip install -e "$REPO_DIR/..."`
1314+
# explodes with an unrelated error.
13131315
if [ -d "$REPO_DIR/.git" ]; then
13141316
git -C "$REPO_DIR" fetch -q --depth 1 origin "$BRANCH" 2>/dev/null || true
13151317
git -C "$REPO_DIR" reset --hard FETCH_HEAD 2>/dev/null || {
13161318
rm -rf "$REPO_DIR"
1317-
git -c advice.detachedHead=false clone -q --depth 1 --branch "$BRANCH" "$REPO_URL" "$REPO_DIR"
1319+
git -c advice.detachedHead=false clone -q --depth 1 --branch "$BRANCH" "$REPO_URL" "$REPO_DIR" \
1320+
|| die "Could not clone branch '$BRANCH' from $REPO_URL — check your network and that the branch exists."
13181321
}
13191322
else
13201323
mkdir -p "$INSTALL_DIR"
1321-
git -c advice.detachedHead=false clone -q --depth 1 --branch "$BRANCH" "$REPO_URL" "$REPO_DIR"
1324+
git -c advice.detachedHead=false clone -q --depth 1 --branch "$BRANCH" "$REPO_URL" "$REPO_DIR" \
1325+
|| die "Could not clone branch '$BRANCH' from $REPO_URL — check your network and that the branch exists."
13221326
fi
13231327
ok "Repository cloned ($BRANCH)"
13241328

@@ -2110,8 +2114,15 @@ prompt_channel() {
21102114
[ "$INSTALL_SKILLS" = false ] && args="$args --mcp-only"
21112115
[ "$BRANCH_EXPLICIT" = true ] && args="$args --branch $BRANCH"
21122116

2113-
# Download and execute the experimental installer
2114-
exec bash <(curl -fsSL "https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/experimental/install.sh") $args
2117+
# Download and execute the experimental installer.
2118+
# Download to a tmp file first so a curl failure (network/404/5xx) surfaces
2119+
# — `exec bash <(curl ...)` would silently exec an empty script otherwise.
2120+
local exp_installer
2121+
exp_installer=$(mktemp -t ai-dev-kit-exp-installer.XXXXXX) || die "Could not create temp file for experimental installer"
2122+
curl -fsSL "https://raw.githubusercontent.com/databricks-solutions/ai-dev-kit/experimental/install.sh" -o "$exp_installer" \
2123+
|| die "Could not download experimental installer from GitHub. Check your network connection, then retry."
2124+
[ -s "$exp_installer" ] || die "Downloaded experimental installer is empty — GitHub may be having issues. Retry in a moment."
2125+
exec bash "$exp_installer" $args
21152126
fi
21162127
}
21172128

@@ -2305,14 +2316,16 @@ main() {
23052316
git -C "$REPO_DIR" fetch -q --depth 1 origin "$BRANCH" 2>/dev/null || true
23062317
git -C "$REPO_DIR" reset --hard FETCH_HEAD 2>/dev/null || {
23072318
rm -rf "$REPO_DIR"
2308-
git -c advice.detachedHead=false clone -q --depth 1 --branch "$BRANCH" "$REPO_URL" "$REPO_DIR"
2319+
git -c advice.detachedHead=false clone -q --depth 1 --branch "$BRANCH" "$REPO_URL" "$REPO_DIR" \
2320+
|| die "Could not clone branch '$BRANCH' from $REPO_URL — check your network and that the branch exists."
23092321
}
23102322
ok "Repository refreshed ($BRANCH)"
23112323
fi
23122324
else
23132325
step "Downloading sources"
23142326
mkdir -p "$INSTALL_DIR"
2315-
git -c advice.detachedHead=false clone -q --depth 1 --branch "$BRANCH" "$REPO_URL" "$REPO_DIR"
2327+
git -c advice.detachedHead=false clone -q --depth 1 --branch "$BRANCH" "$REPO_URL" "$REPO_DIR" \
2328+
|| die "Could not clone branch '$BRANCH' from $REPO_URL — check your network and that the branch exists."
23162329
ok "Repository cloned ($BRANCH)"
23172330
fi
23182331

0 commit comments

Comments
 (0)