Skip to content

Conversation

@SkArchon
Copy link
Contributor

@SkArchon SkArchon commented Nov 25, 2025

This PR, is the initial commit for codecov changes, it includes the codecov.yaml file as well as a few changes for cli, I will open subsequent requests PRs for other subfolders after this PR.

Summary by CodeRabbit

  • Chores
    • Added automated test coverage collection and upload to an external coverage service as part of CI.
    • Added CI steps to collect and publish coverage after test runs.
  • Tests
    • Added local test coverage targets and scripts to run and produce coverage reports during development.
  • Configuration
    • Added a coverage policy: ~90% target with a 5% tolerance; results are informational and won’t block PRs.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

Walkthrough

Adds test coverage collection and Codecov upload for CLI and router tests, introduces a Codecov config, updates CLI test script and deps for Vitest coverage, and adds Makefile targets to produce Go coverage output for router-tests.

Changes

Cohort / File(s) Summary
CI: CLI workflow
/.github/workflows/cli-ci.yaml
Adds steps to run PNPM coverage for the CLI (pnpm --filter wgc ...) and upload results to Codecov using codecov-action@v5 with CODECOV_TOKEN.
CI: Router workflow
/.github/workflows/router-ci.yaml
Changes integration tests to run coverage variants and adds a Codecov upload step (codecov/codecov-action@v5) to send router-tests/coverage.out with verbose output using CODECOV_TOKEN.
Codecov configuration
codecov.yaml
New Codecov config defining patch coverage status: default target 90, threshold 5, informational true.
CLI tests & deps
cli/package.json
Adds @vitest/coverage-v8@3.2.4 (appears in both dependencies and devDependencies) and changes coverage script to vitest run test/ --coverage.
Router tests: Makefile
router-tests/Makefile
Adds coverage_file = coverage.out, new test-coverage and related coverage-managing targets and updates .PHONY to include them; emits coverage.out via -coverprofile/-coverpkg.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify CI artifact paths and that Vitest/PNPM produce coverage files where Codecov steps expect them.
  • Confirm duplication of @vitest/coverage-v8 in both dependencies and devDependencies is intentional.
  • Check Makefile coverage flags and generated coverage.out are correct and compatible with Go toolchain in CI.

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: initial codecov changes' accurately reflects the main objective of the PR, which is to introduce initial codecov integration across the monorepo (CLI, router, and configuration).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@0108a8b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2360   +/-   ##
=======================================
  Coverage        ?   34.69%           
=======================================
  Files           ?      336           
  Lines           ?    33612           
  Branches        ?      241           
=======================================
  Hits            ?    11661           
  Misses          ?    20926           
  Partials        ?     1025           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@github-actions
Copy link

github-actions bot commented Nov 25, 2025

Router image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-a50871b8e8e6b74102fb16adf20f9873c95459d4

Copy link
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: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7f3b69 and 687d5d5.

