watchfor 0.17.2 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/watchfor/client.rb +23 -0
- data/lib/watchfor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c835dd76f2c36039e87bea1a5e1ab4ab75ed149e44bb3c9116b5935510e8057e
|
|
4
|
+
data.tar.gz: 30ee44bba34bc554e84164d37eed0c8d3c7acaf0534f15f1de3aedaf3ddb7f23
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b659336b1c55d9094fbbfc900a9f353904fd4b906c42e7a2a1da5e361118eaf914a0b61dc6ee4be8f2b7e452b5bb8fa84e5478c01a02239201284866e743c4d0
|
|
7
|
+
data.tar.gz: dcade75ce639ac261f5bfe5a65d97405b1f183d35aa8a4b23f8dcf2d9ffe35e399316d1216cfd370784b23380106078e040f6ba700cec3f37da33fd2c6b45384
|
data/README.md
CHANGED
|
@@ -49,6 +49,11 @@ wf.monitors.reset(mon["id"])
|
|
|
49
49
|
# Page integrity: after a deploy, check the pages and accept what that check saw
|
|
50
50
|
wf.monitors.accept_baseline(integrity_monitor_id, fresh: true)
|
|
51
51
|
|
|
52
|
+
# MCP servers: before a release, keep tool drift quiet for 30 minutes (downtime still pages);
|
|
53
|
+
# a drift incident the user confirms was theirs is accepted as an expected change
|
|
54
|
+
wf.monitors.set_expected_change_window(mcp_monitor_id, window: 30, note: "v2.4 release")
|
|
55
|
+
wf.incidents.accept_expected_change(19352, note: "New search tool shipped in v2.4")
|
|
56
|
+
|
|
52
57
|
# Browser checks: try a Playwright script once (nothing saved), then read the result
|
|
53
58
|
run = wf.playwright.test_run(script: script, target: "https://shop.example.com")
|
|
54
59
|
wf.playwright.get_test_run(run["id"]) # status: queued | running | done | error
|
data/lib/watchfor/client.rb
CHANGED
|
@@ -272,6 +272,18 @@ module Watchfor
|
|
|
272
272
|
@c.request("POST", "/monitors/#{id}/baseline",
|
|
273
273
|
body: body, idempotency_key: idempotency_key)
|
|
274
274
|
end
|
|
275
|
+
# MCP monitors: release marker - call it from a deploy pipeline before
|
|
276
|
+
# the rollout. For `window:` minutes (1-60, default 15) the monitor's
|
|
277
|
+
# drift rules (Tool Inventory Changed) are silenced - only those,
|
|
278
|
+
# downtime still pages - and drift incidents opened inside the window
|
|
279
|
+
# resolve within a minute. Markers stack; 12 per hour per monitor (429).
|
|
280
|
+
# Page integrity monitors -> 400 (use accept_baseline(id, fresh: true)
|
|
281
|
+
# after the deploy); no enabled drift rule -> 409.
|
|
282
|
+
def set_expected_change_window(id, window: nil, note: nil, idempotency_key: nil)
|
|
283
|
+
@c.request("POST", "/monitors/#{id}/expected-change",
|
|
284
|
+
query: { window: window }, body: note.nil? ? {} : { note: note },
|
|
285
|
+
idempotency_key: idempotency_key)
|
|
286
|
+
end
|
|
275
287
|
end
|
|
276
288
|
|
|
277
289
|
# Browser checks: run a Playwright script once without saving it.
|
|
@@ -328,6 +340,17 @@ module Watchfor
|
|
|
328
340
|
def mark_maintenance(id, idempotency_key: nil)
|
|
329
341
|
@c.request("POST", "/incidents/#{id}/mark-maintenance", idempotency_key: idempotency_key)
|
|
330
342
|
end
|
|
343
|
+
# Drift incidents only (an MCP monitor's Tool Inventory Changed; others
|
|
344
|
+
# -> 400): mark the change as intended. An open incident is resolved
|
|
345
|
+
# asynchronously ("resolve_requested"; poll #get) and the accept is
|
|
346
|
+
# recorded on the incident and drift timelines and in the Activity log.
|
|
347
|
+
# Accepting again returns the first accept with "already_accepted".
|
|
348
|
+
# `note:` (up to 500 characters) says why. Only call it when the user
|
|
349
|
+
# confirms the change was theirs.
|
|
350
|
+
def accept_expected_change(id, note: nil, idempotency_key: nil)
|
|
351
|
+
@c.request("POST", "/incidents/#{id}/expected-change",
|
|
352
|
+
body: note.nil? ? {} : { note: note }, idempotency_key: idempotency_key)
|
|
353
|
+
end
|
|
331
354
|
# The incident's post-mortem (404 when it has none yet - #update_postmortem creates it).
|
|
332
355
|
def get_postmortem(id) = @c.request("GET", "/incidents/#{id}/postmortem")
|
|
333
356
|
# Create the post-mortem draft on first use, then apply only what is given:
|
data/lib/watchfor/version.rb
CHANGED