Skip to content

fix: improve review quality multiplier observability + harden is_valid_issue - #743

Merged
anderdc merged 4 commits into
entrius:testfrom
dataCenter430:fix/review-quality-multiplier-observability
Apr 28, 2026
Merged

fix: improve review quality multiplier observability + harden is_valid_issue#743
anderdc merged 4 commits into
entrius:testfrom
dataCenter430:fix/review-quality-multiplier-observability

Conversation

@dataCenter430

@dataCenter430 dataCenter430 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes merged in this PR:

1. Review quality multiplier observability

  • PR number missing from penalty logcalculate_review_quality_multiplier logged penalties without the PR number, making log lines untraceable during a validator run. Added optional pr_number param (same pattern as PR fix: add PR number context to file-content fetch failure warning #711) so the call site in calculate_pr_multipliers can pass pr.number.

2. Harden is_valid_issue close-window check

The original guard was if issue.closed_at and pr.merged_at: — silently skipping issues with a missing closed_at instead of flagging them. Two changes:

  • Explicit closed_at guard — issues that are CLOSED but have no closed_at timestamp now log a warning and are rejected instead of being silently accepted.
  • abs() on days_diff — the sign check (days_diff < 0) was replaced with abs() so the window is symmetric and the rejection log no longer shows a signed delta.

Note: the redundant inner state_reason check that was briefly added has been removed — upstream's _is_completed_when_closed helper already enforces this earlier in the function.

Test plan

  • Validator logs show (PR #N) in review quality penalty lines
  • Issues with a missing closed_at timestamp are rejected with a warning
  • Close-window rejection fires symmetrically (issue closed before or after merge)
  • Existing review quality multiplier and is_valid_issue tests pass

Closes: #742

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label Apr 23, 2026

@anderdc anderdc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the database changes

@dataCenter430

Copy link
Copy Markdown
Contributor Author

Thanks for your review, @anderdc
Okay, I will got it right away.

@dataCenter430

Copy link
Copy Markdown
Contributor Author

Just done and ready to review!

@dataCenter430
dataCenter430 requested a review from anderdc April 26, 2026 09:35
@dataCenter430 dataCenter430 changed the title fix: improve review quality multiplier observability fix: improve review quality multiplier observability + harden is_valid_issue Apr 27, 2026
@dataCenter430
dataCenter430 force-pushed the fix/review-quality-multiplier-observability branch from 03f18b4 to c00ac34 Compare April 27, 2026 21:50
@dataCenter430

dataCenter430 commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @anderdc
I already updated the PR as you mentioned.
Plesae review the PR, thanks.

@anderdc anderdc added logging-visibility and removed enhancement New feature or request labels Apr 28, 2026

@anderdc anderdc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior DB-changes complaint is resolved. Two new asks before merge:

  1. The body claims abs() replaced the < 0 sign check on days_diff, but the actual diff at scoring.py:482 keeps if days_diff > MAX_ISSUE_CLOSE_WINDOW_DAYS or days_diff < 0: unchanged. Fix the description or actually make the change.

  2. Please scope down to #742. Keep: the pr_number parameter on calculate_review_quality_multiplier and its call site in calculate_pr_multipliers. Drop: the is_valid_issue close-window changes — that's unrelated to #742 and is its own scoring-eligibility decision, file separately. If you want to also pick up #742 ask 3 (logging in calculate_issue_review_quality_multiplier), do it here; otherwise note it as a follow-up.

@anderdc
anderdc dismissed their stale review April 28, 2026 21:11

Replacing with cleaner scope-down ask.

@anderdc anderdc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior DB-changes ask is resolved. One ask before merge: please scope this down to #742.

Keep: the pr_number parameter on calculate_review_quality_multiplier and its call site in calculate_pr_multipliers.

Drop: the is_valid_issue close-window changes — unrelated to #742 and a separate scoring-eligibility decision.

If you also want to pick up #742 ask 3 (logging in calculate_issue_review_quality_multiplier), include it here; otherwise note it as a follow-up.

@dataCenter430

Copy link
Copy Markdown
Contributor Author

Okay, thanks for your review.
I will got it right away.

@dataCenter430
dataCenter430 requested a review from anderdc April 28, 2026 21:24
@dataCenter430
dataCenter430 force-pushed the fix/review-quality-multiplier-observability branch from 837fb05 to 23e43e8 Compare April 28, 2026 21:26
@anderdc
anderdc merged commit b94066c into entrius:test Apr 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] review quality multiplier logs and DB lack observability

2 participants