pr_01m47d24b0e6n91zwymwxg0vpx/services/work/migrations/0017_agent_mentions.sql
| 1 | -- Comments that mention @g1t-agent, each handled once: the runner takes a |
| 2 | -- pending one when it hears the comment was made, and says what it did. |
| 3 | CREATE TABLE agent_mentions ( |
| 4 | comment_id TEXT PRIMARY KEY, |
| 5 | repo_id TEXT NOT NULL, |
| 6 | number INTEGER NOT NULL, |
| 7 | -- Set when the comment is on a pull request. |
| 8 | pull_id TEXT, |
| 9 | -- Who wrote it, as JSON, with the memberships they had when they did. |
| 10 | actor TEXT NOT NULL, |
| 11 | body TEXT NOT NULL, |
| 12 | -- What they asked for: work, question or review. |
| 13 | intent TEXT NOT NULL, |
| 14 | -- Whether they belong to the repository's workspace. |
| 15 | member INTEGER NOT NULL, |
| 16 | -- pending, taken, then replied once g1t-agent has answered in the thread. |
| 17 | status TEXT NOT NULL DEFAULT 'pending', |
| 18 | outcome TEXT, |
| 19 | created_at TEXT NOT NULL, |
| 20 | taken_at TEXT |
| 21 | ); |
| 22 | CREATE INDEX agent_mentions_by_subject ON agent_mentions (repo_id, number); |
| 23 | |
| 24 | -- Rules that put g1t-agent to work without anyone assigning it. One row per |
| 25 | -- repository that has set one. |
| 26 | CREATE TABLE agent_rules ( |
| 27 | repo_id TEXT PRIMARY KEY, |
| 28 | -- When an issue is given this label, g1t-agent takes it. |
| 29 | label TEXT, |
| 30 | updated_by TEXT NOT NULL, |
| 31 | updated_at TEXT NOT NULL |
| 32 | ); |