A data engineering team has a monorepo containing multiple Databricks Asset Bundle projects for different product domains. Each project has its own databricks.yml. The CI/CD pipeline runs on GitHub Actions. On every pull request, the team wants to: (1) validate the bundle YAML schema, (2) run Python unit tests, and (3) prevent deployment if validation or tests fail. On merge to main, the CD step must deploy to the prod target. A new engineer is asked to write the GitHub Actions workflow YAML steps. Which sequence of CLI commands in the CI job correctly implements all three requirements?
Answer & explanation
Correct answer: B
WHY B: databricks bundle validate is the purpose-built command for schema and config validation: it checks YAML syntax, schema compliance, variable references, and file existence, and it does not require a -t flag for basic schema validation. pytest tests/ is the standard Python unit testing invocation. Both commands return non-zero exit codes on failure, which GitHub Actions treats as job failure, blocking the merge. databricks bundle deploy -t prod in the CD job is the correct production deployment command.
WHY NOT A: databricks bundle plan is a valid DAB CLI command (available with the direct deployment engine) that previews deployment changes without making them, similar to Terraform's plan. However, it requires workspace connectivity and is scoped to deployment previews, not YAML schema validation. databricks bundle validate is the purpose-built command for CI schema checking.
WHY NOT C: databricks bundle deploy --dry-run is not a valid DAB flag; there is no dry-run mode in the DAB CLI, so this step cannot serve as validation.
WHY NOT D: databricks bundle check and databricks bundle test are not valid DAB commands, so two of the three steps would fail to run at all.
WHY NOT E: databricks bundle lint is not a valid DAB command. databricks bundle validate does not require a -t flag, and the YAML schema does not differ between targets.