Skip to content

Conversation

@tuhaihe
Copy link
Member

@tuhaihe tuhaihe commented Nov 24, 2025

This commit updates the SonarQube GitHub Actions workflow to follow the officially recommended configuration. The previous workflow failed because the CFamily analyzer could not locate the generated compile_commands.json file due to an incorrect or quoted build-wrapper output path.

Changes included:

  • Align workflow steps with SonarSource’s recommended sequence.
  • Ensure build-wrapper-linux-x86-64 correctly produces output under $BUILD_WRAPPER_OUT_DIR.

This update should allow the C/C++ analysis to run successfully and avoid exit code 3 errors in future SonarQube scans.

Fixes #1449

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@tuhaihe tuhaihe force-pushed the fix-sonarqube-error branch from 88f9024 to e3877cf Compare November 24, 2025 02:52
@tuhaihe tuhaihe force-pushed the fix-sonarqube-error branch 2 times, most recently from 269ddcb to 3a27431 Compare December 3, 2025 10:02
Copy link

@xtangcode xtangcode left a comment

Choose a reason for hiding this comment

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

LGTM

@tuhaihe tuhaihe force-pushed the fix-sonarqube-error branch from 3a27431 to 591c47e Compare December 12, 2025 08:27
The SonarQube weekly analysis workflow was failing due to a missing
`compile_commands.json` file. This occurs because the build-wrapper
output directory was previously referenced with an incorrect path
containing an unintended quotation mark, causing the CFamily plugin
to abort with a NoSuchFileException.

This change fixes the failure by aligning the workflow with
SonarCloud recommended usage.

Additionally, this commit updates the workflow triggers and
execution conditions:

- Added explicit triggers for push/PR events when the workflow
  file itself is modified, enabling validation of workflow
  changes
- Allow PRs to validate the build process while preventing unauthorized
  SonarCloud access

The workflow will now:
- Run all build steps in PRs for validation purposes
- Execute SonarQube scans only on:
  * Weekly scheduled runs (apache/cloudberry only)
  * Manual workflow dispatch (apache/cloudberry only)
  * Push to main branch when workflow file changes
    (apache/cloudberry only)
@tuhaihe tuhaihe force-pushed the fix-sonarqube-error branch from 591c47e to 08f6b25 Compare December 14, 2025 12:58
@tuhaihe tuhaihe merged commit c9ca88d into apache:main Dec 14, 2025
61 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Sonarqube Analysis workflow error

3 participants