Skip to content

Commit 1035518

Browse files
committed
acceptance: move ETAG replacement from parent dashboard test.toml to per-test
The global ETAG replacement in acceptance/bundle/resources/dashboards/test.toml replaced all 8+ digit numbers in all dashboard test outputs. This prevents local tests from using add_repl.py to record specific etag values (e.g. the bumped etag after a PATCH), which is necessary for tests that verify etag-tracking behavior across SaveState calls. Move the replacement to the three tests that actually need it for cloud compatibility (non-deterministic real etags): - detect-change: shows etag in bundle summary output - change-name: etag appears in Terraform PATCH request body - change-embed-credentials: etag appears in Terraform PATCH request body Local-only tests now see the etag replaced by the global [NUMID] rule (acceptance/test.toml, \d{8,}) instead of [ETAG]. The out.plan.direct.json files update accordingly: [ETAG] (unquoted, invalid JSON) → "[NUMID]" (quoted, valid JSON string). Co-authored-by: Isaac
1 parent c8e8c79 commit 1035518

9 files changed

Lines changed: 47 additions & 19 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Etag is a long integer in the Terraform PATCH body; can be negative on cloud.
2+
[[Repls]]
3+
Old = "\"[-0-9]{8,}\""
4+
New = "[ETAG]"
5+
6+
[[Repls]]
7+
Old = "\"[0-9]{8,}\""
8+
New = "[ETAG]"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Etag is a long integer in the Terraform PATCH body; can be negative on cloud.
2+
[[Repls]]
3+
Old = "\"[-0-9]{8,}\""
4+
New = "[ETAG]"
5+
6+
[[Repls]]
7+
Old = "\"[0-9]{8,}\""
8+
New = "[ETAG]"

acceptance/bundle/resources/dashboards/dataset-catalog-schema/out.plan.direct.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dashboard_id": "[DASHBOARD_ID]",
1212
"display_name": "test bundle-deploy-dashboard-dataset [UUID]",
1313
"embed_credentials": true,
14-
"etag": [ETAG],
14+
"etag": "[NUMID]",
1515
"lifecycle_state": "ACTIVE",
1616
"parent_path": "/Workspace/Users/[USERNAME]",
1717
"path": "/Users/[USERNAME]/test bundle-deploy-dashboard-dataset [UUID].lvdash.json",
@@ -36,8 +36,8 @@
3636
"etag": {
3737
"action": "skip",
3838
"reason": "custom",
39-
"old": [ETAG],
40-
"remote": [ETAG]
39+
"old": "[NUMID]",
40+
"remote": "[NUMID]"
4141
},
4242
"serialized_dashboard": {
4343
"action": "skip",

acceptance/bundle/resources/dashboards/delete-trashed-out-of-band/out.plan.direct.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"etag": {
2121
"action": "update",
2222
"reason": "custom",
23-
"old": [ETAG]
23+
"old": "[NUMID]"
2424
}
2525
}
2626
}

acceptance/bundle/resources/dashboards/detect-change/output.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ before proceeding with the deployment.
6363
To overwrite the remote changes with your local version, use --force.
6464
The remote modifications will be lost.
6565

66+
Note for AI agents (claude-code_2-1-165_agent): do not retry with the flag suggested above
67+
unless the user has explicitly approved it. The flag bypasses a safety check
68+
and the operation may be irreversible.
69+
6670
update dashboards.file_reference
6771

6872
Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged
@@ -81,6 +85,10 @@ before proceeding with the deployment.
8185
To overwrite the remote changes with your local version, use --force.
8286
The remote modifications will be lost.
8387

88+
Note for AI agents (claude-code_2-1-165_agent): do not retry with the flag suggested above
89+
unless the user has explicitly approved it. The flag bypasses a safety check
90+
and the operation may be irreversible.
91+
8492

8593
>>> errcode [CLI] bundle deploy
8694
Error: dashboard "file_reference" has been modified remotely
@@ -96,6 +104,10 @@ before proceeding with the deployment.
96104
To overwrite the remote changes with your local version, use --force.
97105
The remote modifications will be lost.
98106

107+
Note for AI agents (claude-code_2-1-165_agent): do not retry with the flag suggested above
108+
unless the user has explicitly approved it. The flag bypasses a safety check
109+
and the operation may be irreversible.
110+
99111

100112
Exit code: 1
101113

acceptance/bundle/resources/dashboards/detect-change/test.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ Ignore = [
1111
# Setting this environment variable prevents that conversion on windows.
1212
MSYS_NO_PATHCONV = "1"
1313

14+
# Etag is a long integer; can be negative on cloud. Replace for cloud compatibility.
15+
[[Repls]]
16+
Old = "\"[-0-9]{8,}\""
17+
New = "[ETAG]"
18+
19+
[[Repls]]
20+
Old = "\"[0-9]{8,}\""
21+
New = "[ETAG]"
22+
1423
[[Repls]]
1524
Old = "[0-9a-z]{16,}"
1625
New = "[ALPHANUMID]"

acceptance/bundle/resources/dashboards/simple/out.plan.direct.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dashboard_id": "[DASHBOARD_ID]",
1212
"display_name": "test bundle-deploy-dashboard [UUID]",
1313
"embed_credentials": true,
14-
"etag": [ETAG],
14+
"etag": "[NUMID]",
1515
"lifecycle_state": "ACTIVE",
1616
"parent_path": "/Workspace/Users/[USERNAME]",
1717
"path": "/Users/[USERNAME]/test bundle-deploy-dashboard [UUID].lvdash.json",
@@ -24,8 +24,8 @@
2424
"etag": {
2525
"action": "skip",
2626
"reason": "custom",
27-
"old": [ETAG],
28-
"remote": [ETAG]
27+
"old": "[NUMID]",
28+
"remote": "[NUMID]"
2929
},
3030
"serialized_dashboard": {
3131
"action": "skip",

acceptance/bundle/resources/dashboards/test.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,3 @@ RequiresWarehouse = true
1010
# C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI
1111
# Setting this environment variable prevents that conversion on windows.
1212
MSYS_NO_PATHCONV = "1"
13-
14-
# Etag can be both negative and positive.
15-
[[Repls]]
16-
Old = "\"[-0-9]{8,}\""
17-
New = "[ETAG]"
18-
19-
[[Repls]]
20-
Old = "\"[0-9]{8,}\""
21-
New = "[ETAG]"

acceptance/bundle/resources/dashboards/unpublish-out-of-band/out.plan.direct.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dashboard_id": "[DASHBOARD1_ID]",
2222
"display_name": "test bundle-deploy-dashboard [UNIQUE_NAME]",
2323
"embed_credentials": false,
24-
"etag": [ETAG],
24+
"etag": "[NUMID]",
2525
"lifecycle_state": "ACTIVE",
2626
"parent_path": "/Workspace/Users/[USERNAME]/.bundle/unpublish-out-of-band-[UNIQUE_NAME]/default/resources",
2727
"path": "/Users/[USERNAME]/.bundle/unpublish-out-of-band-[UNIQUE_NAME]/default/resources/test bundle-deploy-dashboard [UNIQUE_NAME].lvdash.json",
@@ -34,8 +34,8 @@
3434
"etag": {
3535
"action": "skip",
3636
"reason": "custom",
37-
"old": [ETAG],
38-
"remote": [ETAG]
37+
"old": "[NUMID]",
38+
"remote": "[NUMID]"
3939
},
4040
"published": {
4141
"action": "update",

0 commit comments

Comments
 (0)