Skip to content

Add bundle debug fetch-repository-info, cover it locally and on cloud - #6265

Open
denik wants to merge 1 commit into
mainfrom
denik/debug-fetch-repository-info
Open

Add bundle debug fetch-repository-info, cover it locally and on cloud#6265
denik wants to merge 1 commit into
mainfrom
denik/debug-fetch-repository-info

Conversation

@denik

@denik denik commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Add a hidden bundle debug fetch-repository-info that calls git.FetchRepositoryInfo directly, cover the local-.git path with an acceptance test that runs both locally and on cloud, and delete the three integration tests that covered it.

Previous PRs in this series: #6113, #6140, #6223, #6236

Why

FetchRepositoryInfo has no unit test and, until now, no test that runs without a workspace. It is a library function with no direct CLI surface, so the only way to reach it from an acceptance test was through bundle validate, which does not let a test point it at an arbitrary path. The debug command gives it a surface, so the same test runs against the fake server and against a real workspace.

TestFetchRepositoryInfoDotGit_* never used the workspace client they asked for: the API branch is taken only for a /Workspace/ path on DBR (libs/git/info.go:52), and they all pass t.TempDir() paths. They were paying for a workspace to test local filesystem behaviour.

The acceptance test covers what they asserted: a git worktree (from the root and from a subdirectory), a directory that is not a repository, a path that does not exist, and a .git that is a file rather than a directory.

The API path is unchanged

TestFetchRepositoryInfoAPI_* stay. Reaching that branch needs dbr.RunsOnRuntime, which requires Linux, DATABRICKS_RUNTIME_VERSION, and a real /databricks directory (libs/dbr/detect.go:16-38). A subprocess cannot fake the directory, so an acceptance test cannot take that branch outside the existing DBR harness.

git.FetchRepositoryInfo had no test that runs without a workspace, and no unit
test at all. Add a hidden `bundle debug fetch-repository-info` that calls it
directly and prints the result, so the local-.git path can be exercised through
the CLI both against the fake server and on a real workspace.

The acceptance test covers what the deleted integration tests asserted: a git
worktree (from the root and a subdirectory), a directory that is not a
repository, a path that does not exist, and a .git that is a file rather than a
directory.

The API path (/Workspace + DBR) is unchanged and its integration tests stay:
reaching it needs a real /databricks directory, which a subprocess cannot fake.

Co-authored-by: Isaac
@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

5 files changed
Suggested: @pietern
Also eligible: @janniklasrose, @andrewnester, @shreyas-goenka, @anton-107, @lennartkats-db

/cmd/bundle/ - needs approval

Files: cmd/bundle/debug.go, cmd/bundle/debug/fetch_repository_info.go
Suggested: @pietern
Also eligible: @janniklasrose, @andrewnester, @shreyas-goenka, @anton-107, @lennartkats-db

/integration/ - needs approval

Files: integration/libs/git/git_fetch_test.go
Suggested: @simonfaltum
Also eligible: @renaudhartert-db, @hectorcast-db, @parthban-db, @tanmay-db, @Divyansh-db, @tejaskochar-db, @mihaimitrea-db, @chrisst, @rauchy

Any maintainer (@andrewnester, @anton-107, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 25f9469

Run: 31725568342

Env ❌​FAIL 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 281 1144 7:17
❌​ aws windows 3 1 3 4 280 1142 7:21
💚​ azure linux 4 4 280 1144 6:42
❌​ azure windows 3 1 3 4 279 1142 7:31
💚​ gcp linux 1 5 281 1144 6:41
❌​ gcp windows 3 1 5 280 1142 8:00
11 interesting tests: 4 SKIP, 3 FAIL, 3 RECOVERED, 1 KNOWN
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
🟨​ TestAccept 💚​R 🟨​K 💚​R 🟨​K 💚​R 🟨​K
❌​ TestAccept/bundle/debug/fetch-repository-info ✅​p ❌​F ✅​p ❌​F ✅​p ❌​F
❌​ TestAccept/bundle/debug/fetch-repository-info/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ❌​F ✅​p ❌​F ✅​p ❌​F
❌​ TestAccept/bundle/debug/fetch-repository-info/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ❌​F ✅​p ❌​F ✅​p ❌​F
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:03 aws linux TestAccept
2:57 gcp linux TestAccept
2:48 azure linux 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.

2 participants