diff --git a/src/main/rb/eca.rb b/src/main/rb/eca.rb index ac48d2cdbe00b23af222aa9b6eb232331c25b883..42a8ae69c394c04f156b0e0c3faaac4ced2de909 100644 --- a/src/main/rb/eca.rb +++ b/src/main/rb/eca.rb @@ -5,6 +5,21 @@ require 'json' require 'httparty' require 'multi_json' WIKI_REGEX_MATCH = /.*\.wiki$/ +HOST_URL='https://gitlab.eclipse.org' +# 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', +'/eclipse/oniro-core/linux', +'/eclipse/oniro-core/linux-meta', +'/eclipse/oniro-core/llvm-project', +'/eclipse/oniro-core/meta-arm', +'/eclipse/oniro-core/meta-av96', +'/eclipse/oniro-core/meta-binaryaudit', +'/eclipse/oniro-core/meta-clang', +'/eclipse/oniro-core/meta-openembedded', +'/eclipse/oniro-core/meta-riscv', +'/eclipse/oniro-core/meta-seco-intel', +'/eclipse/oniro-core/meta-zephyr'] ## Process the commit into a hash object that will be posted to the ECA validation service def process_commit(sha) @@ -66,7 +81,7 @@ end project_id = gl_repo[8..-1] ## Get data about project from API -project_response = HTTParty.get("https://gitlab.eclipse.org/api/v4/projects/#{project_id}", +project_response = HTTParty.get("#{HOST_URL}/api/v4/projects/#{project_id}", :headers => { 'Authorization' => 'Bearer ' + access_token }) @@ -88,6 +103,9 @@ end if (nil_or_empty(project_url)) then puts "Could not determine a web URL for project, likely not a fully-qualified project, skipping" exit 0 +elsif (ALLOW_LIST_PROJECTS.any? {|repo_namespace| "#{HOST_URL}#{repo_namespace}" == project_url}) then + puts "Found allow listed project, skipping validation" + exit 0 end ## Get all new commits for branch, relative to itself for existing branch, relative to tree for new