Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#156: implement calculate rejection pull request rate for repos #205

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

Yegorov
Copy link
Contributor

@Yegorov Yegorov commented Jul 30, 2024

Merge this PR fbe#48 before

@Yegorov
Copy link
Contributor Author

Yegorov commented Jul 30, 2024

@yegor256 Fail, because need first merge this PR

@yegor256
Copy link
Member

yegor256 commented Aug 1, 2024

@Yegorov good to continue here?

@Yegorov
Copy link
Contributor Author

Yegorov commented Aug 1, 2024

@yegor256 I pushed updated PR

all_q = "repo:#{repo} type:pr closed:>#{$SINCE.utc.iso8601[0..10]}"
all_prs_count += Fbe.octo.search_issues(all_q)[:total_count]

unmerged_q = "repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}"
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yegor256 Does it really look better?

unmerged_prs_count += Fbe.octo.search_issues("repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}")[:total_count]

what is it

unmerged_q = "repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}"
unmerged_prs_count += Fbe.octo.search_issues(unmerged_q)[:total_count]

And in the end I get this

judges/quality-of-service/quality-of-service.rb:114:121: C: Layout/LineLength: Line is too long. [133/120]
  unmerged_prs_count += Fbe.octo.search_issues("repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}")[:total_count]
unmerged_prs_count += Fbe.octo.search_issues(
  "repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}"
)[:total_count]

Copy link
Member

@yegor256 yegor256 left a comment

Choose a reason for hiding this comment

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

@Yegorov a few changes required

@Yegorov
Copy link
Contributor Author

Yegorov commented Aug 1, 2024

@yegor256 fixed

"repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}"
)[:total_count]
end
f.average_pull_rejection_rate =
Copy link
Member

Choose a reason for hiding this comment

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

@Yegorov if you make variable names shorter, you can write this expression in just one line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yegor256 no, 3 symbols left

judges/quality-of-service/quality-of-service.rb:114:121: C: Layout/LineLength: Line is too long. [123/120]
  rejected += Fbe.octo.search_issues("repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}")[:total_count]
                                                                                                                        ^^^

Copy link
Member

Choose a reason for hiding this comment

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

@Yegorov you don't need to check for rejected.zero?, just a check for pulls.zero? is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yegor256 ok, fixed

@Yegorov
Copy link
Contributor Author

Yegorov commented Aug 1, 2024

@yegor256 fixed

@yegor256 yegor256 merged commit 32bbe18 into zerocracy:master Aug 1, 2024
8 checks passed
@yegor256
Copy link
Member

yegor256 commented Aug 1, 2024

@Yegorov thanks!

@0crat
Copy link

0crat commented Aug 1, 2024

@Yegorov Thanks for the review! You've earned +5 points for this: +25 as a basis; -40 for reviewing your own contribution (which is a bad idea); +20 to give you at least something. Your running balance is +51.

@0crat
Copy link

0crat commented Aug 1, 2024

@Yegorov Thanks for the contribution! You've earned +20 points for this: +30 as a basis; -10 for too few (12) hits-of-code. Please, keep them coming. Your running balance is +56.

@0crat
Copy link

0crat commented Aug 10, 2024

@yegor256 Hey there! 👋 Great job on the review! You've snagged +37 points: +25 for being an awesome reviewer, and +12 for those 12 thoughtful comments you made. That's some solid work! 🌟 Just a heads up, we award points for hits-of-code too, so keep that in mind for future reviews. Your current balance is sitting at -581. Keep up the fantastic work, and let's see that balance climb! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants