From 0d5f6ed2303c70ebcdc3f8f556171c674ae44fd2 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Sun, 7 Jul 2024 10:11:26 +0300 Subject: [PATCH] #71 reward only when merged --- .../code-review-was-rewarded.rb | 5 +++++ judges/code-review-was-rewarded/reward-review.yml | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/judges/code-review-was-rewarded/code-review-was-rewarded.rb b/judges/code-review-was-rewarded/code-review-was-rewarded.rb index a774c57b..cdb8fdcf 100644 --- a/judges/code-review-was-rewarded/code-review-was-rewarded.rb +++ b/judges/code-review-was-rewarded/code-review-was-rewarded.rb @@ -35,6 +35,11 @@ (exists repository) (exists who) (eq is_human 1) + (join 'merged_when<=when' (and + (eq what 'pull-was-merged') + (eq issue $issue) + (eq repository $repository))) + (exists merged_when) (empty (and (eq what '#{$judge}') (eq where $where) diff --git a/judges/code-review-was-rewarded/reward-review.yml b/judges/code-review-was-rewarded/reward-review.yml index d7c78adb..907247e1 100644 --- a/judges/code-review-was-rewarded/reward-review.yml +++ b/judges/code-review-was-rewarded/reward-review.yml @@ -28,6 +28,14 @@ input: what: pmp area: hr days_to_reward: 99999 + - + _id: 3 + what: pull-was-merged + where: github + issue: 42 + repository: 100 + who: 4535 + when: 2024-05-20T23:54:24Z - _id: 1 cause: @@ -46,7 +54,7 @@ input: The bug was accepted some time ago, this is why this fact is here. The bug was accepted some time ago, this is why this fact is here. expected: - - /fb[count(f)=3] + - /fb[count(f)=4] - /fb/f[what='code-review-was-rewarded'] - /fb/f[who='4444'] - /fb/f[issue='42']