Skip to content

Extract codecov upload into a separate workflow#4668

Merged
arkid15r merged 5 commits into
OWASP:feature/ci-cd-optimizationfrom
ahmedxgouda:ci/code-cov
May 13, 2026
Merged

Extract codecov upload into a separate workflow#4668
arkid15r merged 5 commits into
OWASP:feature/ci-cd-optimizationfrom
ahmedxgouda:ci/code-cov

Conversation

@ahmedxgouda
Copy link
Copy Markdown
Collaborator

@ahmedxgouda ahmedxgouda commented May 13, 2026

Proposed change

Resolves #4667

Extracted codecov upload into a separate workflow

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran make check-test locally: all warnings addressed, tests passed
  • I used AI for code, documentation, tests, or communication related to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e3fb2a0a-cb23-479c-aea9-2bb7f78e74f0

📥 Commits

Reviewing files that changed from the base of the PR and between f0d3f6a and df64c69.

📒 Files selected for processing (2)
  • .github/workflows/run-backend-tests.yaml
  • .github/workflows/upload-coverage-to-codecov.yaml

Summary by CodeRabbit

  • Chores
    • Refactored CI/CD infrastructure by introducing a reusable workflow for coverage reporting to improve maintainability of the backend testing pipeline.
    • Enhanced the coverage upload process with stricter permission controls and improved failure handling for more reliable test coverage reporting.

Walkthrough

Extracts Codecov coverage upload into a reusable GitHub Actions workflow (upload-coverage-to-codecov) and updates run-backend-tests.yaml to call that workflow with artifact and coverage path/flag inputs instead of performing inline download/upload steps.

Changes

Codecov Coverage Upload Refactoring

Layer / File(s) Summary
Reusable Codecov upload workflow
.github/workflows/upload-coverage-to-codecov.yaml
New reusable workflow (workflow_call) defines required inputs for artifact_name, artifact_path, coverage_path, optional coverage_flags (default ''), sets minimal permissions, checks out the repo, downloads the named artifact to the provided path, and uploads the specified coverage file to Codecov with use_oidc: true and fail_ci_if_error: true; job timeout 5 minutes.
Backend test workflow integration
.github/workflows/run-backend-tests.yaml
Replaces inline artifact download and codecov/codecov-action invocation with a uses: ./.github/workflows/upload-coverage-to-codecov.yaml call, passing artifact_name: coverage-xml, artifact_path: backend, coverage_path: backend/coverage.xml, and coverage_flags: backend; reduces job permissions to contents: read and id-token: write.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • OWASP/Nest#3452: Overlaps with earlier addition of inline Codecov upload steps that this change extracts into a reusable workflow.
  • OWASP/Nest#4635: Related restructuring of backend tests workflow coverage upload logic that this PR delegates to a reusable workflow.

Suggested labels

backend

Suggested reviewers

  • arkid15r
  • kasya
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: extracting codecov upload into a separate workflow, which directly aligns with the primary objective of the changeset.
Description check ✅ Passed The description references issue #4667 and explains the change (extracting codecov upload into a separate workflow), which relates directly to the changeset modifications.
Linked Issues check ✅ Passed The PR fully implements the requirement from issue #4667 to extract codecov into a separate, reusable workflow with configurable inputs (artifact_name, artifact_path, coverage_path, coverage_flags).
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective: extracting codecov upload into a reusable workflow by modifying the main workflow and creating a new reusable workflow file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@github-actions github-actions Bot added the ci label May 13, 2026
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 13, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-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.

0 issues found across 1 file (changes from recent commits).

Copy link
Copy Markdown
Contributor

@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: 1

🤖 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/upload-coverage-to-codecov.yaml:
- Around line 33-38: Add a repository checkout step before uploading coverage so
Codecov can map reports to source and read .codecov.yml: insert a step named
like "Checkout repository" using actions/checkout@v4 (or `@v3`) prior to the
Codecov upload (and before the "Download coverage artifact" step if upload
happens after it), and set fetch-depth: 0 to ensure full commit history and
branch/PR context is available.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: af377cbd-b1c8-4925-ad44-0f1555a39ef7

📥 Commits

Reviewing files that changed from the base of the PR and between f9ac93a and f1eb3fc.

📒 Files selected for processing (2)
  • .github/workflows/run-backend-tests.yaml
  • .github/workflows/upload-coverage-to-codecov.yaml

Comment thread .github/workflows/upload-coverage-to-codecov.yaml
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.92%. Comparing base (f9ac93a) to head (df64c69).

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##           feature/ci-cd-optimization    #4668   +/-   ##
===========================================================
  Coverage                       98.92%   98.92%           
===========================================================
  Files                             528      528           
  Lines                           16968    16968           
  Branches                         2364     2364           
===========================================================
  Hits                            16785    16785           
  Misses                             98       98           
  Partials                           85       85           
Flag Coverage Δ
backend 99.50% <ø> (ø)
frontend 97.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9ac93a...df64c69. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-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.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/upload-coverage-to-codecov.yaml">

<violation number="1" location=".github/workflows/upload-coverage-to-codecov.yaml:35">
P1: The added checkout step is missing `contents: read` permission for `GITHUB_TOKEN`, which can break this workflow at runtime.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Comment thread .github/workflows/upload-coverage-to-codecov.yaml
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 13, 2026
@ahmedxgouda ahmedxgouda marked this pull request as ready for review May 13, 2026 14:59
@arkid15r arkid15r added the gsoc2026:ahmedxgouda ahmedxgouda's GSoC 2026 related work label May 13, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 13, 2026
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 13, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-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.

0 issues found across 1 file (changes from recent commits).

@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-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.

0 issues found across 2 files (changes from recent commits).

Copy link
Copy Markdown
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM

