Skip to content

Allow for workbench job knowledge capture if > 0 prs merged#3429

Merged
michaeljguarino merged 6 commits intomasterfrom
backfillable-fixes
Apr 15, 2026
Merged

Allow for workbench job knowledge capture if > 0 prs merged#3429
michaeljguarino merged 6 commits intomasterfrom
backfillable-fixes

Conversation

@michaeljguarino
Copy link
Copy Markdown
Member

This is enough to indicate something was correct

Test Plan

n/a

Checklist

  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a meaningful title and summary to convey the impact of this PR to a user.

Plural Flow: console

@michaeljguarino michaeljguarino added the enhancement New feature or request label Apr 14, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 14, 2026

Greptile Summary

Fixes the previously broken resolved/1 query on WorkbenchJob by replacing the COUNT(CASE WHEN … ELSE 0 END) approach (which always counted every row) with a subquery left-join on merged PRs filtered via a new PullRequest.for_status/2 helper, plus a WHERE pr.id IS NOT NULL guard and DISTINCT to correctly return workbench jobs with at least one merged PR.

Confidence Score: 5/5

Safe to merge — the new query logic is correct and directly addresses the previously flagged bug.

The subquery join pattern correctly identifies workbench jobs with ≥1 merged PR: the for_status(:merged) subquery narrows the joined rows to merged PRs, NOT NULL on pr.id converts the left join to an effective inner join, and distinct: true prevents duplicates for jobs with multiple merged PRs. All changes are small and focused.

No files require special attention.

Important Files Changed

Filename Overview
lib/console/schema/workbench_job.ex Rewrites resolved/1 to use a subquery join on merged PRs instead of the broken COUNT-based HAVING clause; logic is correct.
lib/console/schema/pull_request.ex Adds for_status/2 helper used by the new resolved/1 implementation in WorkbenchJob; clean and consistent with existing patterns.
priv/pr/agent_review.md.eex Minor cosmetic reordering of parenthetical in the PR review template — no functional impact.

Reviews (2): Last reviewed commit: "Allow for workbench job knowledge captur..." | Re-trigger Greptile

Comment thread lib/console/schema/workbench_job.ex Outdated
@michaeljguarino michaeljguarino force-pushed the backfillable-fixes branch 5 times, most recently from 9e69d51 to e74b113 Compare April 15, 2026 00:07
This is enough to indicate something was correct
@michaeljguarino
Copy link
Copy Markdown
Member Author

@greptileai

@michaeljguarino michaeljguarino merged commit 1da293b into master Apr 15, 2026
42 checks passed
@michaeljguarino michaeljguarino deleted the backfillable-fixes branch April 15, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants