Skip to content

fix(application-server): deduplicate active practices query in PullRequestReviewHandler #907

@FelixTJDietrich

Description

@FelixTJDietrich

Context

Found during PE audit of PR #892. PullRequestReviewHandler.buildPrompt() (line 189) and verifyActivePractices() (called from prepareInputFiles() at line 140) both execute practiceRepository.findByWorkspaceIdAndActiveTrue() — the same query runs twice per agent job.

Scope

Cache the practices list from verifyActivePractices() and pass it to buildPrompt(), or store it in job metadata. Minor efficiency fix — eliminates one DB query per agent run.

Files

File Change
agent/handler/PullRequestReviewHandler.java MODIFY — cache practices between methods

Verification

  • Active practices query executes once per job, not twice
  • Agent output unchanged (same practices used for both verify + prompt)

Metadata

Metadata

Assignees

No one assigned

    Labels

    application-serverSpring Boot server: APIs, business logic, database

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions