@sentry/junior-github 0.264.0 → 0.266.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/README.md +51 -0
- package/dist/{chunk-KWVC6CU5.js → chunk-B6WCXAII.js} +534 -441
- package/dist/credential-support.d.ts +1 -1
- package/dist/db/schema.d.ts +192 -0
- package/dist/events/comment.d.ts +7 -0
- package/dist/events/deployment.d.ts +13 -2
- package/dist/events/issue.d.ts +12 -4
- package/dist/events/pull-request.d.ts +15 -2
- package/dist/events/release.d.ts +25 -2
- package/dist/events/repository.d.ts +10 -1
- package/dist/events/scope.d.ts +13 -0
- package/dist/index.js +819 -545
- package/dist/plugin.d.ts +0 -5
- package/dist/pull-request-requesters/store.d.ts +34 -0
- package/dist/testing.js +1 -1
- package/dist/tool-support/attribution.d.ts +22 -11
- package/dist/tools/update-pull-request.d.ts +1 -0
- package/dist/webhooks/check-suite.d.ts +4 -4
- package/dist/webhooks/event-targets.d.ts +18 -0
- package/dist/webhooks/handler.d.ts +23 -12
- package/dist/webhooks/pull-request-match-data.d.ts +31 -0
- package/dist/webhooks/pull-request-people.d.ts +25 -5
- package/migrations/0009_nostalgic_thing.sql +8 -0
- package/migrations/meta/0009_snapshot.json +404 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +2 -2
- package/dist/webhooks/pull-request-author-role.d.ts +0 -20
package/README.md
CHANGED
|
@@ -34,6 +34,57 @@ The plugin saves the created pull request before it tries assignment. Retrying
|
|
|
34
34
|
the same tool call returns the saved pull request without retrying assignment,
|
|
35
35
|
creating another pull request, or replacing existing assignees.
|
|
36
36
|
|
|
37
|
+
The plugin saves each person who asks Junior to open or update a pull request in
|
|
38
|
+
`junior_github_pull_request_requesters`. Each row has only the core Junior
|
|
39
|
+
identity id of that person. The plugin does not copy the user or GitHub login.
|
|
40
|
+
When a webhook needs the GitHub login, it reads the identity through
|
|
41
|
+
`ctx.users.readIdentity()` and uses the GitHub identity of the linked user. So a
|
|
42
|
+
person who links GitHub later is found on their older pull requests too. The
|
|
43
|
+
create tool saves the opener after GitHub opens the pull request. The first row
|
|
44
|
+
for a pull request is the opener. Later updates never replace it. When the
|
|
45
|
+
create has no Junior identity, the first person who asks Junior to update the
|
|
46
|
+
pull request is the opener. A retry of the same tool call saves the opener
|
|
47
|
+
again, in case the first call stopped before it did.
|
|
48
|
+
|
|
49
|
+
Pull request events have two kinds of people fields. `openerUsername`,
|
|
50
|
+
`openerEmail`, and `openerRole` name who opened the pull request. On a pull
|
|
51
|
+
request that Junior's bot opened, the opener is the person who asked Junior to
|
|
52
|
+
open it: the linked GitHub login of the saved opener row. With no saved row, no
|
|
53
|
+
linked GitHub login, or a failed identity lookup, the opener is unknown and the
|
|
54
|
+
event has no opener fields, so filters on them do not match. The bot is never
|
|
55
|
+
used in its place. An `opened` event can arrive before the create tool saves
|
|
56
|
+
the row. `authors` lists the GitHub logins of the commit authors and of the
|
|
57
|
+
`Co-authored-by` trailers with GitHub noreply emails, bots included. Webhooks
|
|
58
|
+
never read the pull request body.
|
|
59
|
+
|
|
60
|
+
The opener on Junior's pull requests, `openerRole`, and `authors` need database
|
|
61
|
+
or GitHub calls. A webhook loads the values that a Watch or event automation
|
|
62
|
+
filters on before it decides on a match. It loads the other values only when an
|
|
63
|
+
event matches, so the agent sees all of them. A failed load leaves the value
|
|
64
|
+
out. `authors` and the people involved in approvals and merges share one read of
|
|
65
|
+
the commits per delivery.
|
|
66
|
+
|
|
67
|
+
Deployment events come from GitHub `deployment` and `deployment_status`
|
|
68
|
+
webhooks:
|
|
69
|
+
|
|
70
|
+
| Event | GitHub source |
|
|
71
|
+
| ------------------------ | --------------------------- |
|
|
72
|
+
| `deployment.created` | `deployment` with `created` |
|
|
73
|
+
| `deployment.queued` | status `queued` |
|
|
74
|
+
| `deployment.pending` | status `pending` |
|
|
75
|
+
| `deployment.in_progress` | status `in_progress` |
|
|
76
|
+
| `deployment.succeeded` | status `success` |
|
|
77
|
+
| `deployment.failed` | status `failure` |
|
|
78
|
+
| `deployment.error` | status `error` |
|
|
79
|
+
|
|
80
|
+
GitHub has two failure states. `failure` means that the deployment ran and
|
|
81
|
+
failed. `error` means that the deploy tool reported an error. The deploy tool
|
|
82
|
+
sets the status, so the difference depends on that tool. Vercel
|
|
83
|
+
`deployment.error` is a failed deployment, so it is the same as GitHub
|
|
84
|
+
`deployment.failed`, not GitHub `deployment.error`. `succeeded`, `failed`, and
|
|
85
|
+
`error` end a watch on one commit and environment. Watches on a commit or a
|
|
86
|
+
repository stay active.
|
|
87
|
+
|
|
37
88
|
The plugin owns its signed webhook route, deployment, pull request, and release
|
|
38
89
|
events, and normalized pull request and issue outcome projections.
|
|
39
90
|
Those projections also feed native code-change records used by the dashboard
|