@arkid15r arkid15r merged commit 2ed4bba into OWASP:feature/ci-cd-optimization May 13, 2026
40 of 41 checks passed
@ahmedxgouda ahmedxgouda deleted the ci/code-cov branch May 14, 2026 04:32
arkid15r added a commit that referenced this pull request Jun 6, 2026
* Extract checks and security scan from `run-ci-cd.yaml`  (#4623)

* Extract checks

* Remove docker layer from cspell

* Give read permission to the checks

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Update pnpm

* Extract backend tests workflow and remove docker layer (#4635)

* Extract backend tests workflow and remove docker layer

* Add permissions

* Add FORCE_COLOR env

* Fix ordering

* Optimize dependecies installation

* Update cache path and comments identation

* Remove dead code

* Update code

* Update permissions

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Extract codecov upload into a separate workflow (#4668)

* Extract codecov upload to a separate workflow

* Add permissions

* Add checkout

* Update code

* Add back the checkout step

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Remove docker layer from fuzz tests workflow (#4663)

* Remove docker layer from fuzz tests and setup-backend-environment workflow

* Update code

* Update code

* Add poetry run in entrypoint.fuzz.sh

* Update code

* Update code

* Refactor

* Update code

* Apply rabbit's suggestions

* Remove redundant BACKEND_PORT from migartion step

* Update caching

* Disable collecting coverage for fuzz tests

* Reorder steps in setup-backend-environment action

* Apply suggestions

* Remove code-quality-checks dependency temporarily

* Update code

* Update code

* Add run-code-quality-checks dependency

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Remove update_nest_test_images.yaml (#4691)

* Extract infrastructure tests into a separate workflow (#4679)

* Extract infrastructure tests

* Remove the code-quality-checks dependency temporarily

* Apply rabbit suggestions and fix terraform error

* Add caching

* Reorder

* Update path

* Add code-quality-checks as dependency

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Extract frontend tests into a separate workflow (#4681)

* Extract tests and remove docker layer

* Update code

* Update code

* Update permissions

* Remove code-quality-checks dependency temporarily

* Update permissions

* Update code

* Add caching

* Add run-code-quality-checks dependency

* Update code

* Reorder

* Update code

* Update code

* Update code

* Update code

* Update caching

* Update caching

* Refactor

* Add checkout

* Update setup-frontend-environment action description

* Update code

* Remove redundant manual caching step

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Extract e2e tests into a separate workflow (#4687)

* Extract e2e tests into a separate workflow

* Remove docker layer from frontend

* Use custom action

* Update code

* Add next.js caching

* Remove docker layer from e2e tests

* Update code

* Add e2e dependencies installation step

* Add playwright installation and caching

* Update code

* Update code

* Update envs

* Update code

* Update playwright config and add upload artifact step

* Pin service container images by digest

* Update e2e tests name

* Apply rabbit suggestions

* Fix syntax

* Update code

* Add playwright apt caching

* Try playwright container

* Fix pipx

* Drop set up Python cache

* Bump playwright version

* Update code

* Update install poetry action

* Update code

* Update code

* Update browsers

* Update code

* Revert some changes

* Clean up some steps

* Try chromium only

* Update code

* Add logs

* Update smoke test

* Update code

* Update code

* Clean up code

* Bump workers count

* Revert workers number change

* Rebalance CPUs

* More CPUs to playwright

* Update code

* Update code

* Update code

* Remove apt caching

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Extract set-release-version into a separate workflow (#4693)

* Extract set-release-version

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Extract build-images into a separate reusable worflow (#4709)

* Extract build-images

* Update build-production-images

* Update code

* Remove unused docker hub

* Update code

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Fix e2e and fuzz errors

* Extract run-lighthouse-ci into a separate reusable workflow (#4807)

* Extract run-lighthouse-ci into a separate reusable workflow

* Update .github/workflows/run-lighthouse-ci.yaml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Extract run-zap-baseline-scan into a reusable workflow (#4808)

* Extract run-zap-baseline-scan into a reusable workflow

* Update code

* Extract bootstrap-nest-infrastructure into a separate workflow (#4711)

* Extract bootstrap-infrastructure

* Update CI/CD

* Update CI/CD

* Add terraform caching

* Refactor terraform bootstraping

* Update code

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Extract scan-images into a separate workflow (#4710)

* Extract scan-images

* Update scan-production-images

* Update code

* Update Trivy caching

* Apply cubic suggestion

* Update code

* Update code

* Refactor trivy

* Update code

* Update code

* Update code

* Update code

* Update code

* Update code

* Update code

* Update code

* Revert "Upload SBOM action creation"

This reverts commit 51132e4.

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Extract deploy-nest into a separate reusable workflow (#4818)

* Extract deploy-nest into a separate reusable workflow

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Extract staging (#4701)

* Extract production jobs into a separate workflow (#4826)

* Extract production jobs into a separate workflow

* Reorder

Update pnpm

* Generalize production and staging workflows (#4835)

* Generalize production and staging workflows

* Reorder

* Extract checks and tests into a reusable workflow and update run-ci-cd

* Update run-fuzz-tests.yaml

* Update code

* Update code

* Update naming

* Update code

* Update code

* Update e2e/playwright.config.ts

* Update code

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Finalize feature/ci-cd-optimization merge

* Address review comments

* Update secrets handling

* Fix coverage uploading, add docker image tag validation

---------

Co-authored-by: Ahmed Gouda <ahmed.gouda@owasp.org>
pull Bot pushed a commit to rudransh-shrivastava/Nest that referenced this pull request Jun 7, 2026
* Extract codecov upload to a separate workflow

* Add permissions

* Add checkout

* Update code

* Add back the checkout step

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci gsoc2026:ahmedxgouda ahmedxgouda's GSoC 2026 related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants