From 3a3f06ff73c259c2a2020d56cb9748bc30515b6c Mon Sep 17 00:00:00 2001 From: "ilya.kuznetsov" Date: Mon, 16 Nov 2026 16:01:38 +0000 Subject: [PATCH 1/3] Report config-remote-sync selector misses under their own telemetry category Co-authored-by: Isaac --- .../json_status_selectors/output.txt | 1 + .../databricks.yml | 11 ++++++++++ .../out.test.toml | 3 +++ .../output.txt | 21 +++++++++++++++++++ .../script | 9 ++++++++ .../test.toml | 2 ++ cmd/bundle/config_remote_sync.go | 4 ++++ .../protos/bundle_config_remote_sync.go | 1 + 8 files changed, 52 insertions(+) create mode 100644 acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/databricks.yml create mode 100644 acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/out.test.toml create mode 100644 acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/output.txt create mode 100644 acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/script create mode 100644 acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/test.toml diff --git a/acceptance/bundle/config-remote-sync/json_status_selectors/output.txt b/acceptance/bundle/config-remote-sync/json_status_selectors/output.txt index 2b13979059e..c68bfcfd69c 100644 --- a/acceptance/bundle/config-remote-sync/json_status_selectors/output.txt +++ b/acceptance/bundle/config-remote-sync/json_status_selectors/output.txt @@ -7,6 +7,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged { "status": "skipped", "error": "no deployed jobs resource with id no-such-id-999; deployed jobs ids in state: [TEST_JOB_ID]", + "errorCode": "NO_MATCHING_SELECTOR", "files": null, "changes": {} } diff --git a/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/databricks.yml b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/databricks.yml new file mode 100644 index 00000000000..50f1b73391d --- /dev/null +++ b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/databricks.yml @@ -0,0 +1,11 @@ +bundle: + name: config-remote-sync-no-matching-selector + +resources: + jobs: + foo: + name: test job + tasks: + - task_key: main + notebook_task: + notebook_path: /Workspace/Users/tester@databricks.com/notebook diff --git a/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/out.test.toml b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/out.test.toml new file mode 100644 index 00000000000..aadf9e4a151 --- /dev/null +++ b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/out.test.toml @@ -0,0 +1,3 @@ +Cloud = false +GOOS.windows = false +EnvMatrix.DMS = [""] diff --git a/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/output.txt b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/output.txt new file mode 100644 index 00000000000..b5459f4ae50 --- /dev/null +++ b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/output.txt @@ -0,0 +1,21 @@ + +>>> [CLI] bundle deploy +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/config-remote-sync-no-matching-selector/default/files... +Created jobs.foo +Files: 1 uploaded, 0 deleted +Resources: 1 created, 0 changed, 0 deleted, 0 unchanged + +>>> [CLI] bundle config-remote-sync --select-ids jobs:999999 -o json +{ + "status": "skipped", + "error": "no deployed jobs resource with id 999999; deployed jobs ids in state: [FOO_ID]", + "errorCode": "NO_MATCHING_SELECTOR", + "files": null, + "changes": {} +} + +>>> cat [OUTPUT_DIR]/out.requests.txt +{ + "error_message": "no deployed jobs resource with id 999999; deployed jobs ids in state: [FOO_ID]", + "error_category": "NO_MATCHING_SELECTOR" +} diff --git a/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/script b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/script new file mode 100644 index 00000000000..311fa0e0a60 --- /dev/null +++ b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/script @@ -0,0 +1,9 @@ +trace $CLI bundle deploy +read_id.py foo > /dev/null + +# No deployed job has this id, so the sync is skipped rather than failed. +trace $CLI bundle config-remote-sync --select-ids "jobs:999999" -o json + +trace cat "$OUT_REQUESTS" | jq 'select(has("path") and .path == "/telemetry-ext") | .body.protoLogs[] | fromjson | .entry.databricks_cli_log.bundle_config_remote_sync_event | select(. != null) | {error_message, error_category}' + +rm "$OUT_REQUESTS" diff --git a/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/test.toml b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/test.toml new file mode 100644 index 00000000000..97b2a8e4d49 --- /dev/null +++ b/acceptance/bundle/telemetry/config-remote-sync-no-matching-selector/test.toml @@ -0,0 +1,2 @@ +# config-remote-sync is not supported on Windows. +GOOS.windows = false diff --git a/cmd/bundle/config_remote_sync.go b/cmd/bundle/config_remote_sync.go index 83344855e5c..8ffd8c43148 100644 --- a/cmd/bundle/config_remote_sync.go +++ b/cmd/bundle/config_remote_sync.go @@ -114,6 +114,10 @@ Examples: // changes are restricted to the selected resources. selected, err := configsync.ResolveResourceSelectors(ctx, &deployBundle.StateDB, selectIDs) if err != nil { + // Reported as skipped, not failed, so it must not count as a load failure. + if errors.Is(err, configsync.ErrNoMatchingSelector) { + stats.ErrorCategory = protos.BundleConfigRemoteSyncErrorCategoryNoMatchingSelector + } return err } // A selected resource planned as a delete was renamed or removed in the diff --git a/libs/telemetry/protos/bundle_config_remote_sync.go b/libs/telemetry/protos/bundle_config_remote_sync.go index a62a823c64e..bf0506aeb01 100644 --- a/libs/telemetry/protos/bundle_config_remote_sync.go +++ b/libs/telemetry/protos/bundle_config_remote_sync.go @@ -12,6 +12,7 @@ const ( BundleConfigRemoteSyncErrorCategorySaveFailed BundleConfigRemoteSyncErrorCategory = "SAVE_FAILED" BundleConfigRemoteSyncErrorCategoryOutputFailed BundleConfigRemoteSyncErrorCategory = "OUTPUT_FAILED" BundleConfigRemoteSyncErrorCategoryResourceNotInConfig BundleConfigRemoteSyncErrorCategory = "RESOURCE_NOT_IN_CONFIG" + BundleConfigRemoteSyncErrorCategoryNoMatchingSelector BundleConfigRemoteSyncErrorCategory = "NO_MATCHING_SELECTOR" ) // BundleConfigRemoteSyncEvent is emitted on every execution of the From beaf1d0af2337419e6f5b99f67aac05fe1a17557 Mon Sep 17 00:00:00 2001 From: "ilya.kuznetsov" Date: Mon, 16 Nov 2026 16:04:24 +0000 Subject: [PATCH 2/3] Describe the skipped selector category in the error_category comment Co-authored-by: Isaac --- libs/telemetry/protos/bundle_config_remote_sync.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/telemetry/protos/bundle_config_remote_sync.go b/libs/telemetry/protos/bundle_config_remote_sync.go index bf0506aeb01..ffc261a7ab6 100644 --- a/libs/telemetry/protos/bundle_config_remote_sync.go +++ b/libs/telemetry/protos/bundle_config_remote_sync.go @@ -122,7 +122,8 @@ type BundleConfigRemoteSyncEvent struct { // stays in-region and is stripped from centralized logfood. Unset on success. ErrorMessage string `json:"error_message,omitempty"` - // Category of the failure when the command exits with an error. + // Category of the failure when the command exits with an error, or + // NO_MATCHING_SELECTOR for a run skipped because no selector matched. // Unset on success. ErrorCategory BundleConfigRemoteSyncErrorCategory `json:"error_category,omitempty"` } From 25ca0110cbdc6abc5ca08588cd6ebb69425e7241 Mon Sep 17 00:00:00 2001 From: "ilya.kuznetsov" Date: Wed, 18 Nov 2026 18:17:49 +0000 Subject: [PATCH 3/3] Say selector misses are reported as skipped only in JSON output Co-authored-by: Isaac --- cmd/bundle/config_remote_sync.go | 2 +- libs/telemetry/protos/bundle_config_remote_sync.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/bundle/config_remote_sync.go b/cmd/bundle/config_remote_sync.go index 8ffd8c43148..f762c87c7c2 100644 --- a/cmd/bundle/config_remote_sync.go +++ b/cmd/bundle/config_remote_sync.go @@ -114,7 +114,7 @@ Examples: // changes are restricted to the selected resources. selected, err := configsync.ResolveResourceSelectors(ctx, &deployBundle.StateDB, selectIDs) if err != nil { - // Reported as skipped, not failed, so it must not count as a load failure. + // Reported as skipped in JSON output, so it must not count as a load failure. if errors.Is(err, configsync.ErrNoMatchingSelector) { stats.ErrorCategory = protos.BundleConfigRemoteSyncErrorCategoryNoMatchingSelector } diff --git a/libs/telemetry/protos/bundle_config_remote_sync.go b/libs/telemetry/protos/bundle_config_remote_sync.go index ffc261a7ab6..edb7b80eeab 100644 --- a/libs/telemetry/protos/bundle_config_remote_sync.go +++ b/libs/telemetry/protos/bundle_config_remote_sync.go @@ -123,7 +123,8 @@ type BundleConfigRemoteSyncEvent struct { ErrorMessage string `json:"error_message,omitempty"` // Category of the failure when the command exits with an error, or - // NO_MATCHING_SELECTOR for a run skipped because no selector matched. + // NO_MATCHING_SELECTOR when no selector matched (reported as skipped in JSON + // output). // Unset on success. ErrorCategory BundleConfigRemoteSyncErrorCategory `json:"error_category,omitempty"` }