Hi all,

Quick update on the first step I mentioned earlier (making SonarCloud PR
checks evaluate only the issues introduced by each PR). I have opened a PR
for review:

https://github.com/apache/iotdb/pull/19355

While investigating why PRs were failing on pre-existing master issues, I
found two root causes in .github/workflows/sonar-codecov.yml:

1. Shallow clone without the base branch ref: actions/checkout@v5 used the
default fetch-depth: 1, so the Sonar scanner could not find origin/master
or compute git blame / changed lines ("Could not find ref 'master'",
"Shallow clone detected"). As a result, SonarCloud fell back to comparing
against the last analyzed master snapshot and treated entire differing
files (including unrelated commits merged to master) as "New Code".
2. master push scans were hitting OOM: MAVEN_OPTS did not configure -Xmx,
so full master scans had been failing with OutOfMemoryError: Java heap
space under the default JVM heap, leaving the master baseline on SonarCloud
stale.

In PR #19355:
- Enabled fetch-depth: 0 (and ensured refs/remotes/origin/<base_ref> is
available) so SonarCloud's native PR diff, changed-lines detection, and git
blame work properly.
- Scoped PR Sonar builds to only the Maven modules whose main Java sources
changed in the PR diff (-pl <changed-modules> -am), skipping the scan when
no analyzable main Java files are modified, and removed the unused -P
with-integration-tests,with-code-coverage profiles.
- Kept full push-triggered Sonar scans on master (and dev/1.3) with -Xms2g
-Xmx8g so the baseline and server-side cache stay up to date without
hitting OOM.

Could you please take a look and review PR #19355? Once this is merged (and
backported to dev/1.3), PR checks should only report issues on lines
touched by each PR, and we can follow up by cleaning up existing SonarCloud
findings module by module in small PRs.

Best regards,
Yuan

On Sun, Nov 22, 2026 at 9:23 AM Yuan Tian <[email protected]> wrote:

> Hi Chris,
>
> Thanks for raising this, and for taking the time to fix some of those
> issues yourself. I agree that when PRs keep going red for problems already
> on master, people start ignoring CI failures. We’ve been focused on new
> features and performance improvements, and we haven’t given the SonarCloud
> findings enough attention.
>
> I think SonarCloud is worth keeping. Could we make the check fail a PR
> only for issues that PR introduces? If we can’t do that right away, I’d
> suggest temporarily having SonarCloud report findings without failing CI on
> master or on PRs targeting it. We could restore the full check once we’ve
> fixed the issues behind the current failures.
>
> Since the cleanup touches a lot of files, I’d suggest splitting it into
> small PRs, each focused on one module. It would help if we could review
> each one promptly and merge it into master once it’s ready. That way,
> fixes land as we go, and we avoid having to repeatedly resolve conflicts in
> one large, long-lived PR.
>
> Would that approach work for everyone?
>
> On Fri, Nov 20, 2026 at 8:36 PM Christofer Dutz via dev <
> [email protected]> wrote:
>
>> Hi all,
>>
>> this has now happened multiple times over the last few weeks.
>> I create a PR and it goes red because of sonarcube finding which were on
>> master from the beginning and then they are not addressed immediately.
>> I think in one case I simply provided a PR to fix them as nobody seems to
>> have been fixing them.
>>
>> This is not how CI should be done.
>>
>> Either a red build needs to get fixed as soon as possible or we should
>> probably disable the SonarCloud checks.
>>
>> What's your opinion on this?
>>
>> I think a constantly red CI pipeline makes people ignore build-failure
>> emails ... we've had the same in PLC4X and I would prefer to not live with
>> that for so long.
>>
>> Chris
>
>

Reply via email to