Skip to content

Improve error for labs projects that do not provide labs.yml#5559

Open
janniklasrose wants to merge 1 commit into
mainfrom
janniklasrose/labs-install-missing-labs-yml
Open

Improve error for labs projects that do not provide labs.yml#5559
janniklasrose wants to merge 1 commit into
mainfrom
janniklasrose/labs-install-missing-labs-yml

Conversation

@janniklasrose

@janniklasrose janniklasrose commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Changes

databricks labs install <name> only works for repositories in the databrickslabs GitHub org that ship a labs.yml manifest at the repository root. Most repositories in the org do not (they are libraries published to CRAN, PyPI, Maven, etc.), and installing one of them fails with:

Error: remote: read labs.yml from GitHub: not found

which gives the user no clue what is wrong.

Detect the not-found case when fetching labs.yml and return an actionable error instead:

Error: remote: databrickslabs/brickster@v0.2.13 does not provide labs.yml (not found); this project cannot be installed with the Databricks CLI, see https://github.com/databrickslabs/brickster for instructions

This also covers projects without any GitHub release, where the version resolves to the literal ref latest and the fetch 404s the same way.

While PR #5560 limits databricks labs list to those that are installable, users can still provide a lab name not in that list. Thus, this PR is still relevant for graceful error handling.

Tests

New unit test simulating a project whose release tag has no labs.yml (cmd/labs/project/fetcher_test.go). Verified live: databricks labs install brickster produces the message above.

This pull request and its description were written by Isaac, an AI coding agent.

Most repositories in the databrickslabs GitHub org do not ship a labs.yml manifest and thus cannot be installed via the CLI. Installing one of them (e.g. 'databricks labs install brickster') failed with the cryptic 'Error: remote: read labs.yml from GitHub: not found'. Detect the not-found case and explain that the project is not installable with the CLI, pointing at the repository for instructions.

Co-authored-by: Isaac
@github-actions

Copy link
Copy Markdown
Contributor

Waiting for approval

Based on git history, these people are best suited to review:

  • @pietern -- recent work in cmd/labs/project/

Eligible reviewers: @alexott, @asnare

Suggestions based on git history. See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Commit: cb135fc

Run: 27368181709

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 15 264 969 8:55
🟨​ aws windows 7 15 266 967 14:00
💚​ aws-ucws linux 7 15 360 883 7:31
💚​ aws-ucws windows 7 15 362 881 10:11
💚​ azure linux 1 17 267 967 7:03
🔄​ azure windows 2 1 17 267 965 11:21
💚​ azure-ucws linux 1 17 365 879 8:29
💚​ azure-ucws windows 1 17 367 877 11:27
🔄​ gcp linux 2 1 17 261 970 9:49
💚​ gcp windows 1 17 265 968 10:52
24 interesting tests: 15 SKIP, 7 KNOWN, 2 flaky
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 🟨​K 🟨​K 💚​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 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​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_endpoints/recreate 🙈​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/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/grants/select 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestFetchRepositoryInfoAPI_FromRepo/root ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p 🔄​f ✅​p
🔄​ TestFetchRepositoryInfoAPI_FromRepo/subdir ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p 🔄​f ✅​p
Top 28 slowest tests (at least 2 minutes):
duration env testname
5:18 azure-ucws windows TestAccept
5:02 azure windows TestAccept
4:58 gcp windows TestAccept
4:50 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:48 aws-ucws windows TestAccept
4:23 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:22 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:13 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:33 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:29 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:21 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:15 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:07 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:06 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:05 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:58 azure-ucws linux TestAccept
2:57 azure linux TestAccept
2:57 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:56 gcp linux TestAccept
2:49 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:46 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:45 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:45 aws-ucws linux TestAccept
2:29 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:25 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:23 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@simonfaltum simonfaltum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Verified the ErrNotFound chain end to end (errors.Is still works through both wraps) and ran the new test at the PR head. A typoed project name fails earlier at the releases call, so this message cannot fire for nonexistent repos.

Two optional notes inline. Also: this changes user-visible output, so consider a one-liner under ### CLI in NEXT_CHANGELOG.md.

// (e.g. libraries published to package indexes), so a missing file means the
// project isn't installable through the CLI, not that the download failed.
if errors.Is(err, github.ErrNotFound) {
return nil, fmt.Errorf("databrickslabs/%s@%s does not provide labs.yml (%w); "+

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This branch also catches a valid project requested at a version that does not exist, e.g. labs install blueprint@v9.9.9 (right after the "Installing unreleased version" warning). For that case the message is wrong: blueprint does provide labs.yml, the ref is just bad. Consider wording that covers both causes, e.g. labs.yml not found for databrickslabs/%s@%s; either this version does not exist or this project cannot be installed with the Databricks CLI, see ...

return
}
t.Logf("Requested: %s", r.URL.Path)
t.FailNow()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit, and it matches the existing pattern in installer_test.go, so fine to leave as is: t.FailNow() from the handler goroutine is documented as illegal (it must run on the test goroutine; here it only kills the handler via runtime.Goexit and the client sees a dropped connection). The idiomatic shape is t.Errorf(...) followed by http.Error(w, "unexpected request", http.StatusInternalServerError). Cleaning up all five occurrences in this file would make a nice separate PR.

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