Skip to content

Add --skip-examples to databricks apps init (LA-2397) - #7591

Closed
atilafassina wants to merge 8 commits into
mainfrom
work/1-add-apps-init-skip-examples-la
Closed

atilafassina wants to merge 8 commits into
mainfrom
work/1-add-apps-init-skip-examples-la

Conversation

@atilafassina

@atilafassina atilafassina commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Adds a --skip-examples flag to databricks apps init. The flag reaches the template as skipExamples, so a template can gate its placeholder files with {{if not .skipExamples}}.

Without the flag the key is false, so not .skipExamples keeps the files and nothing changes for current users. Older CLIs leave the key out, and the template reads that as false too.

No other CLI change was needed. copyTemplate already skips files that render to only whitespace, and removeEmptyDirs then removes folders left empty. With the flag, config/queries/ goes away once all its queries render empty.

Why

databricks/appkit#734 gates the AppKit template's placeholder files on .skipExamples: config/queries/hello_world.sql, config/queries/mocked_sales.sql and server/example.test.ts. The Builder deletes these files on nearly every run. With this flag it can scaffold without them.

JIRA: LA-2397, a subtask of LA-2388.

Tests

  • Unit tests in cmd/apps/init_test.go:
    • executeTemplate renders {{if not .skipExamples}}x{{end}} as x by default and as nothing with the flag set.
    • The flag is registered with a default of false.
    • runCreate on a fixture template, with and without the flag. With it, config/ and server/example.test.ts are absent and the other files are still written. To confirm the test catches a missing hookup, I set the field to false in runCreate, and the test failed.
  • go test ./cmd/apps/... ./libs/apps/..., the apps acceptance tests, task lint-q, task ws and task check-changelog pass.
  • End to end, I ran the built CLI on the template from the appkit#734 branch with --features analytics,server.
    • Default mode keeps both queries and example.test.ts.
    • --skip-examples leaves out config/queries/ and server/example.test.ts, and config/metric-views/ stays.

This pull request and its description were written by Isaac.

atilafassina and others added 2 commits November 13, 2026 08:33
Passes the flag to the template as `skipExamples`, so templates can gate
their placeholder files on `{{if not .skipExamples}}`. The AppKit template
uses it (databricks/appkit#734) to leave out config/queries/*.sql and
server/example.test.ts. Without the flag the key is false and behavior is
unchanged.

Files that render empty are already skipped and empty directories
removed, so config/queries/ disappears when all its queries are gated.

Co-authored-by: Isaac <no-reply@databricks.com>
@atilafassina
atilafassina requested review from a team as code owners November 13, 2026 08:26
@atilafassina
atilafassina requested review from shreyas-goenka and a balanced review from Copilot November 13, 2026 08:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

atilafassina and others added 3 commits November 13, 2026 09:26
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@atilafassina

Copy link
Copy Markdown
Contributor Author

Review 2 · Pass

Does the change do what the task asked? Yes. Gate: major and worse must be fixed.

The flag reaches the template and works with both a local fixture and the AppKit PR template. Default scaffolds keep the examples; skip mode omits all three files and removes the empty queries directory. I found no change caused fault.

No findings.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: de75641

Run: 43401934130

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 15 6:23
💚​ aws-windows-latest-4core-16gb 1 272 13 5:06
💚​ azure linux-2core-8gb 1 269 15 7:45
💚​ azure-windows-latest-4core-16gb 1 271 13 5:22
💚​ gcp linux-2core-8gb 1 270 15 6:52
💚​ gcp-windows-latest-4core-16gb 1 272 13 5:25
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
3:30 azure-windows-latest-4core-16gb TestAccept
3:28 azure linux-2core-8gb TestAccept
3:25 aws linux-2core-8gb TestAccept
3:20 gcp-windows-latest-4core-16gb TestAccept
3:17 gcp linux-2core-8gb TestAccept
3:14 aws-windows-latest-4core-16gb TestAccept

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