An organization wants to set up a production Git folder in Databricks that tracks the main branch of a remote GitHub repository. The folder must be automatically updated when PRs are merged into main, and individual developers must NOT be able to directly edit files in it. Which setup CORRECTLY achieves this?
Answer & explanation
Correct answer: B
WHY B: Databricks documentation describes the pattern for production Git folders: (1) they are created by admins OUTSIDE user folders, under /Workspace/ rather than /Workspace/Users/, often organized by team or project; (2) they hold the deployment branch (e.g., main) and serve as the source for automated workflows; (3) access is restricted: most users, and the deployment service principal for running, receive 'Can Run' to execute workflows against the folder, while admins and the service principals used for automation receive edit access; (4) synchronization is automated via external CI/CD tools (e.g., GitHub Actions) or a scheduled Databricks job that calls w.repos.update() via the Workspace SDK when PRs are merged into the deployment branch. This prevents manual drift and unauthorized direct edits.
WHY NOT A: A production Git folder under a user directory (/Workspace/Users/<admin>/) is incorrect: user directories are for individual developer checkouts where they work on branches and push changes, and a production folder should not be tied to a single user account. Granting Can Edit to the developers also violates the requirement that individual developers do not edit the production folder directly.
WHY NOT C: The folder is again under a user directory (same issue as A), and syncing by hand from an admin laptop needs human intervention for each deployment, is error-prone, and is not the automated update on merge that the organization requires. Databricks recommends automating production folder updates.
WHY NOT D: Databricks Git folders have no native 'Auto-sync' option that pulls from the remote branch when GitHub detects a push. Automation is configured explicitly via external CI/CD pipelines (e.g., a GitHub Actions workflow triggered on merge) or scheduled Databricks jobs using the Repos API/Workspace SDK.