Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
Fix startup error if no pull request triggers are defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
armcburney committed Jul 10, 2018
1 parent 2410b69 commit 5ace7d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions launch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ def self.run_pending_github_builds(projects: nil, github_service: nil)
logger.debug("Searching all projects for commits with pending status that need a new build")
# For each project, rerun all builds with the status of "pending"
projects.each do |project|
# Don't enqueue builds for the open pull requests if we don't have a pull request trigger defined for it
next if project.find_triggers_of_type(trigger_type: :pull_request).first.nil?

pending_build_shas_needing_rebuilds = Services.build_service.pending_build_shas_needing_rebuilds(
project: project
)
Expand Down Expand Up @@ -284,6 +287,9 @@ def self.run_pending_github_builds(projects: nil, github_service: nil)
def self.enqueue_builds_for_open_github_prs_with_no_status(projects: nil, github_service: nil)
logger.debug("Searching for open PRs with no status and starting a build for them")
projects.each do |project|
# Don't enqueue builds for the open pull requests if we don't have a pull request trigger defined for it
next if project.find_triggers_of_type(trigger_type: :pull_request).first.nil?

# TODO: generalize this sort of thing
credential_type = project.repo_config.provider_credential_type_needed

Expand Down

0 comments on commit 5ace7d0

Please sign in to comment.