…rts (databricks#7509)
## Changes
`libs/testserver` now answers alert get/update/trash the way the cloud
does for trashed, purged and unknown alerts:
| state | get | update | trash |
|---|---|---|---|
| trashed (not purged) | 200, `lifecycle_state: DELETED` | 400
`INVALID_PARAMETER_VALUE` `Cannot move node '<file>' (ID: <id>) because
it is in trash folder` | 400 `BAD_REQUEST` `Alert <id> is already
trashed` (purge still succeeds) |
| purged | 404 `NOT_FOUND` `Tree node with id <id> does not exist` |
same | same |
| never existed | 404 `NOT_FOUND` `Alert with id <id> not found or has
no folder node internal name` | same as get | 404 `NOT_FOUND` `Alert
with id <id> not found` |
Before this, get returned 404 with the old `Alert with ID '<id>' does
not exist.` message for both trashed and missing alerts, and
update/trash returned a bare 404 with no body. Update and trash of a
trashed alert succeeded.
New local test `acceptance/cmd/workspace/alerts-v2-not-found` records
this matrix.
## Why
Follow-up to databricks#7492, where the review asked to fix the testserver as
well. That PR left the old message in place.
Decisions:
- The test is local-only. The expected output was recorded on AWS with
the same script, with two known differences: on trash-again the cloud's
message has a different UUID than the alert id, and on update the
cloud's file name has a timestamp suffix (the file is renamed when
trashed). Neither is worth modelling.
- Purged ids are kept in a set so the testserver can tell "purged" from
"never existed", which the cloud reports differently.
- Body validation on create (e.g. the cloud requires a threshold for
`EQUAL`) is out of scope.
## Tests
- `go test ./acceptance -run
TestAccept/cmd/workspace/alerts-v2-not-found` passes locally.
- Every local acceptance test that mentions alerts passes. The same
`bundle/migrate/*`, `bundle/state/*` and `bundle/user_agent/simple`
failures show up on a clean main in this environment, so they are
unrelated.
- Cloud (AWS): ran the same script with `Cloud = true` via `testme-aws`
to capture the responses above.
## Dashboard:
Follow-up to
[error/3324](http://go/cli/dashboard/error/3324?main=1&pr=1&end=2026-11-11T17:00:00Z&last=2d).
It does not fix a failing test, because databricks#7492 already made the cloud
test pass:
| link | failure |
|---|---|
|
[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>
Changes
In
bundle/resources/alerts/basic, the check that the alert is gone afterbundle destroynow asserts only that thealerts-v2 get-alerterror containsdoes not exist. It no longer records the full backend message. It follows the samemusterr ... &> LOG.x+contains.pypattern used inacceptance/cmd/api/response-handling.Why
Since 2026-11-10 ~18:00 UTC the backend returns a different not-found message for a deleted alert, on AWS, Azure and GCP:
The test only needs to show that the alert was deleted. The exact wording is backend-owned and has now changed once, so matching the stable part keeps the test from breaking on the next rewording.
Decisions:
ALERT_IDreplacement. Failures began at the same time on all three clouds across several different CLI commits, which points to a backend rollout.does not exist, so local and cloud runs both pass.Tests
go test ./acceptance -run 'TestAccept/bundle/resources/alerts/basic'passes.testme-aws -count=1 -run 'TestAccept/bundle/resources/alerts/basic'passes forDMS=andDMS=trueagainst the current backend.Dashboard:
Error: Tree node with id [ALERT_ID] does not exist(expectedError: Alert with ID '[ALERT_ID]' does not exist.)This pull request and its description were written by Isaac.