Skip to content

Fix missing git info for bundles deployed from in-workspace Git folders#5709

Open
ilyakuz-db wants to merge 2 commits into
mainfrom
fix-git-info-new-git-folders
Open

Fix missing git info for bundles deployed from in-workspace Git folders#5709
ilyakuz-db wants to merge 2 commits into
mainfrom
fix-git-info-new-git-folders

Conversation

@ilyakuz-db

Copy link
Copy Markdown
Contributor

Changes

When a bundle is deployed from inside the workspace and its source lives in a Git folder, the CLI reads git provenance from get-status?return_git_info=true. The new in-workspace Git-folder model returns only id and path there (no branch/commit/url), so the CLI recorded empty git info (origin URL, branch, commit).

This parses the git folder id and, when the origin URL is missing, falls back to Repos.GetByRepoId to fill in branch/commit/url. Classic Repos return these inline from get-status and skip the extra call. A failed lookup degrades to best-effort, matching FetchRepositoryInfo's existing contract.

Why

On dataplanes with the new in-workspace Git folders, get-status returns git_info: { id, path } only, while classic Repos return the full object — so in-workspace deploys from a Git folder recorded blank git provenance (including in the deployment metadata service version). The Repos API still returns full provenance for these folders by id. (Reading on-disk .git is not an option here — workspace Repos don't expose a usable .git on the dataplane, which is why the API path exists.)

Tests

Unit tests in libs/git/info_test.go (testserver + dbr.MockRuntime): new Git folder → provenance recovered via Repos API; classic Repo → Repos API not called; Repos lookup failure → graceful degradation. go test ./libs/git/ passes; lint clean.

This PR was written by Claude Code.

@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/libs/git/ - needs approval

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

General files (require maintainer)

Files: NEXT_CHANGELOG.md
Based on git history:

  • @denik -- recent work in ./, libs/git/

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

Co-authored-by: Isaac
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 804d517

Run: 28115881609

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 7 13 244 1024 6:35
💚​ aws windows 7 13 246 1022 4:36
💚​ aws-ucws linux 7 13 334 940 7:29
💚​ aws-ucws windows 7 13 336 938 5:52
💚​ azure linux 1 15 247 1022 5:42
💚​ azure windows 1 15 249 1020 5:03
💚​ azure-ucws linux 1 15 339 936 8:27
💚​ azure-ucws windows 1 15 341 934 6:06
💚​ gcp linux 1 15 246 1024 4:28
💚​ gcp windows 1 15 248 1022 5:08
20 interesting tests: 13 SKIP, 7 RECOVERED
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/replace_existing 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:10 aws linux TestSecretsPutSecretStringValue
3:33 gcp windows TestAccept
3:12 azure-ucws windows TestAccept
2:45 azure windows TestAccept
2:42 aws windows TestAccept
2:36 aws-ucws windows 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