Add info about Embedded GlassFish maven plugin to website (and disable tests on docs changes)#25942
Conversation
I hoped that the comments get removed automatically, not the case. I wish Github supported that. |
It's not even funny anymore :-D It's always some tests that fail. We should look into tuning the Jenkins job to skip running tests if the changes are only in the docs directory. |
|
I'm trying changes in Jenkinsfile to skip running tests if only docs change. I moved to draft for now to revent merging this PR. |
c6aa0f0 to
6a50923
Compare
|
I adjusted Jenkinsfile to skip tests if changes are only in the docs repository. With my previous commit (which contained an exception to skip tests also when Jenkinsfile is modified) it worked: https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/PR-25942/4/ Now I removed an exception for Jenkinsfile and push forced the change. Now Jenkins will run the tests again because the Jenkinsfile is changed. @dmatej @arjantijms @avpinchuk @pzygielo , please review if this is OK and you agree to disable running tests if only docs are changed. |
Jenkinsfile
Outdated
|
|
||
| def changedFiles = sh( | ||
| script: ''' | ||
| git diff --name-only origin/${CHANGE_TARGET}...HEAD || echo "all" |
There was a problem hiding this comment.
Why you grep those files when you could probably simplify that to (I used your branch to see what exactly it does):
git diff --name-only eclipse/main..ondro/ondromih-2026-03-website-egf-maven-plugin -- docs || echo "all"
And yet one problem, it seems git diff always returns 0 error code, so it never echoes "all". I tried with this:
git diff --name-only eclipse/main..eclipse/main || echo "all"
There was a problem hiding this comment.
This would work:
dmatej@dmatej-tux:~/work/repo/git/glassfish$ git diff --exit-code --name-only eclipse/main..eclipse/main -- docs && echo "all"
all
dmatej@dmatej-tux:~/work/repo/git/glassfish$ git diff --exit-code --name-only eclipse/main..ondro/ondromih-2026-03-website-egf-maven-plugin -- docs && echo "all"
Jenkinsfile
docs/website/src/main/resources/_includes/documentation-toc.html
docs/website/src/main/resources/documentation.md
--exit-code Make the program exit with codes similar to diff(1). That is, it exits with 1 if there were differences and 0 means no differences.
There was a problem hiding this comment.
If I use -- docs, then the diff is only in the docs directory. If doesn't detect if changes are both in the docs directory and somewhere else - e.g. the PR contains both code and docs changes.
I want the opposite - create a diff of all files outside of docs directory, and if there are any changed files, run teh tests, otherwise don't run them.
That's why I first list all the changes and then exclude all docs changes with grep. Though I can do it in a single step.
6b8cb2e to
9500bdb
Compare
9500bdb to
555fc93
Compare
555fc93 to
154a76d
Compare
Also modifies PR pipeline to skip running tests when the only changes are in the docs directory.