Skip to content

SBCOSS-519 : Sunbird-Lern - data-pipeline - add the GitHub actions to run test cases and code quality checks when a PR raised#204

Merged
pallakartheekreddy merged 10 commits intorelease-8.0.0from
test-fixes-and-github-actions
Jun 23, 2025
Merged

SBCOSS-519 : Sunbird-Lern - data-pipeline - add the GitHub actions to run test cases and code quality checks when a PR raised#204
pallakartheekreddy merged 10 commits intorelease-8.0.0from
test-fixes-and-github-actions

Conversation

@chethann007
Copy link
Collaborator

@chethann007 chethann007 commented Jun 23, 2025

This PR adds a GitHub Actions workflow for PR code coverage and quality checks to the data-pipeline 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.

Description by Korbit AI

What change is being made?

Add GitHub Actions to execute test cases and perform code quality checks using SonarQube analysis when a pull request is raised in the "Sunbird-Lern" data-pipeline project.

Why are these changes being made?

These changes are implemented to automate the testing and code quality verification process, ensuring better reliability and maintainability of the codebase. By using GitHub Actions, we streamline continuous integration by automatically running tests and providing code quality insights, which facilitates faster feedback and improves code quality. Additionally, environment variable configuration is made more flexible by parameterizing paths using external configuration files.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

-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
- some of the blob values were still hardcoded and that was causing test cases to fail so made those values to be picked from configurations
- the configurations of the test cases will be now picked from env
- some of the blob values were still hardcoded and that was causing test cases to fail so made those values to be picked from configurations
- the configurations of the test cases will be now picked from env
…ity checks for qrcode-image-generator flink job
…ity checks for qrcode-image-generator flink job
…ity checks for qrcode-image-generator flink job
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

I've completed my review and didn't find any issues... but I did find this owl.

 ,_,
(.,.)
(   )
-"-"---

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
40.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Copy link

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

This PR introduces a GitHub Actions workflow to automate building, testing, coverage reporting (via JaCoCo), and SonarQube analysis on every pull request, and refactors existing tests to load resource URLs and schema paths from a shared base-test.conf configuration.

  • Parameterized test URLs and schema base path via base-test.conf instead of hardcoded values.
  • Updated HTTPUtilSpec and DefinitionCacheTestSpec to load configuration entries.
  • Added pr-actions.yml workflow for PR triggers, Maven caching, test reports, and SonarCloud analysis.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
jobs-core/src/test/scala/org/sunbird/spec/HTTPUtilSpec.scala Swapped hardcoded blob URLs for imagePath/videoPath from config
jobs-core/src/test/scala/org/sunbird/spec/DefinitionCacheTestSpec.scala Swapped hardcoded schema path for schema.basePath from config
jobs-core/src/test/resources/base-test.conf Added optional env var keys for schema.basePath, contentImagePath, and contentVideoPath
.github/workflows/pr-actions.yml New workflow for building, testing, coverage, and SonarQube on PRs
Comments suppressed due to low confidence (3)

jobs-core/src/test/scala/org/sunbird/spec/HTTPUtilSpec.scala:62

  • [nitpick] Duplicate test description downloadFile may cause ambiguity in test reports; consider giving each test a unique description.
  "downloadFile" should "download file with lower case name" in {

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

  • [nitpick] The workflow repeats very similar steps across multiple jobs; consider using YAML anchors or a composite action to DRY up the configuration and ease future maintenance.
  # Parallel jobs: The following jobs run in parallel after the first job completes

jobs-core/src/test/scala/org/sunbird/spec/DefinitionCacheTestSpec.scala:10

  • Missing import statements for Config and ConfigFactory; add import com.typesafe.config.{Config, ConfigFactory} so the test compiles successfully.
  val config: Config = ConfigFactory.load("base-test.conf")

@pallakartheekreddy pallakartheekreddy merged commit 7b8b679 into release-8.0.0 Jun 23, 2025
10 of 13 checks passed
@pallakartheekreddy pallakartheekreddy deleted the test-fixes-and-github-actions branch June 23, 2025 09:07
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