Skip to content

Replace error message matching with structural error check in apps dev#5517

Merged
simonfaltum merged 6 commits into
mainfrom
simonfaltum/b42-err-string-matching
Jul 2, 2026
Merged

Replace error message matching with structural error check in apps dev#5517
simonfaltum merged 6 commits into
mainfrom
simonfaltum/b42-err-string-matching

Conversation

@simonfaltum

@simonfaltum simonfaltum commented Jun 9, 2026

Copy link
Copy Markdown
Member

Why

Found during a full-repo review of the CLI. cmd/apps/dev.go branched on the text of err.Error() (matching "does not exist" and "is deleted") to detect a missing app, which silently breaks the moment the upstream wording changes.

Changes

Before, dev-remote compared the error message string; now it uses a structural check that keeps working if the wording changes.

  • cmd/apps/dev.go: the Apps API reports a missing or deleted app with HTTP 404 ("App with name X does not exist or is deleted."), so dev-remote now checks errors.Is(err, apierr.ErrNotFound) inline at the call site. Note the 404 carries error code NOT_FOUND, which the SDK maps to a sentinel by status code only, so apierr.ErrResourceDoesNotExist would not match here.

The DBFS filer change from the original version of this PR was dropped: DBFS is being deprecated, and the fix there required an extra API call on the error path.

Test plan

  • go test ./cmd/apps passes.
  • ./task fmt-q, ./task lint-q, and ./task checks pass.

Two sites branched on err.Error() content. cmd/apps/dev.go now matches
the Apps API 404 via errors.Is with apierr.ErrNotFound, and the DBFS
filer Read re-stats the path to detect directories instead of matching
the SDK's error message.

Co-authored-by: Isaac
@simonfaltum simonfaltum requested a review from pietern June 9, 2026 20:51
@simonfaltum simonfaltum temporarily deployed to test-trigger-is June 9, 2026 20:51 — with GitHub Actions Inactive
@simonfaltum simonfaltum temporarily deployed to test-trigger-is June 9, 2026 20:51 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 824a88c

Run: 28579592729

Env 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 3 13 230 1040 5:12
🟨​ aws windows 7 3 13 232 1038 6:42
💚​ aws-ucws linux 10 13 314 958 4:48
💚​ aws-ucws windows 10 13 316 956 3:45
💚​ azure linux 4 15 230 1039 4:05
💚​ azure windows 4 15 232 1037 3:22
💚​ azure-ucws linux 4 15 316 955 4:51
💚​ azure-ucws windows 4 15 318 953 3:35
💚​ gcp linux 4 15 229 1041 3:40
💚​ gcp windows 4 15 231 1039 3:22
23 interesting tests: 13 SKIP, 7 KNOWN, 3 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 🟨​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_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
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 4 slowest tests (at least 2 minutes):
duration env testname
2:34 azure-ucws windows TestAccept
2:34 aws-ucws windows TestAccept
2:30 gcp windows TestAccept
2:28 azure windows TestAccept

Co-authored-by: Isaac
Comment thread cmd/apps/dev.go Outdated
})
if err != nil {
if strings.Contains(err.Error(), "does not exist") || strings.Contains(err.Error(), "is deleted") {
if isAppNotFound(err) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can be inlined.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done, inlined the check at the call site and dropped the helper (824a88c).

Comment thread libs/filer/dbfs_client.go Outdated
// when the path is a directory, so re-stat to detect that case.
if info, serr := w.workspaceClient.Dbfs.GetStatusByPath(ctx, absPath); serr == nil && info.IsDir {
return nil, notAFile{absPath}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This requires an additional API call.

DBFS is on its way out so I prefer not making any more changes to it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Makes sense, reverted the DBFS change (and its added stat call) entirely (824a88c). This PR is now apps-only.

Per review: DBFS is being deprecated so revert the dbfs_client change
(and its added stat call), and inline the isAppNotFound helper in apps
dev into the errors.Is check at the call site.

Co-authored-by: Isaac
@simonfaltum simonfaltum changed the title Replace error message matching with structural error checks in apps dev and DBFS filer Replace error message matching with structural error check in apps dev Jul 2, 2026
@simonfaltum simonfaltum temporarily deployed to test-trigger-is July 2, 2026 09:24 — with GitHub Actions Inactive
@simonfaltum simonfaltum temporarily deployed to test-trigger-is July 2, 2026 09:24 — with GitHub Actions Inactive
@simonfaltum simonfaltum enabled auto-merge July 2, 2026 09:28
@simonfaltum simonfaltum added this pull request to the merge queue Jul 2, 2026
Merged via the queue into main with commit 265035e Jul 2, 2026
29 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/b42-err-string-matching branch July 2, 2026 10:14
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