OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Detect more errors in script/github_pr_errors
Christophe Bliarde31fa64855cb
diff --git a/script/github_pr_errors b/script/github_pr_errorsindex f986238410e..515bda47dd9 100755--- a/script/github_pr_errors+++ b/script/github_pr_errors@@ -11,6 +11,7 @@ require 'pry'GITHUB_API_OPENPROJECT_PREFIX = "https://api.github.com/repos/opf/openproject"RAILS_ROOT = Pathname.new(__dir__).dirname+SPEC_PATTERN = %r{^\S+ (?:rspec (\S+) #.+|An error occurred while loading (\S+)\.\r?)$}# current branchbranch_name = `git rev-parse --abbrev-ref HEAD`.strip@@ -95,19 +96,29 @@ warn " Commit SHA: #{last_test_action['head_sha']}"warn " Commit message: #{commit_message(last_test_action)}"errors = []+is_successful = trueget_cached_json(last_test_action['jobs_url']).then { |jobs_response| jobs_response['jobs'] }.select { _1['conclusion'] == 'failure' }.sort_by { _1['name'] }.each { warn " #{_1['name']}: #{_1['conclusion']}" }.each do |job|- get_log(job).scan(/^\S+ rspec (\S+) #.+$/) do |match|+ is_successful = false+ get_log(job)+ .scan(SPEC_PATTERN)+ .flatten+ .compact+ .uniq+ .sort+ .each do |match|errors << matchendend-if errors.empty?+if is_successful+ warn "All jobs successful 🎉"+elsif errors.empty?warn "No rspec errors found :-/"else- puts errors.flatten.uniq.map { "'#{_1}'" }.join(" ")+ puts errors.map { "'#{_1}'" }.join(" ")end