Skip to content

chore: Implement Coverage Evaluation on Feature Branch Against Main PQE-407#82

Open
ykaiboussiSO wants to merge 10 commits into
mainfrom
PQE-407-Test-Coverage
Open

chore: Implement Coverage Evaluation on Feature Branch Against Main PQE-407#82
ykaiboussiSO wants to merge 10 commits into
mainfrom
PQE-407-Test-Coverage

Conversation

@ykaiboussiSO
Copy link
Copy Markdown
Contributor

@ykaiboussiSO ykaiboussiSO commented May 19, 2026

Description

Resolves: PQE-407

Type of Change

  • Chore (a change that does not modify the application functionality)
  • Bug fix (a change that fixes an issue)
  • New feature / enhancement (a change that adds new functionality)
  • Refactor (no behaviour change)
  • Test coverage
  • Build / CI / tooling
  • Documentation

Testing

Verified coverage evaluation against main branch after running make test within feature branch


  shell: /usr/bin/bash -e {0}
  env:
    current_coverage: 50.5
    main_coverage: 50.5
Coverage is within the limits

  • Unit tests added / updated
  • Integration tests added / updated
  • Full test suite run (make test_all with CONNECTION_STRING set)

Screenshots (if appropriate):

Driver Impact

  • PostgreSQL driver (drivers/pg)
  • Neo4j driver (drivers/neo4j)

Checklist

  • Code is formatted
  • All existing tests pass
  • go.mod / go.sum are up to date if dependencies changed

Summary by CodeRabbit

  • Chores
    • Enhanced CI/CD pipeline with pinned action versions for improved reproducibility and security.
    • Implemented automated code coverage validation to ensure feature branches meet main branch coverage standards.
    • Streamlined integration test execution through standardized build commands.

Review Change Stack

@ykaiboussiSO ykaiboussiSO self-assigned this May 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Walkthrough

GitHub Actions workflows are enhanced with coverage regression detection via a new reusable workflow that uploads main-branch coverage artifacts. The test job compares feature-branch coverage against main and fails if the value decreases. Integration tests are migrated to use make targets instead of direct Go commands, and action versions across workflows are pinned to specific commit SHAs for reproducibility.

Changes

CI Coverage Validation and Integration Test Migration

Layer / File(s) Summary
Coverage artifact upload and comparison
​.github/workflows/upload-coverage-files.yml, .github/workflows/go-test.yml
New reusable upload-coverage-files workflow runs make test on main branch, uploads coverage artifact, and outputs artifact ID. Main test job depends on this workflow, parses feature-branch coverage, downloads main coverage, and conditionally fails if feature coverage is below main coverage using bc.
Integration test migration to make targets
​.github/workflows/go-test.yml
PostgreSQL and Neo4j integration test jobs replace go test -tags manual_integration ./integration with make test_integration command.
Action version pinning for reproducibility
​.github/workflows/go-test.yml, .github/workflows/run-static-analysis.yml
actions/checkout and actions/setup-go are pinned to specific commit SHAs across PostgreSQL integration, Neo4j integration, and static analysis workflow jobs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A rabbit hops through workflows bright,
Coverage tracked from left to right,
Actions pinned for steady ground,
Integration tests now make their sound! 🐰✨
Regressions caught, none shall pass,
Workflows flow like clover grass.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The pull request description follows the template structure with issue reference, type of change, testing details, and checklist items. However, it lacks a detailed explanation of what the PR does and its motivation. Add a brief explanation of the changes in the Description section beyond just the ticket reference. Describe what coverage evaluation logic was implemented and why it matters.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing coverage evaluation on feature branches against main, which directly matches the workflow modifications adding coverage comparison logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch PQE-407-Test-Coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/go-test.yml:
- Line 81: The conditional currently uses `(( echo "$current_coverage <
$main_coverage" | bc -l ))`, which is invalid; change the condition to use
command substitution so the pipeline is evaluated first, e.g. wrap the pipeline
in `$()` so the `if` becomes `if (( $(echo "$current_coverage < $main_coverage"
| bc -l) )); then`; update the `if` that references `current_coverage` and
`main_coverage` accordingly to use this form.

In @.github/workflows/upload-coverage-files.yml:
- Line 24: The workflow output mapping uses
workflow_call.outputs.coverage-artifact-id but points to the wrong job id;
update the output reference to pull from the actual job id
jobs.upload-main-coverage-files (e.g., change the value expression that
currently uses jobs.upload-coverage-files.outputs.coverage-artifact-id to
jobs.upload-main-coverage-files.outputs.coverage-artifact-id) so callers of
workflow_call can access the correct coverage-artifact-id output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ea70014a-6aa4-4d67-a86d-7a9f0c6e294b

📥 Commits

Reviewing files that changed from the base of the PR and between 25407d6 and e305d3d.

📒 Files selected for processing (3)
  • .github/workflows/go-test.yml
  • .github/workflows/run-static-analysis.yml
  • .github/workflows/upload-coverage-files.yml

Comment thread .github/workflows/go-test.yml Outdated
Comment thread .github/workflows/upload-coverage-files.yml Outdated
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