📒 Files selected for processing (2)
  • .github/workflows/router-ci.yaml (1 hunks)
  • router-tests/Makefile (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T22:13:25.222Z
Learnt from: StarpTech
Repo: wundergraph/cosmo PR: 2157
File: router-tests/go.mod:16-16
Timestamp: 2025-08-20T22:13:25.222Z
Learning: github.com/mark3labs/mcp-go v0.38.0 has regressions and should not be used in the wundergraph/cosmo project. v0.36.0 is the stable version that should be used across router-tests and other modules.

Applied to files:

  • router-tests/Makefile
🪛 checkmake (0.2.2)
router-tests/Makefile

[warning] 52-52: Missing required phony target "all"

(minphony)


[warning] 52-52: Missing required phony target "clean"

(minphony)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: build-router
  • GitHub Check: build_push_image (nonroot)
  • GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
  • GitHub Check: build_push_image
  • GitHub Check: image_scan
  • GitHub Check: build_push_image
  • GitHub Check: integration_test (./events)
  • GitHub Check: image_scan (nonroot)
  • GitHub Check: integration_test (./telemetry)
  • GitHub Check: build_test
  • GitHub Check: build_test
  • GitHub Check: build_test
  • GitHub Check: build_push_image
  • GitHub Check: build_test
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: build_test
  • GitHub Check: build_test

Copy link
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: 0

🧹 Nitpick comments (1)
router-tests/Makefile (1)

52-52: Consider adding standard Makefile targets all and clean.

Static analysis tools recommend including all and clean as phony targets. While not strictly required for this coverage work, adding them improves Makefile discoverability and aligns with GNU Make conventions.

If desired, you can add:

-.PHONY: test test-no-race lint test-stability clean-testcache update-test-config test-fresh test-coverage
+.PHONY: all clean test test-no-race lint test-stability clean-testcache update-test-config test-fresh test-coverage
+
+all: test
+
+clean: clean-testcache
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b469c53 and ebe40a1.

📒 Files selected for processing (1)
  • router-tests/Makefile (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-01T20:39:16.113Z
Learnt from: SkArchon
Repo: wundergraph/cosmo PR: 2252
File: router-tests/telemetry/telemetry_test.go:9684-9693
Timestamp: 2025-10-01T20:39:16.113Z
Learning: Repo preference: In router-tests/telemetry/telemetry_test.go, keep strict > 0 assertions for request.operation.*Time (parsingTime, normalizationTime, validationTime, planningTime) in telemetry-related tests; do not relax to >= 0 unless CI flakiness is observed.

Applied to files:

  • router-tests/Makefile
📚 Learning: 2025-08-20T22:13:25.222Z
Learnt from: StarpTech
Repo: wundergraph/cosmo PR: 2157
File: router-tests/go.mod:16-16
Timestamp: 2025-08-20T22:13:25.222Z
Learning: github.com/mark3labs/mcp-go v0.38.0 has regressions and should not be used in the wundergraph/cosmo project. v0.36.0 is the stable version that should be used across router-tests and other modules.

Applied to files:

  • router-tests/Makefile
🪛 checkmake (0.2.2)
router-tests/Makefile

[warning] 52-52: Missing required phony target "all"

(minphony)


[warning] 52-52: Missing required phony target "clean"

(minphony)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: build_push_image
  • GitHub Check: build_test
  • GitHub Check: build-router
  • GitHub Check: build_push_image
  • GitHub Check: build_push_image (nonroot)
  • GitHub Check: image_scan (nonroot)
  • GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
  • GitHub Check: integration_test (./events)
  • GitHub Check: image_scan
  • GitHub Check: build_test
  • GitHub Check: integration_test (./telemetry)
  • GitHub Check: build_test
  • GitHub Check: build_test
  • GitHub Check: build_push_image
  • GitHub Check: build_test
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
router-tests/Makefile (1)

4-4: Good: resolves previous coverage variable concerns and properly structures test-coverage target.

The code correctly uses the $(coverage_file) variable at line 21 (addressing the prior issue of hardcoding coverage.out), and the .PHONY declaration now lists only defined targets. The test-coverage target is well-structured: it properly propagates test flags, includes race detection, and specifies the correct coverage scope with -coverpkg=github.com/wundergraph/cosmo/router/....

Also applies to: 18-23, 52-52

Copy link
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

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

LGTM

@SkArchon SkArchon merged commit 175f80c into main Nov 25, 2025
59 checks passed
@SkArchon SkArchon deleted the milinda/codecov-initial branch November 25, 2025 20:56
@SkArchon
Copy link
Contributor Author

Local Performance Results

Coverage Test
make test-coverage  307.02s user 54.52s system 216% cpu 2:46.99 total
make test-coverage  306.61s user 53.05s system 217% cpu 2:45.25 total
make test-coverage  306.66s user 60.08s system 232% cpu 2:37.95 total
make test-coverage  306.45s user 53.41s system 214% cpu 2:48.08 total
make test-coverage  307.09s user 50.45s system 230% cpu 2:35.19 total

Normal Test
make test  376.27s user 63.07s system 248% cpu 2:57.04 total
make test  324.82s user 53.61s system 209% cpu 3:00.58 total
make test  304.55s user 57.39s system 221% cpu 2:43.53 total
make test  303.41s user 58.11s system 206% cpu 2:54.66 total
make test  303.75s user 57.01s system 234% cpu 2:33.65 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants