I’m proposing to automatically execute sonarqube (with our sonarcloud setup) on the 3 repos of the XWiki GH organization (commons, rendering and platform) so that we can detect sonarqub issues in PRs before they’re merged.
Actually, in order to not duplicate the workflow, I’m proposing to also create a .github repo in the XWiki GH organization that will serve to host GH actions to be used across repos. This will be very useful if we want to extend this to contrib project and to avoid duplicate other actions.
We’ll still need a few lines of code in each repo but it’s a lot less:
# .github/workflows/sonar-pr.yml
name: SonarCloud PR analysis
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
analysis:
uses: xwiki/.github/.github/workflows/sonar-pr.yml@master
with:
java-version: '21' # per-repo/per-branch, the one thing that legitimately varies
secrets: inherit
Incidentally, this same move would fix an existing drift: backport.yml is duplicated in all three repos and xwiki-platform’s copy has already diverged from the identical commons/rendering pair…
I’ve now added checkstyle check for PRs too Thx for suggesting it. It’s a little less needed since you’re supposed to build and a checkstyle error would fail the build but it’s good nevertheless to have it (and doesn’t cost too much).
Note that we don’t report when a change causes a checkstyle issue elsewhere. This is rare but can happen. It’s caught by your jenkins jobs, as usual.
Short version: quality-pr.yml and backport.yml are now single reusable workflows called by a small stub in each repo, the PR template / SECURITY.md / FUNDING.yml are served org-wide, and there’s a shared Renovate preset. Two things to be aware of here: the PR check is now named Quality / Analyze instead of Analyze, and the workflow is edited in xwiki/.github from now on, not in the three repos.
@tmortagne, you were right about java-version — there’s no such input, it’s read from the pom as you expected.