Skip to content

Commit e804cc8

Browse files
authored
feat: add Playwright check support (#338)
* feat: add Playwright check support * refactor: rename bundle data attribute to metadata, which is more suitable * chore: update check suite resource for newly nullable attributes * feat: bump Go SDK to v1.18.0 which supports the necessary endpoints for PW checks * chore: change source_archive to the new prebuilt_archive in docs * chore: make examples more complete * chore: update playwright check description * chore: update check suite usage * chore: generate docs
1 parent 30a2509 commit e804cc8

File tree

12 files changed

+1518
-22
lines changed

12 files changed

+1518
-22
lines changed

checkly/helpers.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package checkly
22

33
import (
4+
"crypto/sha256"
5+
"encoding/hex"
6+
"io"
47
"os"
58
"strconv"
69
"time"
@@ -18,3 +21,16 @@ func apiCallTimeout() time.Duration {
1821
}
1922
return 15 * time.Second
2023
}
24+
25+
func checksumSha256(r io.Reader) string {
26+
hash := sha256.New()
27+
28+
_, err := io.Copy(hash, r)
29+
if err != nil {
30+
panic("failed to calculate checksum: " + err.Error())
31+
}
32+
33+
checksum := hex.EncodeToString(hash.Sum(nil))
34+
35+
return checksum
36+
}

checkly/provider.go

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,27 @@ func Provider() *schema.Provider {
3131
},
3232
},
3333
ResourcesMap: map[string]*schema.Resource{
34-
"checkly_check": resourceCheck(),
35-
"checkly_heartbeat": resourceHeartbeat(), // Renamed
36-
"checkly_heartbeat_monitor": resourceHeartbeatMonitor(),
37-
"checkly_tcp_check": resourceTCPCheck(), // Renamed
38-
"checkly_tcp_monitor": resourceTCPMonitor(),
39-
"checkly_check_group": resourceCheckGroup(),
40-
"checkly_snippet": resourceSnippet(),
41-
"checkly_dashboard": resourceDashboard(),
42-
"checkly_maintenance_windows": resourceMaintenanceWindow(),
43-
"checkly_alert_channel": resourceAlertChannel(),
44-
"checkly_trigger_check": resourceTriggerCheck(),
45-
"checkly_trigger_group": resourceTriggerGroup(),
46-
"checkly_environment_variable": resourceEnvironmentVariable(),
47-
"checkly_private_location": resourcePrivateLocation(),
48-
"checkly_client_certificate": resourceClientCertificate(),
49-
"checkly_status_page": resourceStatusPage(),
50-
"checkly_status_page_service": resourceStatusPageService(),
51-
"checkly_url_monitor": resourceURLMonitor(),
52-
"checkly_dns_monitor": resourceDNSMonitor(),
34+
"checkly_check": resourceCheck(),
35+
"checkly_heartbeat": resourceHeartbeat(), // Renamed
36+
"checkly_heartbeat_monitor": resourceHeartbeatMonitor(),
37+
"checkly_tcp_check": resourceTCPCheck(), // Renamed
38+
"checkly_tcp_monitor": resourceTCPMonitor(),
39+
"checkly_check_group": resourceCheckGroup(),
40+
"checkly_snippet": resourceSnippet(),
41+
"checkly_dashboard": resourceDashboard(),
42+
"checkly_maintenance_windows": resourceMaintenanceWindow(),
43+
"checkly_alert_channel": resourceAlertChannel(),
44+
"checkly_trigger_check": resourceTriggerCheck(),
45+
"checkly_trigger_group": resourceTriggerGroup(),
46+
"checkly_environment_variable": resourceEnvironmentVariable(),
47+
"checkly_private_location": resourcePrivateLocation(),
48+
"checkly_client_certificate": resourceClientCertificate(),
49+
"checkly_status_page": resourceStatusPage(),
50+
"checkly_status_page_service": resourceStatusPageService(),
51+
"checkly_url_monitor": resourceURLMonitor(),
52+
"checkly_dns_monitor": resourceDNSMonitor(),
53+
"checkly_playwright_check_suite": resourcePlaywrightCheckSuite(),
54+
"checkly_playwright_code_bundle": resourcePlaywrightCodeBundle(),
5355
},
5456
DataSourcesMap: map[string]*schema.Resource{
5557
"checkly_static_ips": dataSourceStaticIPs(),

0 commit comments

Comments
 (0)