Skip to content

SBCOSS-496: Sunbird Knowlg-search-indexer - add the GitHub actions to run test cases and code quality checks when a PR raised #819

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

Conversation

chethann007
Copy link
Collaborator

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

-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

@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

This PR introduces a GitHub Actions workflow to automatically build, test, generate coverage reports, and run SonarQube analysis on the search-indexer module whenever a PR is opened. It also updates the test configuration to load schema settings from an environment variable.

  • Replace hard-coded schema settings in test.conf with an environment-driven block.
  • Add a new coverage-search-indexer job in .github/workflows/pr-actions.yml to run Maven tests, generate JaCoCo reports, and execute SonarQube analysis.

Reviewed Changes

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

File Description
search-indexer/src/test/resources/test.conf Remove static schema block and reference SCHEMA_BASE_PATH env var
.github/workflows/pr-actions.yml Add coverage-search-indexer job with build, test, coverage, and Sonar steps
Comments suppressed due to low confidence (3)

search-indexer/src/test/resources/test.conf:42

  • [nitpick] Consider documenting the expected format or providing a default value for 'SCHEMA_BASE_PATH' to avoid runtime misconfiguration when the environment variable is unset.
  basePath = ${?SCHEMA_BASE_PATH}

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

  • Include 'SCHEMA_BASE_PATH' in the environment and pass it as a Maven property (e.g., -DSCHEMA_BASE_PATH=$SCHEMA_BASE_PATH) during the SonarQube analysis step to ensure consistency with the test configuration.
      - name: Run SonarQube Analysis for search-indexer

search-indexer/src/test/resources/test.conf:41

  • [nitpick] Align the indentation of the newly added 'schema' block with the surrounding configuration entries (e.g., two spaces) for consistency and readability.
schema {

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

@chethann007 chethann007 changed the title SBCOSS-489: Sunbird Knowlg-search-indexer - add the GitHub actions to run test cases and code quality checks when a PR raised SBCOSS-501: Sunbird Knowlg-search-indexer - add the GitHub actions to run test cases and code quality checks when a PR raised Jun 20, 2025
@chethann007 chethann007 changed the title SBCOSS-501: Sunbird Knowlg-search-indexer - add the GitHub actions to run test cases and code quality checks when a PR raised SBCOSS-496: Sunbird Knowlg-search-indexer - add the GitHub actions to run test cases and code quality checks when a PR raised Jun 20, 2025
@pallakartheekreddy pallakartheekreddy merged commit 7c78fc2 into release-8.0.0 Jun 20, 2025
4 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