Repository navigation
Record the real error in config-remote-sync telemetry - #7720
ilyakuz-db wants to merge 14 commits into
Conversation
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…host Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 1 tests: regression=1 unreleased=0 coverage=0 failing=0
TestAccept/bundle/telemetry/config-remote-sync-error-message/DMS=: branch ✅ | main (8b7e509) ❌ | latest (v1.27.0) ❌main (8b7e509): latest (v1.27.0): same output as main (8b7e509) |
✅ Integration test reportCommit: 4f09cc0
Top 4 slowest tests (at least 2 minutes):
|
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Fable 5.2 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.
…heck the target's host Co-authored-by: Isaac <no-reply@databricks.com>
…st, and never refresh tokens for it Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Opus 5.5 + Claude Fable 5.2, cross-verified). Only points the reviewers agreed on are posted.
No blocking or major issues found.
Design, could be simpler: resolveProfile resolves the profile in a goroutine under its own 3s budget, but telemetry.Upload already resolves the config it is given within its timeout (libs/telemetry/logger.go:152). Put the unresolved Workspace{Profile}.Config(ctx) on the context, as cmd/root/auth.go:404 does, and read the profile's host with profile.WithName for the comparison. resolveProfile, profileAuthBudget and the abandoned goroutine go away.
|
Agree, profile management is too complex Factory, let's simplify as suggested; make sure that telemetry in config sync is fail-open. |
…ofile's host from the config file Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
… bundle's host Co-authored-by: Isaac <no-reply@databricks.com>
|
[AI] Simplified as suggested in 6277854: 🤖 Factory-generated comment. I still review the code and double-check every claim myself. |
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Follow-up review by review-factory (Claude Opus 5.5 + Claude Fable 5.2, cross-verified). Only points the reviewers agreed on are posted.
Earlier findings: 4 fixed.
No new issues found.
Changes
bundle config-remote-synctelemetry now records the first diagnostic error instead of theAlreadyPrintedsentinel. When loading the bundle or its target fails before bundle auth is set up, the event is still sent if a profile was selected explicitly (--profileorDATABRICKS_CONFIG_PROFILE).Why
Errors already printed to stderr reached telemetry only as the sentinel, and failures before auth (for example a target that assigns an undefined variable) sent no event at all, so many sync failures had no usable message. The fallback uses only the selected profile, so hosts from the bundle config are never contacted. It reads the profile from the config file and leaves the config for the telemetry upload to resolve within its own timeout, with the profile winning over auth env vars and no OAuth token refresh. No profile, an unknown profile, a profile for another host or workspace than the bundle's or the selected target's, a bundle auth error, or disabled telemetry sends nothing. The JSON output keeps the sentinel error, so callers that fall back to stderr are unchanged.
Tests
New acceptance test
bundle/telemetry/config-remote-sync-error-messagechecks the real message after an already printed error, a target-load failure (with-p, withDATABRICKS_CONFIG_PROFILE, with a matching bundle or target host or workspace, withDATABRICKS_HOSTset to another host, and for the default target) and a missing bundle with-p, and that nothing is sent, and no request made, without a profile, with an unknown profile, with a profile for another host than the bundle's or the target's or for another workspace on the bundle's host, or on a bundle auth error. With a profile host that never answers, the failing run takes 3s (the upload's own timeout) and returns at once withDATABRICKS_CLI_DISABLE_TELEMETRY=1. The config-remote-sync and telemetry acceptance tests, theconfigsync/cmd/bundleunit tests and lint pass locally.4f09cc0(latest)DATABRICKS_HOST, a profile for another workspace on the same host); still open: the bundle'sworkspace_idis not used when the profile has none, the profile file is read outside the upload timeout, a profile with an empty host4f09cc0(latest)SIMPLER PATH: drop the bundle host and workspace check, since the profile-only config already keeps telemetry off bundle hosts4f09cc0(latest)4f09cc0(latest)4f09cc0(latest)4f09cc0(latest)✅ success · ⏳ pending ·⚠️ warning · ❌ failed · ➖ n/a
This pull request and its description were written by Isaac.