(pr: int)
| 160 | |
| 161 | |
| 162 | def plan(pr: int) -> dict[str, Any]: |
| 163 | comments = fetch_comments(pr) |
| 164 | top_level = [ |
| 165 | c for c in comments if c.in_reply_to is None and c.author in CODERABBIT_LOGINS |
| 166 | ] |
| 167 | buckets: dict[str, list[dict[str, Any]]] = { |
| 168 | "valid-fix": [], |
| 169 | "style": [], |
| 170 | "false-positive": [], |
| 171 | "security-flag": [], |
| 172 | } |
| 173 | for c in top_level: |
| 174 | if _is_resolved(c, comments): |
| 175 | continue |
| 176 | buckets[c.classification].append( |
| 177 | { |
| 178 | "id": c.id, |
| 179 | "path": c.path, |
| 180 | "line": c.line, |
| 181 | "body": c.body[:400], |
| 182 | } |
| 183 | ) |
| 184 | return { |
| 185 | "pr": pr, |
| 186 | "total_open": sum(len(v) for v in buckets.values()), |
| 187 | "buckets": buckets, |
| 188 | "max_iterations": MAX_ITERATIONS, |
| 189 | } |
| 190 | |
| 191 | |
| 192 | def reply(pr: int, comment_id: int, message: str) -> None: |
no test coverage detected