From d227cffdab1f2245497c8bfed8824579268124b1 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 9 Oct 2020 11:03:25 +0200 Subject: [PATCH] [ci] Java rule change is not detected * Use "HEAD" instead of "FETCH_HEAD" for patch branch. FETCH_HEAD might change, if another fetch is done. HEAD always points to the currently checked out commit, that has been built. * Add --patch-config to use the same config as for the baseline (see .travis/regression-tester.sh). However, currently this is ignored, when "--auto-gen-config" is used. * Use long argument names for better readability Fixes #2820 --- .travis/regression-tester.sh | 2 +- Dangerfile | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.travis/regression-tester.sh b/.travis/regression-tester.sh index e6d98f5c5b..5f44b7433b 100644 --- a/.travis/regression-tester.sh +++ b/.travis/regression-tester.sh @@ -31,7 +31,7 @@ function regression-tester_uploadBaseline() { log_info "Generating and uploading baseline for pmdtester..." cd .. bundle config --local gemfile pmd/Gemfile - pmd/.travis/travis_wait "bundle exec pmdtester -m single -r ./pmd -p ${TRAVIS_BRANCH} -pc ./pmd/.travis/all-java.xml -l ./pmd/.travis/project-list.xml -f" + pmd/.travis/travis_wait "bundle exec pmdtester --mode single --local-git-repo ./pmd --patch-branch ${TRAVIS_BRANCH} --patch-config ./pmd/.travis/all-java.xml --list-of-project ./pmd/.travis/project-list.xml --html-flag" cd target/reports BRANCH_FILENAME="${TRAVIS_BRANCH/\//_}" zip -q -r ${BRANCH_FILENAME}-baseline.zip ${BRANCH_FILENAME}/ diff --git a/Dangerfile b/Dangerfile index c91f5c6da5..93dab776cf 100644 --- a/Dangerfile +++ b/Dangerfile @@ -6,7 +6,14 @@ require 'logger' def run_pmdtester Dir.chdir('..') do - argv = ['-r', './pmd', '-b', "#{ENV['TRAVIS_BRANCH']}", '-p', 'FETCH_HEAD', '-m', 'online', '-a'] + argv = ['--local-git-repo, './pmd', + '--base-branch', "#{ENV['TRAVIS_BRANCH']}", + '--patch-branch', 'HEAD', + '--patch-config', './pmd/.travis/all-java.xml', + '--mode', 'online', + '--auto-gen-config', + # '--debug', + ] begin runner = PmdTester::Runner.new(argv) @new_errors, @removed_errors, @new_violations, @removed_violations, @new_configerrors, @removed_configerrors = runner.run