Skip to content

chore(ci): add SonarQube analysis (advisory) and Harbor deployment config - #23

Open
emmanuelbruno wants to merge 5 commits into
developfrom
feat/sonarqube-and-harbor
Open

emmanuelbruno wants to merge 5 commits into
developfrom
feat/sonarqube-and-harbor

Conversation

@emmanuelbruno

Copy link
Copy Markdown
Contributor

Summary

Adds SonarQube CI integration (advisory mode) and Harbor deployment configuration to the solen project.

Changes

SonarQube (advisory — does not block PRs)

  • sonar-project.properties: project key com.ebpro:solen, sources = solen-cli, scripts, features
  • .github/workflows/sonarqube.yml: full analysis workflow with:
    • Quality gate in advisory mode (continue-on-error: true) — reports issues but never fails CI
    • Coverage artifact reuse from CI Validate (with pytest fallback)
    • Main branch correctly set to develop
  • .github/workflows/ci-validate.yml: now produces coverage.xml + uploads as artifact

Harbor

  • deployments/harbor/values.yaml: Helm values for deploying a Harbor registry instance
    • Ingress: registry.ebpro.local with TLS (cert-manager)
    • Registry storage: 30Gi PVC
    • Trivy vulnerability scanner enabled
    • Passwords are CHANGE-ME placeholders (replace with secrets at deploy time)

Notes

  • SonarQube is advisory only — quality gate results are visible in CI logs and SonarQube UI but do not block merges
  • The Harbor project name (solen) will be created via Harbor API after instance deployment
  • Full jupyter-basesolen naming migration (repo rename, GHCR, 18 consumer repos) is tracked as a separate future epic

- sonar-project.properties: Python/Shell analysis scope, coverage.xml, quality gate wait
- .github/workflows/sonarqube.yml: IJava-pattern scan (PR/branch/main scan args, vars-based activation, in-cluster runner support)
- deployments/harbor/values.yaml: phase-1 Harbor Helm values (internal PG/Redis, ingress+cert-manager, Trivy on)
…icate coverage

- sonar.projectKey/projectName: jupyter-base → solen
- SONAR_MAIN_BRANCH default: main → develop
- ci-validate: add coverage + upload artifact
- sonarqube: download coverage artifact with pytest fallback
Copilot AI lite review requested due to automatic review settings September 15, 2026 11:40
Comment thread .github/workflows/sonarqube.yml Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical security concerns and multiple configuration issues remain in the SonarQube workflow and Harbor values.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds advisory SonarQube analysis and coverage reporting, plus Harbor Helm deployment configuration.

Changes:

  • Adds SonarQube project metadata and workflow.
  • Generates and uploads CI coverage artifacts.
  • Adds Harbor ingress, storage, database, Redis, and Trivy settings.
File summaries
File Description
sonar-project.properties SonarQube analysis configuration
deployments/harbor/values.yaml Harbor Helm deployment values
.github/workflows/sonarqube.yml SonarQube scanning workflow
.github/workflows/ci-validate.yml Coverage generation and artifact upload
Review details

Suppressed comments (2)

.github/workflows/sonarqube.yml:95

  • Only the quality-gate polling step is marked continue-on-error. A scanner failure (for example an unreachable SonarQube server, invalid project configuration, or analysis error) still fails this PR workflow, which contradicts the stated advisory/non-blocking behavior and can block merges if the check is required. Make the analysis path explicitly best-effort, or separate hard configuration/test failures from the advisory scan.
      - name: SonarQube Scan
        uses: sonarsource/sonarqube-scan-action@v6
        with:
          args: ${{ env.SONAR_SCAN_ARGS }}

deployments/harbor/values.yaml:16

  • Even after correcting the parent key, Harbor's TLS values use certSource (auto or secret); certManager and notAfter are not recognized chart settings. These entries therefore will not request a cert-manager certificate.
  tls:
    enabled: true
    certManager: true
    notAfter: 21d
  • Files reviewed: 4/4 changed files
  • Comments generated: 12
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

sonarqube:
name: Analyze with SonarQube
if: github.event_name == 'workflow_dispatch' || vars.SONAR_HOST_URL != '' || vars.SONAR_PUBLIC_URL != ''
runs-on: ${{ vars.SONAR_RUNNER || 'ubuntu-latest' }}
Comment thread .github/workflows/sonarqube.yml Outdated
runs-on: ${{ vars.SONAR_RUNNER || 'ubuntu-latest' }}
env:
SONAR_HOST_URL: ${{ vars.SONAR_RUNNER && vars.SONAR_HOST_URL || vars.SONAR_PUBLIC_URL || vars.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Comment thread deployments/harbor/values.yaml Outdated
Comment on lines +38 to +41
image:
registry: docker.io
repository: aquasec/trivy
tag: v0.51.2
jobs:
sonarqube:
name: Analyze with SonarQube
if: github.event_name == 'workflow_dispatch' || vars.SONAR_HOST_URL != '' || vars.SONAR_PUBLIC_URL != ''
Comment thread .github/workflows/sonarqube.yml Outdated
Comment on lines +59 to +63
uses: actions/download-artifact@v4
with:
name: coverage
path: .
github-token: ${{ github.token }}
Comment thread deployments/harbor/values.yaml Outdated
redis:
enabled: true

exposure:
notAfter: 21d
ingress:
hosts:
core: registry.ebpro.local
Comment thread deployments/harbor/values.yaml Outdated
Comment on lines +23 to +28
volumes:
- registry storage:
type: persistentVolumeClaim
persistentVolumeClaim:
size: 30Gi
accessMode: ReadWriteOnce
Comment thread deployments/harbor/values.yaml Outdated
Comment on lines +30 to +32
jobService:
jobLog:
persistentVolume:
Comment thread deployments/harbor/values.yaml Outdated
Comment on lines +44 to +45
resourcesRequests:
memory: 512Mi
- values.yaml: rewrite with correct goharbor/harbor chart keys
  (expose, database.internal, redis.internal, persistence.persistentVolumeClaim,
  externalURL, trivy severity/resources)
- sonarqube.yml: add permissions block, scope SONAR_TOKEN to scan/gate steps only,
  remove dead cross-workflow artifact download
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.

3 participants