|
| 1 | + |
| 2 | +=== first deploy triggers a run |
| 3 | +>>> [CLI] bundle deploy |
| 4 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 5 | +Output from job_runs.my_run: id=[MY_RUN_ID]: Run URL: [DATABRICKS_URL]/jobs/[MY_JOB_ID]/runs/[MY_RUN_ID]?o=[NUMID] |
| 6 | +Output from job_runs.my_run: id=[MY_RUN_ID]: SUCCESS |
| 7 | +Created job_runs.my_run |
| 8 | +Created jobs.my_job |
| 9 | +Files: 4 uploaded, 0 deleted |
| 10 | +Resources: 2 created, 0 changed, 0 deleted, 0 unchanged |
| 11 | + |
| 12 | +>>> read_id.py my_job |
| 13 | +[MY_JOB_ID] |
| 14 | + |
| 15 | +>>> print_requests.py //jobs/run-now |
| 16 | +{ |
| 17 | + "method": "POST", |
| 18 | + "path": "/api/2.2/jobs/run-now", |
| 19 | + "body": { |
| 20 | + "idempotency_token": "[UUID]", |
| 21 | + "job_id": [MY_JOB_ID] |
| 22 | + } |
| 23 | +} |
| 24 | + |
| 25 | +=== resolved values are stored as hashes |
| 26 | +>>> print_state.py |
| 27 | +{ |
| 28 | + "on_file_change": { |
| 29 | + "watched.txt": "[FILE_HASH][0]" |
| 30 | + }, |
| 31 | + "on_value_change": { |
| 32 | + "${var.long}": "a-long-non-hex-watched-value-used-to-exercise-a-lengthy-string-zzz", |
| 33 | + "${var.number}": "42", |
| 34 | + "${var.other}": "a1", |
| 35 | + "${var.stamp}": "v1", |
| 36 | + "${workspace.root_path}": "/Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default" |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | +=== redeploy with unchanged values plans nothing |
| 41 | +>>> [CLI] bundle plan |
| 42 | +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged |
| 43 | + |
| 44 | +>>> [CLI] bundle deploy |
| 45 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 46 | +Files: 0 uploaded, 0 deleted |
| 47 | +Resources: 0 created, 0 changed, 0 deleted, 2 unchanged |
| 48 | + |
| 49 | +>>> print_requests.py //jobs/run-now |
| 50 | + |
| 51 | +=== changing one value re-fires |
| 52 | +>>> [CLI] bundle plan |
| 53 | +recreate job_runs.my_run |
| 54 | + |
| 55 | +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged |
| 56 | + |
| 57 | +>>> changes |
| 58 | +{ |
| 59 | + "lifecycle.triggers_state.on_value_change['${var.stamp}']": { |
| 60 | + "action": "recreate", |
| 61 | + "reason": "immutable", |
| 62 | + "old": "v1", |
| 63 | + "new": "v2" |
| 64 | + }, |
| 65 | + "result_state": { |
| 66 | + "action": "skip", |
| 67 | + "reason": "remote_already_set", |
| 68 | + "new": "SUCCESS", |
| 69 | + "remote": "SUCCESS" |
| 70 | + } |
| 71 | +} |
| 72 | + |
| 73 | +>>> [CLI] bundle deploy |
| 74 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 75 | +Output from job_runs.my_run: id=[MY_RUN_ID_2]: Run URL: [DATABRICKS_URL]/jobs/[MY_JOB_ID]/runs/[MY_RUN_ID_2]?o=[NUMID] |
| 76 | +Output from job_runs.my_run: id=[MY_RUN_ID_2]: SUCCESS |
| 77 | +Recreated job_runs.my_run |
| 78 | +Files: 1 uploaded, 0 deleted |
| 79 | +Resources: 1 created, 0 changed, 1 deleted, 1 unchanged |
| 80 | + |
| 81 | +>>> print_requests.py --keep //jobs/runs/delete |
| 82 | +{ |
| 83 | + "method": "POST", |
| 84 | + "path": "/api/2.2/jobs/runs/delete", |
| 85 | + "body": { |
| 86 | + "run_id": [MY_RUN_ID] |
| 87 | + } |
| 88 | +} |
| 89 | + |
| 90 | +>>> print_requests.py //jobs/run-now |
| 91 | +{ |
| 92 | + "method": "POST", |
| 93 | + "path": "/api/2.2/jobs/run-now", |
| 94 | + "body": { |
| 95 | + "idempotency_token": "[UUID]", |
| 96 | + "job_id": [MY_JOB_ID] |
| 97 | + } |
| 98 | +} |
| 99 | + |
| 100 | +=== removing one on_value_change through a saved plan does not run |
| 101 | +>>> [CLI] bundle plan |
| 102 | +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged |
| 103 | + |
| 104 | +>>> [CLI] bundle deploy --plan tmp.plan.json |
| 105 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 106 | +Files: 2 uploaded, 0 deleted |
| 107 | +Resources: 0 created, 0 changed, 0 deleted, 2 unchanged |
| 108 | + |
| 109 | +>>> print_requests.py //jobs/run-now |
| 110 | + |
| 111 | +=== re-adding the same on_value_change after the saved plan re-fires |
| 112 | +>>> [CLI] bundle plan |
| 113 | +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged |
| 114 | + |
| 115 | +>>> changes |
| 116 | +{ |
| 117 | + "result_state": { |
| 118 | + "action": "skip", |
| 119 | + "reason": "remote_already_set", |
| 120 | + "new": "SUCCESS", |
| 121 | + "remote": "SUCCESS" |
| 122 | + } |
| 123 | +} |
| 124 | + |
| 125 | +>>> [CLI] bundle deploy |
| 126 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 127 | +Files: 1 uploaded, 0 deleted |
| 128 | +Resources: 0 created, 0 changed, 0 deleted, 2 unchanged |
| 129 | + |
| 130 | +>>> print_requests.py --keep //jobs/runs/delete |
| 131 | + |
| 132 | +>>> print_requests.py //jobs/run-now |
| 133 | + |
| 134 | +=== removing the same on_value_change again does not run |
| 135 | +>>> [CLI] bundle plan |
| 136 | +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged |
| 137 | + |
| 138 | +>>> [CLI] bundle deploy |
| 139 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 140 | +Files: 1 uploaded, 0 deleted |
| 141 | +Resources: 0 created, 0 changed, 0 deleted, 2 unchanged |
| 142 | + |
| 143 | +>>> print_requests.py //jobs/run-now |
| 144 | + |
| 145 | +=== changing a remaining watch to a removed value re-fires |
| 146 | +>>> [CLI] bundle plan |
| 147 | +recreate job_runs.my_run |
| 148 | + |
| 149 | +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged |
| 150 | + |
| 151 | +>>> changes |
| 152 | +{ |
| 153 | + "lifecycle.triggers_state.on_value_change['${var.stamp}']": { |
| 154 | + "action": "recreate", |
| 155 | + "reason": "immutable", |
| 156 | + "old": "v2", |
| 157 | + "new": "a1" |
| 158 | + }, |
| 159 | + "result_state": { |
| 160 | + "action": "skip", |
| 161 | + "reason": "remote_already_set", |
| 162 | + "new": "SUCCESS", |
| 163 | + "remote": "SUCCESS" |
| 164 | + } |
| 165 | +} |
| 166 | + |
| 167 | +>>> [CLI] bundle deploy |
| 168 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 169 | +Output from job_runs.my_run: id=[MY_RUN_ID_4]: Run URL: [DATABRICKS_URL]/jobs/[MY_JOB_ID]/runs/[MY_RUN_ID_4]?o=[NUMID] |
| 170 | +Output from job_runs.my_run: id=[MY_RUN_ID_4]: SUCCESS |
| 171 | +Recreated job_runs.my_run |
| 172 | +Files: 1 uploaded, 0 deleted |
| 173 | +Resources: 1 created, 0 changed, 1 deleted, 1 unchanged |
| 174 | + |
| 175 | +>>> print_requests.py --keep //jobs/runs/delete |
| 176 | +{ |
| 177 | + "method": "POST", |
| 178 | + "path": "/api/2.2/jobs/runs/delete", |
| 179 | + "body": { |
| 180 | + "run_id": [MY_RUN_ID_2] |
| 181 | + } |
| 182 | +} |
| 183 | + |
| 184 | +>>> print_requests.py //jobs/run-now |
| 185 | +{ |
| 186 | + "method": "POST", |
| 187 | + "path": "/api/2.2/jobs/run-now", |
| 188 | + "body": { |
| 189 | + "idempotency_token": "[UUID]", |
| 190 | + "job_id": [MY_JOB_ID] |
| 191 | + } |
| 192 | +} |
| 193 | + |
| 194 | +=== removing the remaining on_value_change entries is unchanged and does not run |
| 195 | +>>> [CLI] bundle plan |
| 196 | +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged |
| 197 | + |
| 198 | +>>> [CLI] bundle deploy |
| 199 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 200 | +Files: 1 uploaded, 0 deleted |
| 201 | +Resources: 0 created, 0 changed, 0 deleted, 2 unchanged |
| 202 | + |
| 203 | +>>> print_requests.py //jobs/run-now |
| 204 | + |
| 205 | +=== file changes still re-fire after value triggers are removed |
| 206 | +>>> [CLI] bundle plan |
| 207 | +recreate job_runs.my_run |
| 208 | + |
| 209 | +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged |
| 210 | + |
| 211 | +>>> changes |
| 212 | +{ |
| 213 | + "lifecycle.triggers_state.on_file_change['watched.txt']": { |
| 214 | + "action": "recreate", |
| 215 | + "reason": "immutable", |
| 216 | + "old": "[FILE_HASH][0]", |
| 217 | + "new": "[FILE_HASH][1]" |
| 218 | + }, |
| 219 | + "result_state": { |
| 220 | + "action": "skip", |
| 221 | + "reason": "remote_already_set", |
| 222 | + "new": "SUCCESS", |
| 223 | + "remote": "SUCCESS" |
| 224 | + } |
| 225 | +} |
| 226 | + |
| 227 | +>>> [CLI] bundle deploy |
| 228 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default/files... |
| 229 | +Output from job_runs.my_run: id=[MY_RUN_ID_5]: Run URL: [DATABRICKS_URL]/jobs/[MY_JOB_ID]/runs/[MY_RUN_ID_5]?o=[NUMID] |
| 230 | +Output from job_runs.my_run: id=[MY_RUN_ID_5]: SUCCESS |
| 231 | +Recreated job_runs.my_run |
| 232 | +Files: 1 uploaded, 0 deleted |
| 233 | +Resources: 1 created, 0 changed, 1 deleted, 1 unchanged |
| 234 | + |
| 235 | +>>> print_requests.py --keep //jobs/runs/delete |
| 236 | +{ |
| 237 | + "method": "POST", |
| 238 | + "path": "/api/2.2/jobs/runs/delete", |
| 239 | + "body": { |
| 240 | + "run_id": [MY_RUN_ID_4] |
| 241 | + } |
| 242 | +} |
| 243 | + |
| 244 | +>>> print_requests.py //jobs/run-now |
| 245 | +{ |
| 246 | + "method": "POST", |
| 247 | + "path": "/api/2.2/jobs/run-now", |
| 248 | + "body": { |
| 249 | + "idempotency_token": "[UUID]", |
| 250 | + "job_id": [MY_JOB_ID] |
| 251 | + } |
| 252 | +} |
| 253 | + |
| 254 | +>>> [CLI] bundle destroy --auto-approve |
| 255 | +The following resources will be deleted: |
| 256 | + delete resources.job_runs.my_run |
| 257 | + delete resources.jobs.my_job |
| 258 | + |
| 259 | +All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/job-runs-on-value-change/default |
| 260 | + |
| 261 | +Destroy: 2 deleted |
0 commit comments