Skip to content

Make it possible to select a subpath of cloned directory #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jun 20, 2021

Conversation

oowekyala
Copy link
Member

The schema is updated to allow specifying a subpath within the cloned directory for pmd's -d option.

This will allow using the JDK sources as a regression project. Since pmd 7, it's reasonably fast to process eg the java.base module (2800 classes), while other modules are less interesting. If we want to select which modules we want to process, we need to use the -d option sensibly.

This also makes some optimisations to the git clone command (we don't fetch repo history anymore).

Btw since openjdk is now on Github, I think we could drop support for mercurial repos entirely. I assume that was meant for openjdk at the time.

@oowekyala
Copy link
Member Author

@adangel apparently the build script fails: https://github.com/pmd/pmd-regression-tester/pull/89/checks?check_run_id=2666316095#step:6:50 see here https://github.com/pmd/pmd-regression-tester/blob/master/.ci/build.sh#L19

I might just merge this and test with the push build, and release manually

@adangel
Copy link
Member

adangel commented May 25, 2021

I might just merge this and test with the push build, and release manually

I suspect, that it won't work either. We have to fix it....

For some reason, bundler is not found, but it has just been installed....

The last run on master branch was successful: https://github.com/pmd/pmd-regression-tester/runs/2517819162?check_suite_focus=true#step:6:48

They updated the docker image from https://github.com/actions/virtual-environments/blob/ubuntu20/20210504.1/images/linux/Ubuntu2004-README.md to https://github.com/actions/virtual-environments/blob/ubuntu20/20210517.1/images/linux/Ubuntu2004-README.md but I don't see any obvious change here....

@adangel
Copy link
Member

adangel commented May 25, 2021

Maybe it's about this warning:

WARNING: You don't have /home/runner/.gem/ruby/2.7.0/bin in your PATH,
gem executables will not run.

@adangel
Copy link
Member

adangel commented May 25, 2021

Maybe we never used the bundler we just installed, but the bundler, that was already there in the system, and now maybe it's gone?

Anyway #90 looks promising....

@oowekyala
Copy link
Member Author

I suspect, that it won't work either. We have to fix it....

You're right of course ^^ I was thinking lazy

Apparently #90 fixes the problem. The build fails because of my code now

Thanks :)

@adangel adangel added this to the 1.2.0 milestone Jun 11, 2021
@adangel adangel self-assigned this Jun 17, 2021
@adangel adangel added the enhancement New feature or request label Jun 17, 2021
Copy link
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll look into the problems. I think, the error "pathspec 'checkstyle-8.10' did not match any file(s) known to git" comes now, because we clone with "depth 1" only. And we have checkstyle in multiple project-list.xml files. And once without specifying a tag, so that we clone "master", and next with the tag "checkstyle-8.10". But if we already cloned the repo, we just try to switch branches, which fails now....

@@ -19,8 +19,8 @@ fi

set -e

mvn clean test-compile
mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.txt
mvn clean test-compile -B
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, we should use -B in general for the real task as well (https://github.com/pmd/pmd/blob/master/.ci/files/project-list.xml)

adangel added a commit to adangel/pmd-regression-tester that referenced this pull request Jun 18, 2021
Make it possible to select a subpath of cloned directory pmd#89
@adangel
Copy link
Member

adangel commented Jun 18, 2021

I think this commit 5221212 solves the problem with "pathspec 'checkstyle-8.10' did not match any file(s) known to git". When using "--depth 1", the option "--single-branch" is implicitly enabled and needs to be explicitly disabled to clone all tags.

It might still fail, if we cached the cloned directory in github actions - so we might need to explicitly throw away the caches (by changing the cache key), so that pmd-regression-tester clones the projects from fresh...

@adangel
Copy link
Member

adangel commented Jun 18, 2021

This is tested successfully via pmd/pmd#3342:

openjdk-11 is now analyzed: https://chunk.io/pmd/2867956b059144beaa2ae55e85c53079/diff1/openjdk-11/index.html
In this case, only one rule (AbstractClassWithoutAbstractMethod) is executed, but the report is generated.

Note: In the baselines, this project doesn't exist yet, so all violations are considered new for now.

@adangel adangel merged commit 537cb0a into pmd:master Jun 20, 2021
@adangel adangel modified the milestone: 1.2.0 Jun 20, 2021
@oowekyala oowekyala deleted the src-subpath branch June 21, 2021 11:20
@oowekyala
Copy link
Member Author

Great, thanks for picking this up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants