watchfor 0.13.0 → 0.14.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 +15 -3
- data/lib/watchfor/client.rb +11 -4
- 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: 5710747dad8c121a91b701267655d89cfdfdacdc895a8413f15b7e80ca1998e0
|
|
4
|
+
data.tar.gz: ce69c62e364fdc582a8f2bdab673bfa5f3d144814918730579fd823d260345be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f05f3baa7d1b773dcc32d25641f633c7577f2711139e4af7827d7b11e53e22e0cb24f3d21ce692013386cf0650030b24e02f34df1566f328ec56af471d09a289
|
|
7
|
+
data.tar.gz: c2285f93fe30565356cc821bb60cb096869afa46246ce70e4cec05ed3689a3c66a73ad23c43689a7b58fd3a858a4d0a7e241b926e46a27e6b07420dcdc7cb910
|
data/README.md
CHANGED
|
@@ -40,8 +40,8 @@ wf.incidents.exclude(19351, reason: "Probe-side DNS hiccup")
|
|
|
40
40
|
# Irreversible: wipe a monitor's checks and incidents; uptime restarts "since reset"
|
|
41
41
|
wf.monitors.reset(mon["id"])
|
|
42
42
|
|
|
43
|
-
# Page integrity: after a deploy,
|
|
44
|
-
wf.monitors.accept_baseline(integrity_monitor_id)
|
|
43
|
+
# Page integrity: after a deploy, check the pages and accept what that check saw
|
|
44
|
+
wf.monitors.accept_baseline(integrity_monitor_id, fresh: true)
|
|
45
45
|
|
|
46
46
|
# Browser checks: try a Playwright script once (nothing saved), then read the result
|
|
47
47
|
run = wf.playwright.test_run(script: script, target: "https://shop.example.com")
|
|
@@ -63,7 +63,7 @@ wf.contact_groups.delete("<group-id>", force: true)
|
|
|
63
63
|
|
|
64
64
|
### Live diagnostics
|
|
65
65
|
|
|
66
|
-
Run any of
|
|
66
|
+
Run any of 24 checks from WatchFor's probe fleet against **any public
|
|
67
67
|
target**, monitored or not — this measures right now, rather than reading
|
|
68
68
|
what WatchFor recorded:
|
|
69
69
|
|
|
@@ -78,6 +78,18 @@ dns = wf.diagnostics.run("dns-lookup", "example.com",
|
|
|
78
78
|
puts "finding: #{dns['error']}" unless dns["success"]
|
|
79
79
|
puts "runs left this hour: #{dns['remaining']}"
|
|
80
80
|
|
|
81
|
+
# Graded checks (tls-grade, http-headers, cwv-check, mcp-check, email-health,
|
|
82
|
+
# mail-server-check, cdn-check, smart-audit, dns-health) also return the
|
|
83
|
+
# dashboard's WatchFor Grade: letter, rubric id and what holds it down
|
|
84
|
+
headers = wf.diagnostics.run("http-headers", "https://example.com")
|
|
85
|
+
grade = headers["grade"] || {}
|
|
86
|
+
if grade["letter"]
|
|
87
|
+
puts "grade #{grade['letter']} (#{grade['rubric']})"
|
|
88
|
+
grade["capped_by"].each { |c| puts " max #{c['cap']}: #{c['title']} — fix: #{c['fix']}" }
|
|
89
|
+
else
|
|
90
|
+
puts "not graded: #{grade['not_graded_reason']}"
|
|
91
|
+
end
|
|
92
|
+
|
|
81
93
|
# The whole picture in one call: DNS + propagation + TLS + HTTP + ping
|
|
82
94
|
# from up to 3 regions, aggregated into one verdict
|
|
83
95
|
report = wf.diagnostics.diagnose_target("example.com")
|
data/lib/watchfor/client.rb
CHANGED
|
@@ -173,11 +173,18 @@ module Watchfor
|
|
|
173
173
|
# Page integrity monitors: the accepted baseline of every watched page.
|
|
174
174
|
def baseline(id) = @c.request("GET", "/monitors/#{id}/baseline")
|
|
175
175
|
# Page integrity monitors: accept what the newest check saw as the new
|
|
176
|
-
# baseline — all pages, or only `pages:`.
|
|
177
|
-
#
|
|
178
|
-
|
|
176
|
+
# baseline — all pages, or only `pages:`. Open integrity incidents
|
|
177
|
+
# resolve at once when nothing else differs ("incidents_resolved").
|
|
178
|
+
# From a deploy pipeline pass `fresh: true`: the pages are checked first
|
|
179
|
+
# and that check is accepted ("status" "pending" = still running, it
|
|
180
|
+
# finishes on its own — see baseline(id)["fresh_accept"]); unfetched
|
|
181
|
+
# pages come back in "skipped".
|
|
182
|
+
def accept_baseline(id, pages: nil, idempotency_key: nil, fresh: false)
|
|
183
|
+
body = {}
|
|
184
|
+
body[:pages] = pages if pages
|
|
185
|
+
body[:fresh] = true if fresh
|
|
179
186
|
@c.request("POST", "/monitors/#{id}/baseline",
|
|
180
|
-
body:
|
|
187
|
+
body: body, idempotency_key: idempotency_key)
|
|
181
188
|
end
|
|
182
189
|
end
|
|
183
190
|
|
data/lib/watchfor/version.rb
CHANGED