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
Make script/github_pr_error extract run_id from job url
Christophe Bliard329cb855af9e
diff --git a/script/github_pr_errors b/script/github_pr_errorsindex 3bd4793ac76..fd2c3d05a02 100755--- a/script/github_pr_errors+++ b/script/github_pr_errors@@ -34,11 +34,14 @@ class Options}.freezeBANNER = <<~BANNER.freeze- Usage: #{$0} [options]+ Usage: #{$0} [options] [url]Fetches rspec failures from last completed GitHub actions on currentbranch, and outputs them on standard output, one by line.+ If given an url, it will fetch the failures from the given url instead of+ the tip of the current branch.+Information is printed on standard error to preserve standard output.Use this script with xargs to run failing specs locally:@@ -51,7 +54,11 @@ class Optionsclass << selfdef options- @options ||= parse_options+ return @options if defined?(@options)++ @options = DEFAULTS.dup+ parse_options!+ @optionsenddef method_missing(name, *)@@ -66,8 +73,13 @@ class OptionsDEFAULTS.key?(name) || superend- def parse_options- options = DEFAULTS.dup+ def parse_options!+ options.merge!(parse_args)+ options.merge!(parse_url(ARGV.first)) if ARGV.any?+ end++ def parse_args+ options = {}opt_parser = OptionParser.new do |parser|parser.banner = BANNER@@ -100,13 +112,25 @@ class Optionsendparser.on("-v", "--verbose",- "Print more information, mostly useful for debugging") do |value|+ "Print more information, mostly useful for debugging") do |_value|options[:verbose] = trueendendopt_parser.parse!optionsend++ def parse_url(url)+ case url+ when %r{^https://github.com/opf/openproject/actions/runs/(\d+)(?:/job/\d+)?$}+ run_id = $1.to_i+ say_verbose("Extracted run id #{run_id} from #{url}")+ { run_id: }+ else+ say_verbose("Unrecognized url #{url}")+ {}+ end+ endendend