@openhands/extensions 0.4.1 → 0.5.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.
- package/.release-please-manifest.json +1 -1
- package/automations/catalog/github-pr-reviewer.json +2 -2
- package/automations/catalog/slack-channel-monitor.json +2 -2
- package/integrations/catalog/github.json +8 -24
- package/integrations/index.d.ts +2 -0
- package/package.json +1 -1
- package/plugins/qa-changes/action.yml +1 -1
- package/pyproject.toml +1 -1
- package/skills/github-pr-reviewer/.plugin/plugin.json +1 -1
- package/skills/github-pr-reviewer/README.md +21 -15
- package/skills/github-pr-reviewer/SKILL.md +85 -66
- package/skills/github-pr-reviewer/commands/pr-reviewer-setup.md +1 -1
- package/skills/github-pr-reviewer/references/state-schema.md +74 -46
- package/skills/github-pr-reviewer/scripts/main.py +210 -227
- package/skills/index.js +3 -3
- package/skills/slack-channel-monitor/README.md +8 -4
- package/skills/slack-channel-monitor/SKILL.md +15 -6
- package/skills/slack-channel-monitor/references/slack-api.md +5 -3
- package/skills/slack-channel-monitor/references/state-schema.md +59 -32
- package/skills/slack-channel-monitor/scripts/main.py +242 -40
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
# State File Schema
|
|
2
2
|
|
|
3
3
|
The automation maintains a JSON state file that persists across polling runs.
|
|
4
|
-
It is the source of truth for which
|
|
5
|
-
conversations are still active.
|
|
4
|
+
It is the source of truth for which trigger-label events have queued reviews
|
|
5
|
+
and which conversations are still active.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## File Location
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
{WORKSPACE_BASE_ROOT}/automation-state/
|
|
12
|
+
{WORKSPACE_BASE_ROOT}/automation-state/github_pr_reviewer_label_event_{automation_id}.json
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
`WORKSPACE_BASE_ROOT` is derived by going two levels up from the `WORKSPACE_BASE`
|
|
16
|
-
environment variable
|
|
16
|
+
environment variable, stripping `automation-runs/{run_id}`.
|
|
17
17
|
|
|
18
18
|
Example on a local install:
|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
~/.openhands/workspaces/automation-state/
|
|
21
|
+
~/.openhands/workspaces/automation-state/github_pr_reviewer_label_event_abc12345-....json
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
The `automation_id` is read from the `AUTOMATION_EVENT_PAYLOAD` environment
|
|
25
|
-
variable
|
|
25
|
+
variable, field `automation_id`.
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
@@ -30,69 +30,97 @@ variable (field `automation_id`).
|
|
|
30
30
|
|
|
31
31
|
```jsonc
|
|
32
32
|
{
|
|
33
|
-
"version":
|
|
34
|
-
"repo": "owner/repo",
|
|
35
|
-
"
|
|
33
|
+
"version": 2,
|
|
34
|
+
"repo": "owner/repo",
|
|
35
|
+
"trigger_label": "openhands-review",
|
|
36
|
+
"updated_at": 1717200000.0,
|
|
37
|
+
"reviews": {},
|
|
38
|
+
"prs": {}
|
|
36
39
|
}
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
---
|
|
40
43
|
|
|
41
|
-
## `
|
|
44
|
+
## `reviews` Map
|
|
42
45
|
|
|
43
|
-
Key: `"{pr_number}"
|
|
46
|
+
Key: `"{pr_number}:label:{label_event_id}"`. This makes the latest GitHub
|
|
47
|
+
`labeled` event the idempotency key. Re-applying the trigger label creates a new
|
|
48
|
+
GitHub event and therefore a new review request.
|
|
44
49
|
|
|
45
|
-
Value: **
|
|
50
|
+
Value: **ReviewRecord**
|
|
46
51
|
|
|
47
52
|
```jsonc
|
|
48
53
|
{
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
// Present when status is "active" or "closed"
|
|
54
|
+
"pr_number": 42,
|
|
55
|
+
"head_sha": "0123456789abcdef...",
|
|
56
|
+
"trigger_label_event_id": 123456789,
|
|
57
|
+
"trigger_label_event_created_at": "2026-06-12T00:00:00Z",
|
|
58
|
+
"html_url": "https://github.com/owner/repo/pull/42",
|
|
59
|
+
"status": "active",
|
|
56
60
|
"conversation_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
57
|
-
|
|
61
|
+
"last_activity": 1717200000.0
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`status` values:
|
|
66
|
+
|
|
67
|
+
| Status | Meaning |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `active` | Review conversation is running or waiting to be collected |
|
|
70
|
+
| `closed` | Final result was posted, or the PR closed before collection |
|
|
71
|
+
| `stale` | PR head SHA changed before the review completed, so the result was suppressed |
|
|
72
|
+
|
|
73
|
+
When a review becomes stale, `stale_reason` records the old and new head SHAs.
|
|
74
|
+
When a review closes after posting, `completed_at` records the completion time.
|
|
75
|
+
|
|
76
|
+
---
|
|
58
77
|
|
|
59
|
-
|
|
60
|
-
|
|
78
|
+
## `prs` Map
|
|
79
|
+
|
|
80
|
+
Key: `"{pr_number}"`.
|
|
81
|
+
|
|
82
|
+
Value: latest PR snapshot observed during polling:
|
|
83
|
+
|
|
84
|
+
```jsonc
|
|
85
|
+
{
|
|
86
|
+
"head_sha": "0123456789abcdef...",
|
|
87
|
+
"label_present": true,
|
|
88
|
+
"labels": ["openhands-review", "bug"],
|
|
89
|
+
"last_seen": 1717200000.0
|
|
61
90
|
}
|
|
62
91
|
```
|
|
63
92
|
|
|
93
|
+
This snapshot is informational and helps diagnose whether a PR was skipped
|
|
94
|
+
because the trigger label was absent.
|
|
95
|
+
|
|
64
96
|
---
|
|
65
97
|
|
|
66
|
-
##
|
|
98
|
+
## Review Lifecycle
|
|
67
99
|
|
|
68
100
|
```
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
[active]
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
── or ──
|
|
81
|
-
|
|
82
|
-
PR diff too large
|
|
83
|
-
│
|
|
84
|
-
▼
|
|
85
|
-
[skipped] ── explanatory comment posted, PR never re-queued
|
|
101
|
+
Trigger label applied on GitHub
|
|
102
|
+
|
|
|
103
|
+
v
|
|
104
|
+
[active] - conversation created, acknowledgement comment posted
|
|
105
|
+
|
|
|
106
|
+
+-- PR closes/merges before collection --> [closed] without posting
|
|
107
|
+
|
|
|
108
|
+
+-- PR head SHA changes before collection --> [stale] without posting
|
|
109
|
+
|
|
|
110
|
+
v
|
|
111
|
+
[closed] - final review comment posted
|
|
86
112
|
```
|
|
87
113
|
|
|
88
114
|
---
|
|
89
115
|
|
|
90
116
|
## Resetting State
|
|
91
117
|
|
|
92
|
-
To force
|
|
118
|
+
To force the automation to reconsider previous label events, delete the state
|
|
119
|
+
file:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
rm ~/.openhands/workspaces/automation-state/github_pr_reviewer_label_event_<id>.json
|
|
123
|
+
```
|
|
93
124
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
rm ~/.openhands/workspaces/automation-state/github_pr_reviewer_<id>.json
|
|
97
|
-
```
|
|
98
|
-
2. The next cron run will treat all open PRs as new and queue reviews for each.
|
|
125
|
+
Usually, prefer removing and re-applying the trigger label. That preserves
|
|
126
|
+
history while creating a new review request.
|