diff --git a/src/main/rb/eca.rb b/src/main/rb/eca.rb index d5207e8d7241b407418af7a06f92d3d206ea7923..c4436333e6e9c3b1ca01e2645382269eef529d60 100644 --- a/src/main/rb/eca.rb +++ b/src/main/rb/eca.rb @@ -7,6 +7,7 @@ require 'multi_json' WIKI_REGEX_MATCH = /.*\.wiki$/ HOST_URL='https://gitlab.eclipse.org' API_URL='https://api.eclipse.org' +LARGE_COMMIT_SET_THRESHOLD=15 # this should be removed as soon as Oniro is onside again ALLOW_LIST_PROJECTS = ['/eclipse/oniro-core/meta-ts', '/eclipse/oniro-core/meta-ledge-sesure', @@ -138,6 +139,8 @@ diff_git_commits = diff_git_commits_raw.split(/\n/) if (diff_git_commits.empty?) then puts "There are no commits to validate for current push, skipping validation step" exit 0 +elsif (diff_git_commits.length() > LARGE_COMMIT_SET_THRESHOLD) then + puts "The following push has a large number of commits (#{diff_git_commits.length()}), and may have a delay in response or timeout for very large sets" end processed_git_data = [] @@ -165,6 +168,10 @@ begin parsed_response = MultiJson.load(response.body) rescue MultiJson::ParseError puts "GL-HOOK-ERR: Unable to validate commit, server error encountered.\n\nPlease contact the administrator, and retry the commit at a later time.\n\n" + ## If a large commit set, this could be a timeout, and may be resolved through a second attempt after a short delay + if (diff_git_commits.length() > LARGE_COMMIT_SET_THRESHOLD) then + puts "The following push had a large commit set and may have timed out in processing. In this case, after a short delay (~1 minute), a second attempt can be made which may resolve the issue. If the issue is still not resolved, see above message." + end ## Additional information for debugging - request will allow us to easily retest exact output and find errors in render puts "Request body: #{MultiJson.dump(json_data)}\n\n" exit 1