watchfor 0.12.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24445c1731afb7a7acc92e91e6e96ddae0c59d837111c2addcd5fed3c0d3727d
4
- data.tar.gz: f38989c598bca87881af765542036fe1b8fb310c7c8c75a64487e4ef22bfa5a9
3
+ metadata.gz: 5710747dad8c121a91b701267655d89cfdfdacdc895a8413f15b7e80ca1998e0
4
+ data.tar.gz: ce69c62e364fdc582a8f2bdab673bfa5f3d144814918730579fd823d260345be
5
5
  SHA512:
6
- metadata.gz: 1e9b130b18719ef0a4a08ba2df4c17b245884222e00cd140a6164a10bc8026098d99cf3db469bfea2af0b44cb98d286ddf5231d62967a2a95d1df75974a7d316
7
- data.tar.gz: bb479462a71d46c19220fbd488c628f69bfce49b07cc6daa5430b6fc1ff3f58cf56598b2fcb3f601f086aeb60e406cc415530880cb206486ae337d95fd5e4b95
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, accept what the newest check saw as the new baseline
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 22 checks from WatchFor's probe fleet against **any public
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")
@@ -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:`. Call it from a deploy pipeline
177
- # a minute after the release; unfetched pages come back in "skipped".
178
- def accept_baseline(id, pages: nil, idempotency_key: nil)
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: pages ? { pages: pages } : {}, idempotency_key: idempotency_key)
187
+ body: body, idempotency_key: idempotency_key)
181
188
  end
182
189
  end
183
190
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchfor
4
- VERSION = "0.12.1"
4
+ VERSION = "0.14.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchfor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WatchFor