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

(#213) queue PR update if status is pending #215

Merged
merged 1 commit into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Metrics/ClassLength:
# Offense count: 1
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 10
Max: 11

# Offense count: 15
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
Expand All @@ -40,7 +40,7 @@ Metrics/ParameterLists:
# Offense count: 1
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 8
Max: 9

# Offense count: 2
# Configuration parameters: Include.
Expand Down
4 changes: 2 additions & 2 deletions app/models/pull_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def validate
status_result = validate_status

# If one of the checks is nil perform a new check in one minute
return if mergeable_result && status_result
return if mergeable_result && (!status_result.nil? || status != 'pending')

RefreshPullRequestWorker.perform_in(1.minute.from_now, repository.name, number)
end
Expand All @@ -181,7 +181,7 @@ def validate
# validate() might use update() to change attributes which would trigger a new job
# To prevent loops, we filter `saved_changed` of those attributes and won't create new job if those are the only changed attributes
def queue_validation
force = mergeable.nil? || status.nil?
force = mergeable.nil? || status.nil? || status == 'pending'

case saved_changes.stringify_keys.keys.sort
when %w[eligible_for_merge_comment eligible_for_ci_comment].sort
Expand Down