Skip to content

feat: learn from review thread resolve/unresolve - #21

Merged
lohitkolluri merged 2 commits into
mainfrom
feat/review-thread-resolve
Aug 2, 2026
Merged

feat: learn from review thread resolve/unresolve#21
lohitkolluri merged 2 commits into
mainfrom
feat/review-thread-resolve

Conversation

@lohitkolluri

Copy link
Copy Markdown
Owner

Handles the pull_request_review_thread webhook so resolving/unresolving a review thread on a Codasaurus finding comment actually does something:

  • Resolve a thread on a finding comment -> that fingerprint is dismissed repo-wide (same ACL + learning path as a thumbs-down reaction).
  • Unresolve -> new un_dismiss_fingerprint store method deletes the dismissal, so the finding surfaces again.
  • Adds the pull_request_review_thread event to the GitHub App manifest default_events.

Notes:

  • ACL: only repo owner / org members / collaborators / prior contributors / PR author can dismiss via resolve - same trust bar as commands and reactions.
  • Existing App installs pick up the new event on the next manifest sync (edit -> permissions -> events update).
  • Tests: fingerprint extraction from thread comments, resolver ACL matrix, and the dismiss/un-dismiss store round trip (208 lib tests pass; production_hardening still needs a local Postgres, unrelated).

Handle pull_request_review_thread webhook: resolving a thread on a
Codasaurus finding comment dismisses the fingerprint repo-wide (same
ACL and learning path as a 👎 reaction); unresolving re-enables it via
a new un_dismiss_fingerprint store method. Adds the event to the App
manifest default_events.

Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
@codasaurus-e0a6

codasaurus-e0a6 Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codasaurus

BLOCKING: 0 WARNING: 3 INFO: 0 READY TO MERGE: NO

Advisory draft — soft findings only. Codasaurus will not request changes; a maintainer still decides merge.

feat: learn from review thread resolve/unresolve

This PR updates 7 files across src, (root). I spotted 3 things worth a quick look (not blockers). See the list below.

Since last review

Resolved

  • Repeated code in src/bot/mod.rs

Still open

  • Repeated code in src/bot/threads.rs
  • Repeated code in src/bot/worker.rs

New

  • Repeated code in src/bot/mod.rs

What to do next

  1. Please check [quality]: Repeated code in src/bot/mod.rs
  2. Please check [quality]: Repeated code in src/bot/threads.rs
  3. Please check [quality]: Repeated code in src/bot/worker.rs
Copy this into your AI coding agent

Paste this prompt into Cursor, Copilot, or another coding agent:

You are fixing Codasaurus review findings on a GitHub pull request.

## Rules
- Change only what is required to resolve the findings below.
- Do not refactor unrelated code or add features.
- Prefer the smallest correct diff.
- `tests/fixtures/golden/` and `golden/*/input.*` files intentionally contain sample secrets/TODOs for detector tests — do not "fix" those unless the PR is explicitly changing the fixture contract.
- Workspace crate imports in `tests/` (e.g. `use codasaurus::…`) are expected — do not add them to Cargo.toml.
- If a finding is a false positive, say so instead of changing code.
- After edits, summarize what you changed and why.

## Findings (priority order)
### 1. [warning] Repeated code
- **Location:** `src/bot/mod.rs`
- **Detector:** `boilerplate`
- **Issue:** Repeated code blocks found (31 instances) — AI often generates repetitive code.
- **Fix:** Extract repeated blocks into reusable functions.


### 2. [warning] Repeated code
- **Location:** `src/bot/threads.rs`
- **Detector:** `boilerplate`
- **Issue:** Repeated code blocks found (4 instances) — AI often generates repetitive code.
- **Fix:** Extract repeated blocks into reusable functions.


### 3. [warning] Repeated code
- **Location:** `src/bot/worker.rs`
- **Detector:** `boilerplate`
- **Issue:** Repeated code blocks found (8 instances) — AI often generates repetitive code.
- **Fix:** Extract repeated blocks into reusable functions.


## PR context
Title: feat: learn from review thread resolve/unresolve

Changes

Path What changed
CHANGELOG.md updated
src/api/setup.rs updated
src/bot/commands.rs updated
src/bot/mod.rs updated
src/bot/threads.rs added
src/bot/worker.rs updated
src/learning/store.rs updated
All files (7)
  • CHANGELOG.md (modified)
  • src/api/setup.rs (modified)
  • src/bot/commands.rs (modified)
  • src/bot/mod.rs (modified)
  • src/bot/threads.rs (added)
  • src/bot/worker.rs (modified)
  • src/learning/store.rs (modified)

@codasaurus-e0a6

Copy link
Copy Markdown

Context

Blast radius

BLAST RADIUS: MODERATE SCORE: 40

Sensitive path: src/bot/mod.rs

Related pull requests

@codasaurus-e0a6

Copy link
Copy Markdown

Checks

Before merge

  • No blocking findings
  • Warning budget within limit
    • At most 0 warnings allowed. Clear the notes on the Files tab, or ask a teammate.
  • PR has a title

Reviewer time ~20 min (3/5 · Moderate · 7 files)

Commands

Type as plain text (GitHub Apps are not @-mentionable):

review · describe · summarize · improve · security · ask … · ignore <fp> · help

Full list: @codasaurus help

@codasaurus-e0a6 codasaurus-e0a6 Bot added the documentation Improvements or additions to documentation label Aug 2, 2026
Collapse reactor_can_dismiss and thread_resolver_can_dismiss onto a
shared actor_can_dismiss core plus repo_owner_login/pr_author_login
extractors. Same behavior, ~50 lines less.

Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
@lohitkolluri
lohitkolluri merged commit c89ba94 into main Aug 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant