open-pstack 0.9.174 → 0.9.175
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.
- package/package.json +1 -1
- package/plugin/.antigravity-plugin/plugin.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.github/plugin/plugin.json +1 -1
- package/plugin/.grok-plugin/plugin.json +1 -1
- package/plugin/.muse-plugin/plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/pi/index.ts +3 -2
- package/plugin/pi/prompt.ts +8 -3
- package/plugin/skills/poteto-mode/playbooks/worktree-cleanup.md +1 -1
- package/plugin/skills/poteto-mode/scripts/.prettierignore +3 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/cloud-reader.test.ts +21 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/cloud-reader.ts +7 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +6 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/github.port.test.ts +33 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/github.ts +25 -23
- package/plugin/skills/poteto-mode/scripts/watch-pr/head-checks.ts +47 -1
- package/plugin/skills/poteto-mode/scripts/watch-pr/policy.port.test.ts +158 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/fixtures/grafana-139602-cancelled-suites-beside-green.json +921 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/fixtures/grafana-139606-approval-gated.json +82 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/fixtures/grafana-139612-cancelled-check-beside-green.json +174 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/fixtures/octocat-hello-world-34-no-checks.json +42 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/gh.ts +144 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/harness.ts +172 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/heads.json +73 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/record.ts +410 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/watch.ts +72 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay.port.test.ts +264 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/types.ts +2 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/workflow-runs.ts +58 -21
- package/plugin/skills/poteto-mode/scripts/worktree-audit.mjs +75 -6
- package/plugin/skills/setup-pstack/scripts/read-sheet.sh +6 -2
- package/plugin/vibe/plugin.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pr": "grafana/grafana#139606",
|
|
3
|
+
"head": "6750dab797744e09f02ff1563e647fd7474b3c1f",
|
|
4
|
+
"recorded": "2026-12-03",
|
|
5
|
+
"evidence": {
|
|
6
|
+
"pullRequest": {"state":"OPEN","isDraft":false,"mergeable":"MERGEABLE","mergeStateStatus":"BLOCKED","reviewDecision":"REVIEW_REQUIRED"},
|
|
7
|
+
"headRollup": "PENDING",
|
|
8
|
+
"unresolvedThreads": 0,
|
|
9
|
+
"checks": {"pass":4,"pending":2,"skipping":1},
|
|
10
|
+
"checksNotPassing": ["pending PENDING: policy-bot","pending PENDING: policy-bot: main"],
|
|
11
|
+
"suites": {
|
|
12
|
+
"cursor neutral, with check runs": 1,
|
|
13
|
+
"github-actions action_required, no check runs": 35,
|
|
14
|
+
"github-actions startup_failure, no check runs": 1,
|
|
15
|
+
"semgrep-code-grafana success, with check runs": 1,
|
|
16
|
+
"socket-security success, with check runs": 1
|
|
17
|
+
},
|
|
18
|
+
"workflowsWithACancelledOrStartupFailedRun": ["PR automation (pull_request_target): startup_failure"]
|
|
19
|
+
},
|
|
20
|
+
"calls": {
|
|
21
|
+
"graphql PullRequestFacts owner=grafana repo=grafana pr=139606": {
|
|
22
|
+
"code": 0,
|
|
23
|
+
"json": {
|
|
24
|
+
"data": {
|
|
25
|
+
"repository": {
|
|
26
|
+
"pullRequest": {
|
|
27
|
+
"mergeable": "MERGEABLE",
|
|
28
|
+
"mergeStateStatus": "BLOCKED",
|
|
29
|
+
"reviewDecision": "REVIEW_REQUIRED",
|
|
30
|
+
"headRefOid": "6750dab797744e09f02ff1563e647fd7474b3c1f",
|
|
31
|
+
"headRefName": "annotations-description-schema",
|
|
32
|
+
"baseRefName": "main",
|
|
33
|
+
"baseRef": {"target":{"oid":"a4a84234f199a107c6a9d5aa63eec0315774f46c"}},
|
|
34
|
+
"state": "OPEN",
|
|
35
|
+
"mergedAt": null,
|
|
36
|
+
"isDraft": false
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"graphql ReviewThreads owner=grafana repo=grafana pr=139606": {
|
|
43
|
+
"code": 0,
|
|
44
|
+
"json": {
|
|
45
|
+
"data": {
|
|
46
|
+
"repository": {
|
|
47
|
+
"pullRequest": {
|
|
48
|
+
"reviewThreads": {
|
|
49
|
+
"pageInfo": {"hasNextPage":false,"endCursor":"Y3Vyc29yOnYyOpK0MjAyNi0xMi0wM1QxMDo1OTo0NlrOvxyQOQ=="},
|
|
50
|
+
"nodes": [
|
|
51
|
+
{
|
|
52
|
+
"id": "PRRT_kwDOAOaWjc6_HJA5",
|
|
53
|
+
"isResolved": true,
|
|
54
|
+
"comments": {
|
|
55
|
+
"nodes": [
|
|
56
|
+
{"body":"","createdAt":"2026-12-03T10:59:46Z","path":"apps/dashboard/pkg/migration/conversion/v2alpha1_to_v1.go","line":null,"author":{"login":"cursor"}},
|
|
57
|
+
{"body":"","createdAt":"2026-12-03T11:16:29Z","path":"apps/dashboard/pkg/migration/conversion/v2alpha1_to_v1.go","line":null,"author":{"login":"someone"}}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"pr checks 139606 --repo grafana/grafana --json name,state,description,link,workflow,bucket": {
|
|
69
|
+
"code": 0,
|
|
70
|
+
"json": [
|
|
71
|
+
{"name":"Cursor Bugbot","state":"NEUTRAL","bucket":"skipping","workflow":""},
|
|
72
|
+
{"name":"Socket Security: Pull Request Alerts","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
73
|
+
{"name":"Socket Security: Project Report","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
74
|
+
{"name":"semgrep-cloud-platform/scan","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
75
|
+
{"name":"policy-bot","state":"PENDING","bucket":"pending","workflow":""},
|
|
76
|
+
{"name":"policy-bot: main","state":"PENDING","bucket":"pending","workflow":""},
|
|
77
|
+
{"name":"license/cla","state":"SUCCESS","bucket":"pass","workflow":""}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"graphql PrCommitStatuses owner=grafana repo=grafana pr=139606": {"code":0,"json":{"data":{"repository":{"pullRequest":{"commits":{"nodes":[{"commit":{"oid":"6750dab797744e09f02ff1563e647fd7474b3c1f","statusCheckRollup":{"state":"PENDING"}}}]}}}}}}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pr": "grafana/grafana#139612",
|
|
3
|
+
"head": "8c63a54b5334bc97775bbfcfe858424434ff2d1f",
|
|
4
|
+
"recorded": "2026-12-03",
|
|
5
|
+
"evidence": {
|
|
6
|
+
"pullRequest": {"state":"OPEN","isDraft":false,"mergeable":"MERGEABLE","mergeStateStatus":"BLOCKED","reviewDecision":"REVIEW_REQUIRED"},
|
|
7
|
+
"headRollup": "SUCCESS",
|
|
8
|
+
"unresolvedThreads": 0,
|
|
9
|
+
"checks": {"cancel":1,"pass":90,"skipping":24},
|
|
10
|
+
"checksNotPassing": ["cancel CANCELLED: Bundle size / Build ${{ matrix.target }} frontend"],
|
|
11
|
+
"suites": {
|
|
12
|
+
"cursor success, with check runs": 1,
|
|
13
|
+
"github-actions cancelled, with check runs": 2,
|
|
14
|
+
"github-actions skipped, with check runs": 2,
|
|
15
|
+
"github-actions startup_failure, no check runs": 5,
|
|
16
|
+
"github-actions success, with check runs": 26,
|
|
17
|
+
"github-advanced-security neutral, with check runs": 1,
|
|
18
|
+
"semgrep-code-grafana success, with check runs": 1,
|
|
19
|
+
"socket-security success, with check runs": 1
|
|
20
|
+
},
|
|
21
|
+
"workflowsWithACancelledOrStartupFailedRun": [
|
|
22
|
+
"Auto-milestone (pull_request_target): startup_failure, then startup_failure",
|
|
23
|
+
"Bundle size (pull_request): cancelled, then success",
|
|
24
|
+
"External PR Notify Trigger (pull_request_target): startup_failure, then startup_failure",
|
|
25
|
+
"PR automation (pull_request_target): startup_failure",
|
|
26
|
+
"PR build Docker image (pull_request): cancelled, then success"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"calls": {
|
|
30
|
+
"graphql PullRequestFacts owner=grafana repo=grafana pr=139612": {
|
|
31
|
+
"code": 0,
|
|
32
|
+
"json": {
|
|
33
|
+
"data": {
|
|
34
|
+
"repository": {
|
|
35
|
+
"pullRequest": {
|
|
36
|
+
"mergeable": "MERGEABLE",
|
|
37
|
+
"mergeStateStatus": "BLOCKED",
|
|
38
|
+
"reviewDecision": "REVIEW_REQUIRED",
|
|
39
|
+
"headRefOid": "8c63a54b5334bc97775bbfcfe858424434ff2d1f",
|
|
40
|
+
"headRefName": "uplot-invalid-locale",
|
|
41
|
+
"baseRefName": "main",
|
|
42
|
+
"baseRef": {"target":{"oid":"a4a84234f199a107c6a9d5aa63eec0315774f46c"}},
|
|
43
|
+
"state": "OPEN",
|
|
44
|
+
"mergedAt": null,
|
|
45
|
+
"isDraft": false
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"graphql ReviewThreads owner=grafana repo=grafana pr=139612": {"code":0,"json":{"data":{"repository":{"pullRequest":{"reviewThreads":{"pageInfo":{"hasNextPage":false,"endCursor":null},"nodes":[]}}}}}},
|
|
52
|
+
"pr checks 139612 --repo grafana/grafana --json name,state,description,link,workflow,bucket": {
|
|
53
|
+
"code": 0,
|
|
54
|
+
"json": [
|
|
55
|
+
{"name":"Run Meticulous tests","state":"SKIPPED","bucket":"skipping","workflow":"PR build Docker image"},
|
|
56
|
+
{"name":"Push PR Docker image","state":"SKIPPED","bucket":"skipping","workflow":"PR build Docker image"},
|
|
57
|
+
{"name":"Playwright test report","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
58
|
+
{"name":"Report Playwright benchmarks","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
59
|
+
{"name":"build / variants (targz) / distroless-slim","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
60
|
+
{"name":"build / variants (targz) / ubuntu-slim","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
61
|
+
{"name":"build / variants (targz) / ubuntu","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
62
|
+
{"name":"build / variants (targz) / alpine","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
63
|
+
{"name":"build / variants (targz) / alpine-slim","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
64
|
+
{"name":"build / variants (targz) / distroless","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
65
|
+
{"name":"build / source tarball","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
66
|
+
{"name":"Unit tests (8 / 8)","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
67
|
+
{"name":"Unit tests (7 / 8)","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
68
|
+
{"name":"Unit tests (5 / 8)","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
69
|
+
{"name":"Unit tests (3 / 8)","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
70
|
+
{"name":"Unit tests (6 / 8)","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
71
|
+
{"name":"Unit tests (4 / 8)","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
72
|
+
{"name":"Unit tests (1 / 8)","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
73
|
+
{"name":"Unit tests (2 / 8)","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
74
|
+
{"name":"Playwright E2E tests (8/8)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
75
|
+
{"name":"Playwright E2E tests (5/8)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
76
|
+
{"name":"Playwright E2E tests (1/8)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
77
|
+
{"name":"Playwright E2E tests (4/8)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
78
|
+
{"name":"Playwright E2E tests (7/8)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
79
|
+
{"name":"Playwright E2E tests (2/8)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
80
|
+
{"name":"Playwright E2E tests (3/8)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
81
|
+
{"name":"Playwright E2E tests (6/8)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
82
|
+
{"name":"Diagnostics e2e (on-prem) / Download diagnostics e2e (on-prem)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
83
|
+
{"name":"Unit tests (${{ matrix.shard }} / ${{ matrix.total }})","state":"SKIPPED","bucket":"skipping","workflow":"Frontend tests"},
|
|
84
|
+
{"name":"Check bundle size impact","state":"SUCCESS","bucket":"pass","workflow":"Bundle size"},
|
|
85
|
+
{"name":"Report breaking changes in PR comment","state":"SKIPPED","bucket":"skipping","workflow":"Levitate / Detect breaking changes in PR"},
|
|
86
|
+
{"name":"Publish metrics","state":"SKIPPED","bucket":"skipping","workflow":"End-to-end tests"},
|
|
87
|
+
{"name":"Detect breaking changes between PR and base","state":"SUCCESS","bucket":"pass","workflow":"Levitate / Detect breaking changes in PR"},
|
|
88
|
+
{"name":"Build pr frontend","state":"SUCCESS","bucket":"pass","workflow":"Bundle size"},
|
|
89
|
+
{"name":"Build base frontend","state":"SUCCESS","bucket":"pass","workflow":"Bundle size"},
|
|
90
|
+
{"name":"build / backend (linux-amd64)","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
91
|
+
{"name":"build / frontend","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
92
|
+
{"name":"Build frontend","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
93
|
+
{"name":"Build backend","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
94
|
+
{"name":"Detect frontend changes","state":"SUCCESS","bucket":"pass","workflow":"Bundle size"},
|
|
95
|
+
{"name":"Generate golden files","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
96
|
+
{"name":"Packages unit tests","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
97
|
+
{"name":"Decoupled plugin tests","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
98
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"PR build Docker image"},
|
|
99
|
+
{"name":"Rspack plugin tests","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
100
|
+
{"name":"Run Storybook a11y tests (visual_refresh_dark theme)","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
101
|
+
{"name":"Run Storybook a11y tests (dark theme)","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
102
|
+
{"name":"Run Storybook a11y tests (tritanopia_light theme)","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
103
|
+
{"name":"Run Storybook a11y tests (deut_prot_light theme)","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
104
|
+
{"name":"Run Storybook a11y tests (deut_prot_dark theme)","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
105
|
+
{"name":"Run Storybook a11y tests (tritanopia_dark theme)","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
106
|
+
{"name":"Run Storybook a11y tests (light theme)","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
107
|
+
{"name":"Run Storybook a11y tests (visual_refresh_light theme)","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
108
|
+
{"name":"Run zizmor / Send zizmor metrics to Prometheus via Grafana Bench","state":"SKIPPED","bucket":"skipping","workflow":"zizmor GitHub Actions static analysis"},
|
|
109
|
+
{"name":"Run zizmor / Delete branch with dangerous-trigger vulnerability","state":"SKIPPED","bucket":"skipping","workflow":"zizmor GitHub Actions static analysis"},
|
|
110
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"Frontend tests"},
|
|
111
|
+
{"name":"zizmor","state":"NEUTRAL","bucket":"skipping","workflow":""},
|
|
112
|
+
{"name":"Lint","state":"SUCCESS","bucket":"pass","workflow":"Lint Frontend"},
|
|
113
|
+
{"name":"Typecheck","state":"SUCCESS","bucket":"pass","workflow":"Lint Frontend"},
|
|
114
|
+
{"name":"Check circular dependencies","state":"SUCCESS","bucket":"pass","workflow":"Lint Frontend"},
|
|
115
|
+
{"name":"Verify packed frontend packages","state":"SUCCESS","bucket":"pass","workflow":"Lint Frontend"},
|
|
116
|
+
{"name":"Verify OpenAPI specs","state":"SUCCESS","bucket":"pass","workflow":"Lint Frontend"},
|
|
117
|
+
{"name":"dashboard-schema-v2-e2e","state":"SUCCESS","bucket":"pass","workflow":"Run dashboard schema v2 e2e"},
|
|
118
|
+
{"name":"Validate frontend dependencies","state":"SUCCESS","bucket":"pass","workflow":"Lint Frontend"},
|
|
119
|
+
{"name":"Verify Storybook (Playwright)","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
120
|
+
{"name":"lint-go","state":"SKIPPED","bucket":"skipping","workflow":"golangci-lint"},
|
|
121
|
+
{"name":"Feature toggles documentation is in sync with source","state":"SKIPPED","bucket":"skipping","workflow":"Feature toggles CI"},
|
|
122
|
+
{"name":"go-fmt","state":"SKIPPED","bucket":"skipping","workflow":"golangci-lint"},
|
|
123
|
+
{"name":"TruffleHog Secret Scan / Send TruffleHog metrics to Prometheus via Grafana Bench","state":"SKIPPED","bucket":"skipping","workflow":"TruffleHog Secret Scanning"},
|
|
124
|
+
{"name":"Grafana (${{ matrix.shard }})","state":"SKIPPED","bucket":"skipping","workflow":"Backend Unit Tests"},
|
|
125
|
+
{"name":"Grafana Enterprise (${{ matrix.shard }})","state":"SKIPPED","bucket":"skipping","workflow":"Backend Unit Tests"},
|
|
126
|
+
{"name":"codeowners-validator","state":"SUCCESS","bucket":"pass","workflow":"Codeowners Validator"},
|
|
127
|
+
{"name":"Validate Backend Configs","state":"SKIPPED","bucket":"skipping","workflow":"Backend Code Checks"},
|
|
128
|
+
{"name":"Build Base packages artifacts","state":"SUCCESS","bucket":"pass","workflow":"Levitate / Detect breaking changes in PR"},
|
|
129
|
+
{"name":"Run zizmor / Generate and upload zizmor results 🌈","state":"SUCCESS","bucket":"pass","workflow":"zizmor GitHub Actions static analysis"},
|
|
130
|
+
{"name":"Verify committed API specs match","state":"SKIPPED","bucket":"skipping","workflow":"Swagger generated code"},
|
|
131
|
+
{"name":"Build PR packages artifacts","state":"SUCCESS","bucket":"pass","workflow":"Levitate / Detect breaking changes in PR"},
|
|
132
|
+
{"name":"lint-knip","state":"SKIPPED","bucket":"skipping","workflow":"Lint Frontend"},
|
|
133
|
+
{"name":"check-endpoint-migration","state":"SUCCESS","bucket":"pass","workflow":"Endpoint Migration Feature Toggle Check"},
|
|
134
|
+
{"name":"Check Wire Changes","state":"SKIPPED","bucket":"skipping","workflow":"Go Workspace Check"},
|
|
135
|
+
{"name":"Go Workspace Check","state":"SKIPPED","bucket":"skipping","workflow":"Go Workspace Check"},
|
|
136
|
+
{"name":"TruffleHog Secret Scan / trufflehog-scan","state":"SUCCESS","bucket":"pass","workflow":"TruffleHog Secret Scanning"},
|
|
137
|
+
{"name":"build / variants (targz)","state":"SKIPPED","bucket":"skipping","workflow":"PR build Docker image"},
|
|
138
|
+
{"name":"Check whether there are things to scan","state":"SUCCESS","bucket":"pass","workflow":"zizmor GitHub Actions static analysis"},
|
|
139
|
+
{"name":"verify-i18n / verify-i18n","state":"SUCCESS","bucket":"pass","workflow":"Verify i18n"},
|
|
140
|
+
{"name":"main","state":"SUCCESS","bucket":"pass","workflow":"PR Checks"},
|
|
141
|
+
{"name":"Build ${{ matrix.target }} frontend","state":"CANCELLED","bucket":"cancel","workflow":"Bundle size"},
|
|
142
|
+
{"name":"Run Trufflehog","state":"SUCCESS","bucket":"pass","workflow":"Trufflehog"},
|
|
143
|
+
{"name":"Verify API clients","state":"SUCCESS","bucket":"pass","workflow":"Lint Frontend"},
|
|
144
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"End-to-end tests"},
|
|
145
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"Feature toggles CI"},
|
|
146
|
+
{"name":"check-separation","state":"SUCCESS","bucket":"pass","workflow":"Unified Storage Compatibility"},
|
|
147
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"Backend Unit Tests"},
|
|
148
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"Run Storybook a11y tests"},
|
|
149
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"golangci-lint"},
|
|
150
|
+
{"name":"Assistant requires two approvals","state":"SKIPPED","bucket":"skipping","workflow":"Assistant approvals"},
|
|
151
|
+
{"name":"reject-gh-secrets","state":"SUCCESS","bucket":"pass","workflow":"Reject GitHub secrets"},
|
|
152
|
+
{"name":"Shellcheck scripts","state":"SUCCESS","bucket":"pass","workflow":"Shellcheck"},
|
|
153
|
+
{"name":"dispatch-job-fork","state":"SUCCESS","bucket":"pass","workflow":"Dispatch check for patch conflicts"},
|
|
154
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"Backend Code Checks"},
|
|
155
|
+
{"name":"dispatch-job","state":"SKIPPED","bucket":"skipping","workflow":"Dispatch check for patch conflicts"},
|
|
156
|
+
{"name":"check-separation","state":"SUCCESS","bucket":"pass","workflow":"MT Service Compatibility"},
|
|
157
|
+
{"name":"detect-changes","state":"SUCCESS","bucket":"pass","workflow":"Endpoint Migration Feature Toggle Check"},
|
|
158
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"Swagger generated code"},
|
|
159
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"Lint Frontend"},
|
|
160
|
+
{"name":"Deploy Storybook preview","state":"SKIPPED","bucket":"skipping","workflow":"Deploy Storybook preview"},
|
|
161
|
+
{"name":"Detect whether code changed","state":"SUCCESS","bucket":"pass","workflow":"Go Workspace Check"},
|
|
162
|
+
{"name":"Verify API clients (enterprise)","state":"SKIPPED","bucket":"skipping","workflow":"Lint Frontend"},
|
|
163
|
+
{"name":"Socket Security: Pull Request Alerts","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
164
|
+
{"name":"Cursor Bugbot","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
165
|
+
{"name":"Socket Security: Project Report","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
166
|
+
{"name":"semgrep-cloud-platform/scan","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
167
|
+
{"name":"license/cla","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
168
|
+
{"name":"policy-bot","state":"SUCCESS","bucket":"pass","workflow":""},
|
|
169
|
+
{"name":"policy-bot: main","state":"SUCCESS","bucket":"pass","workflow":""}
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
"graphql PrCommitStatuses owner=grafana repo=grafana pr=139612": {"code":0,"json":{"data":{"repository":{"pullRequest":{"commits":{"nodes":[{"commit":{"oid":"8c63a54b5334bc97775bbfcfe858424434ff2d1f","statusCheckRollup":{"state":"SUCCESS"}}}]}}}}}}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pr": "octocat/Hello-World#34",
|
|
3
|
+
"head": "466b43dba94438a264452fea015a95c0217fb74f",
|
|
4
|
+
"recorded": "2026-12-03",
|
|
5
|
+
"evidence": {
|
|
6
|
+
"pullRequest": {"state":"OPEN","isDraft":false,"mergeable":"MERGEABLE","mergeStateStatus":"CLEAN","reviewDecision":null},
|
|
7
|
+
"headRollup": null,
|
|
8
|
+
"unresolvedThreads": 0,
|
|
9
|
+
"checks": "no checks reported on the 'master' branch",
|
|
10
|
+
"checksNotPassing": [],
|
|
11
|
+
"suites": {},
|
|
12
|
+
"workflowsWithACancelledOrStartupFailedRun": []
|
|
13
|
+
},
|
|
14
|
+
"calls": {
|
|
15
|
+
"graphql PullRequestFacts owner=octocat repo=Hello-World pr=34": {
|
|
16
|
+
"code": 0,
|
|
17
|
+
"json": {
|
|
18
|
+
"data": {
|
|
19
|
+
"repository": {
|
|
20
|
+
"pullRequest": {
|
|
21
|
+
"mergeable": "MERGEABLE",
|
|
22
|
+
"mergeStateStatus": "CLEAN",
|
|
23
|
+
"reviewDecision": null,
|
|
24
|
+
"headRefOid": "466b43dba94438a264452fea015a95c0217fb74f",
|
|
25
|
+
"headRefName": "master",
|
|
26
|
+
"baseRefName": "master",
|
|
27
|
+
"baseRef": {"target":{"oid":"7fd1a60b01f91b314f59955a4e4d4e80d8edf11d"}},
|
|
28
|
+
"state": "OPEN",
|
|
29
|
+
"mergedAt": null,
|
|
30
|
+
"isDraft": false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"graphql ReviewThreads owner=octocat repo=Hello-World pr=34": {"code":0,"json":{"data":{"repository":{"pullRequest":{"reviewThreads":{"pageInfo":{"hasNextPage":false,"endCursor":null},"nodes":[]}}}}}},
|
|
37
|
+
"pr checks 34 --repo octocat/Hello-World --json name,state,description,link,workflow,bucket": {"code":1,"stderr":"no checks reported on the 'master' branch\n"},
|
|
38
|
+
"graphql PrCheckRollup owner=octocat repo=Hello-World pr=34": {"code":0,"json":{"data":{"repository":{"pullRequest":{"commits":{"nodes":[{"commit":{"statusCheckRollup":null}}]}}}}}},
|
|
39
|
+
"api --paginate --slurp repos/octocat/Hello-World/commits/466b43dba94438a264452fea015a95c0217fb74f/check-suites?per_page=100": {"code":0,"json":[{"check_suites":[]}]},
|
|
40
|
+
"graphql PrCommitStatuses owner=octocat repo=Hello-World pr=34": {"code":0,"json":{"data":{"repository":{"pullRequest":{"commits":{"nodes":[{"commit":{"oid":"466b43dba94438a264452fea015a95c0217fb74f","statusCheckRollup":null}}]}}}}}}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// A stand-in for `gh` that watch-pr's GhGitHubReader spawns from PATH.
|
|
2
|
+
//
|
|
3
|
+
// Replay ({ fixture }): answers each request from the fixture and exits 1 for
|
|
4
|
+
// a request the fixture does not hold, so a changed read fails the replay and
|
|
5
|
+
// never reaches GitHub.
|
|
6
|
+
//
|
|
7
|
+
// Record ({ gh, log }): passes a read through to the real gh and appends the
|
|
8
|
+
// answer to the log. It refuses every request that is not one of READS, so a
|
|
9
|
+
// recording cannot change anything on GitHub.
|
|
10
|
+
import { spawnSync } from "node:child_process";
|
|
11
|
+
import { appendFileSync, readFileSync } from "node:fs";
|
|
12
|
+
|
|
13
|
+
/** Replay a fixture, or record the real gh's answers into a log. */
|
|
14
|
+
export type Transport =
|
|
15
|
+
| { readonly fixture: string }
|
|
16
|
+
| { readonly gh: string; readonly log: string };
|
|
17
|
+
|
|
18
|
+
export interface RecordedCall {
|
|
19
|
+
readonly code: number;
|
|
20
|
+
/** The parsed standard output, when it was JSON. */
|
|
21
|
+
readonly json?: unknown;
|
|
22
|
+
readonly stdout?: string;
|
|
23
|
+
readonly stderr?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Fixture {
|
|
26
|
+
readonly pr: string;
|
|
27
|
+
readonly head: string;
|
|
28
|
+
readonly recorded: string;
|
|
29
|
+
/** Each answer, under its request's name (see requestName). */
|
|
30
|
+
readonly calls: Readonly<Record<string, RecordedCall>>;
|
|
31
|
+
}
|
|
32
|
+
export interface LoggedCall {
|
|
33
|
+
readonly request: string;
|
|
34
|
+
readonly code: number;
|
|
35
|
+
readonly stdout: string;
|
|
36
|
+
readonly stderr: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// The flags of `gh api` that send a body or pick a method. A REST read
|
|
40
|
+
// carries none of them. A GraphQL read carries `-f` and `-F` variables, and
|
|
41
|
+
// gh sends every GraphQL request as a POST, so the document tells a GraphQL
|
|
42
|
+
// read from a write.
|
|
43
|
+
const WRITE_FLAGS = /^(?:-X|--method|-f|-F|--field|--raw-field|--input)(?:=|$)/;
|
|
44
|
+
const REST_READS =
|
|
45
|
+
/^repos\/[^/]+\/[^/]+\/(?:commits\/[0-9a-f]+\/check-suites|actions\/runs)\?/;
|
|
46
|
+
|
|
47
|
+
// What watch-pr reads, and the only requests a recording passes on.
|
|
48
|
+
const READS: readonly {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly test: (args: readonly string[]) => boolean;
|
|
51
|
+
}[] = [
|
|
52
|
+
{
|
|
53
|
+
name: "a GraphQL query",
|
|
54
|
+
test: (args) =>
|
|
55
|
+
args[0] === "api" && args[1] === "graphql" && operation(args) !== null,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "a REST GET of check suites or workflow runs",
|
|
59
|
+
test: (args) =>
|
|
60
|
+
args[0] === "api" &&
|
|
61
|
+
args[1] !== "graphql" &&
|
|
62
|
+
!args.some((arg) => WRITE_FLAGS.test(arg)) &&
|
|
63
|
+
REST_READS.test(args.at(-1) ?? ""),
|
|
64
|
+
},
|
|
65
|
+
...["pr checks", "pr view", "pr list", "repo view"].map((command) => ({
|
|
66
|
+
name: `gh ${command}`,
|
|
67
|
+
test: (args: readonly string[]) => `${args[0]} ${args[1]}` === command,
|
|
68
|
+
})),
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
// The name of the one `query` operation a GraphQL request sends, or null for
|
|
72
|
+
// a mutation, a subscription, or a document that is not a single query.
|
|
73
|
+
function operation(args: readonly string[]): string | null {
|
|
74
|
+
const documents = args.filter((arg) => arg.startsWith("query="));
|
|
75
|
+
if (documents.length !== 1) return null;
|
|
76
|
+
const document = documents[0].slice("query=".length);
|
|
77
|
+
if (/\b(?:mutation|subscription)\b/.test(document)) return null;
|
|
78
|
+
return /^\s*query\s+(\w+)\b/.exec(document)?.[1] ?? null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// One request's name in a fixture. A GraphQL request is named by its
|
|
82
|
+
// operation and variables, not its document, so a fixture stays small and a
|
|
83
|
+
// reworded query still replays. A query that asks for a field the fixture
|
|
84
|
+
// lacks fails watch-pr's own parse, which is the signal to record again.
|
|
85
|
+
export function requestName(args: readonly string[]): string {
|
|
86
|
+
if (args[0] !== "api" || args[1] !== "graphql") return args.join(" ");
|
|
87
|
+
const variables = args.filter(
|
|
88
|
+
(arg, index) =>
|
|
89
|
+
/^-[fF]$/.test(args[index - 1] ?? "") && !arg.startsWith("query=")
|
|
90
|
+
);
|
|
91
|
+
return ["graphql", operation(args) ?? "?", ...variables].join(" ");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const isRead = (args: readonly string[]): boolean =>
|
|
95
|
+
READS.some((read) => read.test(args));
|
|
96
|
+
|
|
97
|
+
function replay(args: readonly string[], fixture: string): number {
|
|
98
|
+
const { calls } = JSON.parse(readFileSync(fixture, "utf8")) as Fixture;
|
|
99
|
+
const request = requestName(args);
|
|
100
|
+
if (!Object.hasOwn(calls, request)) {
|
|
101
|
+
console.error(`replay: the fixture holds no answer for: ${request}`);
|
|
102
|
+
return 1;
|
|
103
|
+
}
|
|
104
|
+
const { code, json, stdout = "", stderr = "" } = calls[request];
|
|
105
|
+
process.stdout.write(
|
|
106
|
+
json === undefined ? stdout : `${JSON.stringify(json)}\n`
|
|
107
|
+
);
|
|
108
|
+
process.stderr.write(stderr);
|
|
109
|
+
return code;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function record(args: readonly string[], gh: string, log: string): number {
|
|
113
|
+
if (!isRead(args)) {
|
|
114
|
+
console.error(
|
|
115
|
+
`record: refused, not one of watch-pr's reads (${READS.map((read) => read.name).join(", ")}): gh ${args.join(" ").slice(0, 120)}`
|
|
116
|
+
);
|
|
117
|
+
return 1;
|
|
118
|
+
}
|
|
119
|
+
const result = spawnSync(gh, [...args], {
|
|
120
|
+
encoding: "utf8",
|
|
121
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
122
|
+
});
|
|
123
|
+
if (result.error) throw result.error;
|
|
124
|
+
const call: LoggedCall = {
|
|
125
|
+
request: requestName(args),
|
|
126
|
+
code: result.status ?? 1,
|
|
127
|
+
stdout: result.stdout,
|
|
128
|
+
stderr: result.stderr,
|
|
129
|
+
};
|
|
130
|
+
appendFileSync(log, `${JSON.stringify(call)}\n`);
|
|
131
|
+
process.stdout.write(result.stdout);
|
|
132
|
+
process.stderr.write(result.stderr);
|
|
133
|
+
return call.code;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// The `gh` on PATH is a short script that calls this with its arguments and
|
|
137
|
+
// the transport written into it (see ghOnPath in harness.ts). No environment
|
|
138
|
+
// variable picks the mode, and no path through a symlink decides whether this
|
|
139
|
+
// file is the main module.
|
|
140
|
+
export function main(args: readonly string[], transport: Transport): number {
|
|
141
|
+
return "fixture" in transport
|
|
142
|
+
? replay(args, transport.fixture)
|
|
143
|
+
: record(args, transport.gh, transport.log);
|
|
144
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// What the replay test and the recorder share: the list of recorded heads, a
|
|
2
|
+
// `gh` on PATH that is the stand-in in gh.ts, and one run of watch.ts over a
|
|
3
|
+
// head with that `gh` first on PATH.
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { chmodSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { delimiter, join } from "node:path";
|
|
7
|
+
import type { RecordedCall, Transport } from "./gh.ts";
|
|
8
|
+
import type { Pass } from "./watch.ts";
|
|
9
|
+
|
|
10
|
+
export const REPLAY_DIR = import.meta.dir;
|
|
11
|
+
export const fixturePath = (name: string): string =>
|
|
12
|
+
join(REPLAY_DIR, "fixtures", `${name}.json`);
|
|
13
|
+
|
|
14
|
+
/** What one head's raw recorded facts must show, checked when recording. */
|
|
15
|
+
export type Property =
|
|
16
|
+
| "cancelled-suite-beside-green-checks"
|
|
17
|
+
| "cancelled-check-beside-green-checks"
|
|
18
|
+
| "approval-gated-suites-beside-pending-checks"
|
|
19
|
+
| "no-checks-and-no-suites";
|
|
20
|
+
|
|
21
|
+
/** What watch-pr decided, cut down to the parts a verdict is judged by. */
|
|
22
|
+
export interface Outcome {
|
|
23
|
+
readonly status: {
|
|
24
|
+
readonly exitCode: number;
|
|
25
|
+
readonly kind: string;
|
|
26
|
+
/** `rows[0].ci.kind` of the status table. */
|
|
27
|
+
readonly ci: string | null;
|
|
28
|
+
};
|
|
29
|
+
readonly watch: {
|
|
30
|
+
readonly exitCode: number;
|
|
31
|
+
readonly kind: string;
|
|
32
|
+
/** The blocker's kind, or what a watch that timed out was waiting for. */
|
|
33
|
+
readonly detail: string | null;
|
|
34
|
+
/** The checks a failing-checks blocker names, as `STATE: name`, sorted. */
|
|
35
|
+
readonly failed: readonly string[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Head {
|
|
40
|
+
/** The fixture's file name, without `.json`. */
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly owner: string;
|
|
43
|
+
readonly repo: string;
|
|
44
|
+
readonly pr: number;
|
|
45
|
+
readonly head: string;
|
|
46
|
+
readonly property: Property;
|
|
47
|
+
/** Set by hand from the recorded facts. `because` gives the reasoning. */
|
|
48
|
+
readonly expected: Outcome;
|
|
49
|
+
readonly because: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const heads = (): readonly Head[] =>
|
|
53
|
+
JSON.parse(readFileSync(join(REPLAY_DIR, "heads.json"), "utf8")) as Head[];
|
|
54
|
+
|
|
55
|
+
// A `gh` for PATH that hands its arguments to gh.ts, with the transport
|
|
56
|
+
// written into it. Returns the directory to put on PATH.
|
|
57
|
+
export function ghOnPath(bin: string, transport: Transport): string {
|
|
58
|
+
mkdirSync(bin, { recursive: true });
|
|
59
|
+
const gh = join(bin, "gh");
|
|
60
|
+
writeFileSync(
|
|
61
|
+
gh,
|
|
62
|
+
`#!${process.execPath}\nimport { main } from ${JSON.stringify(join(REPLAY_DIR, "gh.ts"))};\nprocess.exitCode = main(process.argv.slice(2), ${JSON.stringify(transport)});\n`
|
|
63
|
+
);
|
|
64
|
+
chmodSync(gh, 0o755);
|
|
65
|
+
return bin;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const dig = (
|
|
69
|
+
value: unknown,
|
|
70
|
+
...path: readonly (string | number)[]
|
|
71
|
+
): unknown =>
|
|
72
|
+
path.reduce<unknown>(
|
|
73
|
+
(current, step) =>
|
|
74
|
+
typeof current === "object" && current !== null
|
|
75
|
+
? (current as Record<string | number, unknown>)[step]
|
|
76
|
+
: undefined,
|
|
77
|
+
value
|
|
78
|
+
);
|
|
79
|
+
const kindOf = (value: unknown): string | null =>
|
|
80
|
+
typeof value === "string" ? value : null;
|
|
81
|
+
|
|
82
|
+
// Why a recording is not of `head`, or null when it is: GitHub's
|
|
83
|
+
// PullRequestFacts answer names the PR's head at the time of the read, which
|
|
84
|
+
// is a newer one once the PR has moved on.
|
|
85
|
+
export function movedHead(
|
|
86
|
+
head: Pick<Head, "head">,
|
|
87
|
+
calls: Readonly<Record<string, RecordedCall>>
|
|
88
|
+
): string | null {
|
|
89
|
+
const facts = Object.keys(calls).find((name) =>
|
|
90
|
+
name.startsWith("graphql PullRequestFacts ")
|
|
91
|
+
);
|
|
92
|
+
const answered = dig(
|
|
93
|
+
facts === undefined ? undefined : calls[facts].json,
|
|
94
|
+
"data",
|
|
95
|
+
"repository",
|
|
96
|
+
"pullRequest",
|
|
97
|
+
"headRefOid"
|
|
98
|
+
);
|
|
99
|
+
if (answered === head.head) return null;
|
|
100
|
+
return typeof answered === "string"
|
|
101
|
+
? `GitHub answered for head ${answered}, not ${head.head}, so the pull request has moved on. Pick another head for heads.json`
|
|
102
|
+
: `no PullRequestFacts answer names a head, so nothing shows the recording is of ${head.head}`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const failedChecks = (value: unknown): string[] =>
|
|
106
|
+
(Array.isArray(value) ? value : [])
|
|
107
|
+
.map((check) => `${dig(check, "reportedState")}: ${dig(check, "name")}`)
|
|
108
|
+
.sort();
|
|
109
|
+
|
|
110
|
+
export function outcomeOf(passes: {
|
|
111
|
+
readonly status: Pass;
|
|
112
|
+
readonly watch: Pass;
|
|
113
|
+
}): Outcome {
|
|
114
|
+
const table = passes.status.verdicts.at(-1);
|
|
115
|
+
const last = passes.watch.verdicts.at(-1);
|
|
116
|
+
// A watch that times out says so without the reason, which is in the
|
|
117
|
+
// WAITING line before it.
|
|
118
|
+
const waiting = passes.watch.verdicts.findLast(
|
|
119
|
+
(verdict) => verdict.kind === "WAITING"
|
|
120
|
+
);
|
|
121
|
+
return {
|
|
122
|
+
status: {
|
|
123
|
+
exitCode: passes.status.exitCode,
|
|
124
|
+
kind: kindOf(table?.kind) ?? "none",
|
|
125
|
+
ci: kindOf(dig(table, "rows", 0, "ci", "kind")),
|
|
126
|
+
},
|
|
127
|
+
watch: {
|
|
128
|
+
exitCode: passes.watch.exitCode,
|
|
129
|
+
kind: kindOf(last?.kind) ?? "none",
|
|
130
|
+
detail:
|
|
131
|
+
kindOf(dig(last, "blocker", "kind")) ??
|
|
132
|
+
kindOf(
|
|
133
|
+
dig(last?.kind === "TIMEOUT" ? waiting : last, "reason", "kind")
|
|
134
|
+
),
|
|
135
|
+
failed: failedChecks(dig(last, "blocker", "ci", "failed")),
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Runs watch.ts over `head`. Given `bin`, the child gets one variable, a PATH
|
|
141
|
+
// with that directory first, which is all a replay needs. Given none, the
|
|
142
|
+
// child inherits this process's environment as it stands: a recording needs
|
|
143
|
+
// gh's sign-in, and the recorder puts its stand-in first on its own PATH.
|
|
144
|
+
export function runWatch(
|
|
145
|
+
head: Pick<Head, "owner" | "repo" | "pr" | "head">,
|
|
146
|
+
bin?: string
|
|
147
|
+
): { readonly status: Pass; readonly watch: Pass } {
|
|
148
|
+
const result = spawnSync(
|
|
149
|
+
process.execPath,
|
|
150
|
+
[
|
|
151
|
+
join(REPLAY_DIR, "watch.ts"),
|
|
152
|
+
head.owner,
|
|
153
|
+
head.repo,
|
|
154
|
+
String(head.pr),
|
|
155
|
+
head.head,
|
|
156
|
+
],
|
|
157
|
+
{
|
|
158
|
+
encoding: "utf8",
|
|
159
|
+
timeout: 120_000,
|
|
160
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
161
|
+
...(bin === undefined
|
|
162
|
+
? {}
|
|
163
|
+
: { env: { PATH: `${bin}${delimiter}${process.env.PATH ?? ""}` } }),
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
if (result.error) throw result.error;
|
|
167
|
+
if (result.status !== 0)
|
|
168
|
+
throw new Error(
|
|
169
|
+
`watch.ts exited ${result.status}: ${result.stderr.trim().slice(0, 2000)}`
|
|
170
|
+
);
|
|
171
|
+
return JSON.parse(result.stdout) as { status: Pass; watch: Pass };
|
|
172
|
+
}
|