Repository navigation
Conversation
Regression test report ✅Commit: Selected 2 changed tests (limit=20, 0 not selected) 8 tests: regression=4 unreleased=0 coverage=4 failing=0
TestAccept/bundle/resources/dashboards/publish_504/DMS=: branch ✅ | main (9a14ad6) ❌ | latest (v1.28.0) ❌main (9a14ad6): latest (v1.28.0): TestAccept/bundle/resources/dashboards/publish_504/DMS=true: branch ✅ | main (9a14ad6) ❌ | latest (v1.28.0) ❌main (9a14ad6): latest (v1.28.0): TestAccept/bundle/resources/dashboards/publish_failure_trash_404/DMS=: branch ✅ | main (9a14ad6) ❌ | latest (v1.28.0) ❌main (9a14ad6): latest (v1.28.0): same output as main (9a14ad6) TestAccept/bundle/resources/dashboards/publish_failure_trash_404/DMS=true: branch ✅ | main (9a14ad6) ❌ | latest (v1.28.0) ❌main (9a14ad6): latest (v1.28.0): same output as main (9a14ad6) |
✅ Integration test reportCommit: ec61a8f
Top 3 slowest tests (at least 2 minutes):
|
There was a problem hiding this comment.
Automated review at 95c75c4. Each finding was verified against the code.
No blocking issues found. 1 non-blocking comment(s) below.
This PR retries the publish that follows a dashboard create in the direct engine on transient errors. When the publish still fails, the cleanup trash is now retried too. The publish retry looks right. The trash retry does not handle the NotFound that Delete in apply.go expects after a retry, so in the scenario this change targets, the deploy can report a misleading 404 instead of the publish failure.
| DashboardId: createResp.DashboardId, | ||
| }) | ||
| }) | ||
| if deleteErr != nil { |
There was a problem hiding this comment.
[nice to have] The comment says this is retried like DoDelete. But Delete in bundle/direct/apply.go expects a NotFound when an earlier attempt already deleted the resource, and treats apierr.IsMissing as success. This loop has no such check. When the first Trash is applied and then returns a 504 (the case publish_504 injects with --after-handler), the retried trash can get a 404. The CLI then warns "failed to delete draft dashboard" even though it was deleted, and returns that 404 instead of the publish 504 that caused the failure. The test can't catch this because DashboardTrash in libs/testserver returns 200 for an already-trashed dashboard. Can we check deleteErr != nil && !apierr.IsMissing(deleteErr) here, and keep (or wrap) the publish error err in the returned error?
There was a problem hiding this comment.
🤖 Agreed, fixed in e840b86.
- A 404 from a retried trash now counts as done (an earlier attempt may have trashed the dashboard despite its 504), the same rule
libs/retry/filer.gouses forDelete. A 404 on the first attempt is still reported: that one doesn't prove an earlier request deleted anything, and treating it as success could hide a dashboard left outside state. - When the trash does fail, the deploy now returns the publish error with the trash error appended (
... (deleting dashboard <id> after the failed publish also failed: ...)). The trash error is formatted with%v, so the error output still shows the publish request's endpoint and status. - Since the testserver answers a repeated trash with 200, the new test
dashboards/publish_failure_trash_404stubsDELETEwith a 404 and covers both cases: a 504 then a 404 (done, only the publish error), and a 404 on the first attempt (both errors). Mutating either check fails it.
AI agent (opus5.5, isaac_claude)
| // Retried like DoDelete: a dashboard left behind is not in state, so every later deploy | ||
| // would fail with ALREADY_EXISTS on its path. A retry that finds it gone is done, since | ||
| // an earlier attempt may have trashed it despite its error. | ||
| retried := false |
There was a problem hiding this comment.
libs/retry/filer.go and bundle/phases/dms.go already retry a delete and count a 404 on a later attempt as done. Could the three share one helper in libs/retry, here or in a follow-up?
There was a problem hiding this comment.
🤖 Done here, in a9727e9: new retry.Delete(ctx, isMissing, fn) in libs/retry/retry.go. It retries on IsTransient and accepts a "missing" error only on a later attempt. All three now call it: the retrying filer's Delete (with fs.ErrNotExist), deleteDeployment in bundle/phases/dms.go and the dashboard cleanup trash (both with apierr.IsMissing). Behavior is unchanged. The existing filer tests still pass, and new unit tests cover the helper directly: a 404 after a retry is success, a 404 on the first attempt is an error. A grep finds no other copy of the pattern. (libs/filer/files_client.go has a similar rule built on its own retrier and SDK retries, so I left it alone.)
AI agent (opus5.5, isaac_claude)
DoUpdate and DoDelete are wrapped in retry.With(retry.IsTransient) in apply.go, but DoCreate is not, so a 504 on the publish that follows a dashboard create trashed the new dashboard and failed the deploy. Publishing the same draft again is harmless, so retry it in DoCreate. cloud: TestAccept/bundle/resources/dashboards/unpublish-out-of-band TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=dashboard.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
cloud: TestAccept/bundle/resources/dashboards/unpublish-out-of-band TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=dashboard.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
A dashboard left behind after the cleanup trash fails is not in state, so every later deploy fails with ALREADY_EXISTS on its path. Retry the trash on transient errors like DoDelete, and treat a retry that finds it gone as done. The test now also covers every publish failing and checks the warehouse_id and embed_credentials each publish sends. cloud: TestAccept/bundle/resources/dashboards/unpublish-out-of-band TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=dashboard.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
cloud: TestAccept/bundle/resources/dashboards/unpublish-out-of-band TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=dashboard.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
A trash that lands but times out gets a 404 on its retry; that means the dashboard is gone, as in libs/retry/filer.go. A 404 on the first attempt is still reported. When the trash does fail, the deploy returns the publish error with the trash error appended, instead of the trash error. cloud: TestAccept/bundle/resources/dashboards/unpublish-out-of-band TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=dashboard.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
cloud: TestAccept/bundle/resources/dashboards/unpublish-out-of-band TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=dashboard.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
libs/retry/filer.go, bundle/phases/dms.go and the dashboard cleanup trash each retried a delete and accepted a "missing" error only on a later attempt. They now call one helper, retry.Delete, which takes the caller's missing check (fs.ErrNotExist or apierr.IsMissing). cloud: TestAccept/bundle/resources/dashboards/unpublish-out-of-band TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=dashboard.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
…tests errcode was removed from acceptance/script.prepare by #7975, so on current main these scripts fail with "errcode: command not found". cloud: TestAccept/bundle/resources/dashboards/unpublish-out-of-band TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=dashboard.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
a9727e9 to
ec61a8f
Compare
Changes
When the publish request that follows a dashboard create fails with a transient error (5xx, 408, inactivity timeout), the direct engine now retries it (
retry.With(ctx, retry.IsTransient, ...), up toretry.MaxRetriestimes) instead of trashing the new dashboard and failing the deploy.DoUpdateandDoDeleteare already wrapped inretry.With(ctx, retry.IsTransient, ...)inbundle/direct/apply.go, so the publish insideDoUpdateis already retried.DoCreateis retried only when it marks its errorretrySafe, which the dashboard create can't do as a whole, so its publish step had no retry. #7757 recovers a timed-out create request but not a timed-out publish after it.Publishing the same draft with the same
warehouse_idandembed_credentialsagain is harmless, so a publish that landed despite the error can be repeated.When the retries give up, the existing cleanup trashes the new dashboard. That trash is now retried on transient errors too, as
DoDeleteis; a 404 on a retried attempt counts as done (an earlier attempt trashed it), as inlibs/retry/filer.go. If the trash still fails, the deploy returns the publish error with the trash error appended.That retried-delete rule now lives in one helper,
retry.Deleteinlibs/retry, whichlibs/retry/filer.goandbundle/phases/dms.goalso use. Before this PR each had its own copy; behavior is unchanged. A dashboard left behind there is not in state, so every later deploy would fail with409 ALREADY_EXISTSon its path.Why
Since #7757 merged on 2026-11-18, both failures of this error on main were on the publish call:
Error: cannot create resources.dashboards.dashboard1: (504 DEADLINE_EXCEEDED)/Endpoint: POST [DATABRICKS_URL]/api/2.0/lakeview/dashboards/[DASHBOARD_ID]/publishedPOST .../lakeview/dashboards/[DASHBOARD_ID]/publishedTests
New acceptance test
bundle/resources/dashboards/publish_504:warehouse_idandembed_credentials, a follow-up plan shows no changes, and destroy deletes the dashboard. Without the fix both cases fail with the 504 above;bundle/resources/dashboards/publish_failure_trash_404stubs the trash with a 404 (the testserver answers a repeated trash with 200): a 504 then a 404 counts as done, and a 404 on the first attempt reports both errors.Dashboard
Error: cannot create resources.dashboards.[NAME]: (504 DEADLINE_EXCEEDED)onPOST .../lakeview/dashboards/[DASHBOARD_ID]/publishedGaps and risks
embed_credentialsorwarehouse_id, republishes the old values. Before this change the dashboard was trashed instead. The publish insideDoUpdateis already retried the same way, and the next deploy fixesembed_credentialsdrift.🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.