Skip to content

SBCOSS-501: Sunbird Knowlg-qrcode-image-generator - add the GitHub actions to run test cases and code quality checks when a PR raised #820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2025

Conversation

chethann007
Copy link
Collaborator

This PR adds a GitHub Actions workflow for PR code coverage and quality checks to the qrcode-image-generator flink job of Sunbird-Knowlg repository.

PR Code Coverage

  • Triggers: When a pull request is created against any branch.
  • Functionality:
    • Builds the project
    • Runs unit tests
    • Generates a coverage report using JaCoCo
    • Performs static code analysis with SonarQube

This workflow ensures that every proposed change is validated for code quality and coverage before merging.

…ity checks for qrcode-image-generator flink job
-the blob URL's which were in the configurations had been deleted so made the config values of test cases to be picked from env
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
77.9% Coverage on New Code (required ≥ 80%)
3.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Introduces a GitHub Actions workflow to validate code coverage and quality for the qrcode-image-generator module.

  • Adds environment-driven settings (CLOUD_STORAGE_CONTAINER, SCHEMA_BASE_PATH) to test.conf.
  • Defines a new coverage-qrcode-image-generator job in .github/workflows/pr-actions.yml to build, test, generate JaCoCo reports, and run SonarQube analysis.
  • Caches Maven artifacts and publishes test summaries.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
qrcode-image-generator/src/test/resources/test.conf Added CLOUD_STORAGE_CONTAINER and schema entries from env vars.
.github/workflows/pr-actions.yml New CI job for build, test (with coverage), and SonarQube analysis.
Comments suppressed due to low confidence (4)

qrcode-image-generator/src/test/resources/test.conf:35

  • [nitpick] The configuration keys mix camelCase (e.g. indexImageUrl) and snake_case (e.g. cloud_storage_container); consider picking a single convention for consistency.
indexImageUrl = false

.github/workflows/pr-actions.yml:334

  • The initial test goal runs before the Jacoco agent is attached. Move org.jacoco:jacoco-maven-plugin:prepare-agent immediately after clean and remove the redundant test invocation to ensure coverage is recorded.
          mvn clean test \

.github/workflows/pr-actions.yml:311

  • [nitpick] Java setup steps for JDK11 and JDK17 are duplicated; consider using a matrix strategy or a reusable workflow to DRY up version-specific setup.
      - name: Set up JDK11

.github/workflows/pr-actions.yml:331

  • [nitpick] You might enforce a minimum coverage threshold (e.g., via jacoco:check or a Sonar quality gate) to block merges that reduce overall test coverage.
      - name: Build and Generate Coverage Report

@pallakartheekreddy pallakartheekreddy merged commit f587bdd into release-8.0.0 Jun 23, 2025
5 of 6 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.

2 participants