Skip to content

Commit 7ca96cd

Browse files
denikIsaac
andauthored
acc: alerts-v2-not-found: label lifecycle_state, name cloud differences (#7546)
## Changes Follow-up to [#7509](#7509), addressing review comments that arrived after it merged. Both are in `acceptance/cmd/workspace/alerts-v2-not-found`: - The trashed-alert `get-alert` now projects `jq '{lifecycle_state}'`, matching `alerts/with_file/script`, so the golden labels the value instead of printing a bare `DELETED`. - The header comment now names the two known differences on the cloud: trash-again reports a different UUID than the alert id, and update on a trashed alert names the file with a timestamp suffix. That way nobody flips `Cloud = true` without knowing about them. ## Why Review feedback on [#7509](#7509). ## Tests `go test ./acceptance -run TestAccept/cmd/workspace/alerts-v2-not-found` passes locally. ## Dashboard: Follow-up only. No failing test is fixed here. Related: [error/3324](http://go/cli/dashboard/error/3324?main=1&pr=1&end=2026-11-11T17:00:00Z&last=2d) (`Error: Tree node with id [ALERT_ID] does not exist`). This pull request and its description were written by Isaac. Co-authored-by: Isaac <no-reply@databricks.com>
1 parent b69a249 commit 7ca96cd

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎acceptance/cmd/workspace/alerts-v2-not-found/output.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
>>> [CLI] alerts-v2 trash-alert [ALERT_ID]
55

66
>>> [CLI] alerts-v2 get-alert [ALERT_ID]
7-
DELETED
7+
{
8+
"lifecycle_state": "DELETED"
9+
}
810

911
>>> [CLI] alerts-v2 trash-alert [ALERT_ID]
1012
Error: Alert [ALERT_ID] is already trashed

‎acceptance/cmd/workspace/alerts-v2-not-found/script‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Alert get/update/trash responses for trashed, purged and unknown alerts.
22
# Expected output was recorded against AWS on 2026-11-11; the test is local-only
3-
# because the messages are backend-owned and have changed before.
3+
# because the messages are backend-owned and have changed before. Two known
4+
# differences on cloud, so Cloud = true would fail:
5+
# - trash-alert on a trashed alert reports a different UUID than the alert id;
6+
# - update-alert on a trashed alert names the file with a timestamp suffix
7+
# (myalert-<timestamp>.dbalert.json), since trashing renames it.
48
create_alert() {
59
$CLI alerts-v2 create-alert --json '{"display_name": "'$1'", "query_text": "select 1", "warehouse_id": "w1", "evaluation": {"comparison_operator": "EQUAL", "source": {"name": "1"}, "threshold": {"value": {"double_value": 1}}}, "schedule": {"quartz_cron_schedule": "0 0 * * * ?", "timezone_id": "UTC"}}' | jq -r .id
610
}
@@ -10,7 +14,7 @@ add_repl "$alert_id" ALERT_ID
1014

1115
title "trashed alert is still readable"
1216
trace $CLI alerts-v2 trash-alert $alert_id
13-
trace $CLI alerts-v2 get-alert $alert_id | jq -r .lifecycle_state
17+
trace $CLI alerts-v2 get-alert $alert_id | jq '{lifecycle_state}'
1418
errcode trace $CLI alerts-v2 trash-alert $alert_id
1519
errcode trace $CLI alerts-v2 update-alert $alert_id display_name --json '{"display_name": "x"}'
1620

0 commit comments

Comments
 (0)