Skip to content

Conversation

@m1so
Copy link
Member

@m1so m1so commented Nov 7, 2025

Summary by CodeRabbit

  • Chores
    • Consolidated per-run test coverage into a single combined coverage report for clearer overall metrics.
    • CI now uploads per-version coverage artifacts, downloads and merges them, and publishes a combined coverage report and artifact.
    • Per-version XML/JSON coverage files are no longer generated; per-run Markdown summaries remain.
    • Combined coverage is uploaded with a designated combined flag and improved reporting/validation and logging.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

📝 Walkthrough

Walkthrough

Per-version tests-unit matrix jobs now emit and upload a raw .coverage artifact named per Python version (no per-version xml/json or COVERAGE_FILE). A new coverage-combine job downloads those artifacts, renames them to unique files, conditionally runs coverage combine when multiple files exist (or uses a single file), generates consolidated reports (coverage.xml, coverage.json, htmlcov) under coverage/ and coverage-data/coverage.xml, uploads the combined XML artifact, and sends the combined report to Codecov with slug: ${{ github.repository }}, flags: combined, and disable_search: true. Steps log or fail if coverage data is missing.

Sequence Diagram(s)

sequenceDiagram
    participant Matrix as tests-unit (matrix)
    participant Artifacts as Artifact Storage
    participant Combine as coverage-combine
    participant Coverage as coverage tool
    participant Codecov as Codecov

    Note over Matrix: Parallel per-version runs
    Matrix->>Matrix: run tests -> produce .coverage
    Matrix->>Matrix: check for root .coverage
    Matrix->>Artifacts: upload coverage-${matrix.python-version} (.coverage)

    Combine->>Artifacts: download all coverage-*.coverage artifacts
    Combine->>Combine: rename/download to unique .coverage.*
    alt multiple .coverage files
        Combine->>Coverage: run `coverage combine` on .coverage.*
        Note right of Coverage: merges into coverage/.coverage
    else single .coverage file
        Combine->>Combine: use single .coverage as-is
    end
    Combine->>Coverage: generate coverage.xml, coverage.json, htmlcov in coverage/
    Combine->>Artifacts: upload coverage-data/coverage.xml (coverage-combined-report)
    Combine->>Codecov: upload coverage-data/coverage.xml (flags: combined, slug: repo, disable_search: true)
Loading

Possibly related PRs

  • deepnote/deepnote-toolkit#199 — Modifies CI coverage workflow and per-version artifact upload/aggregation, overlapping with these changes.
  • deepnote/deepnote-toolkit#187 — Adds per-version .coverage artifact uploads and combines per-version coverage into a single report.
  • deepnote/deepnote-toolkit#193 — Adjusts nox/coverage reporting and produces combined coverage.xml/json/html; closely matches the noxfile and CI updates here.

Suggested reviewers

  • mfranczel
  • FilipPyrek
  • hc2p

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 accurately describes the main change: combining code coverage in CI before uploading to Codecov, which matches the core objective of the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d058de1 and a932eec.

📒 Files selected for processing (1)
  • noxfile.py (1 hunks)
⏰ 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). (8)
  • GitHub Check: Test - Python 3.11
  • GitHub Check: Test - Python 3.9
  • GitHub Check: Test - Python 3.10
  • GitHub Check: Build and push artifacts for Python 3.11
  • GitHub Check: Build and push artifacts for Python 3.10
  • GitHub Check: Build and push artifacts for Python 3.9
  • GitHub Check: Build and push artifacts for Python 3.13
  • GitHub Check: Build and push artifacts for Python 3.12
🔇 Additional comments (4)
noxfile.py (4)

149-151: Path resolution improved.

Absolute path anchored to session.invoked_from addresses the brittleness flagged in the prior review.


156-162: Detection logic is sound.

Handles both combined and per-version coverage files with clear error messaging.


163-172: Conditional combining works correctly.

Combines per-version files when present, otherwise uses existing combined file. Logic is clear and the coverage combine invocation is correct.


174-199: Report generation uses absolute paths throughout.

All coverage commands now use absolute paths via combined_file and coverage_dir, addressing the past review comment.

Verify: Line 191's -i flag ignores source-file errors. Intentional for CI robustness?


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

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

📦 Python package built successfully!

  • Version: 1.1.2.dev17+0c9d2fe
  • Wheel: deepnote_toolkit-1.1.2.dev17+0c9d2fe-py3-none-any.whl
  • Install:
    pip install "deepnote-toolkit @ https://deepnote-staging-runtime-artifactory.s3.amazonaws.com/deepnote-toolkit-packages/1.1.2.dev17%2B0c9d2fe/deepnote_toolkit-1.1.2.dev17%2B0c9d2fe-py3-none-any.whl"

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 7, 2025
@deepnote-bot
Copy link

deepnote-bot commented Nov 7, 2025

🚀 Review App Deployment Started

📝 Description 🌐 Link / Info
🌍 Review application ra-24
🔑 Sign-in URL Click to sign-in
📊 Application logs View logs
🔄 Actions Click to redeploy
🚀 ArgoCD deployment View deployment
Last deployed 2025-11-07 15:39:13 (UTC)
📜 Deployed commit f7f7cb644b2cdd2dab6442e529e6cd654f5fe25e
🛠️ Toolkit version 0c9d2fe

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1bea06f and 2fae2c9.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (3 hunks)
⏰ 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). (5)
  • GitHub Check: Build and push artifacts for Python 3.13
  • GitHub Check: Build and push artifacts for Python 3.11
  • GitHub Check: Build and push artifacts for Python 3.9
  • GitHub Check: Build and push artifacts for Python 3.12
  • GitHub Check: Build and push artifacts for Python 3.10
🔇 Additional comments (7)
.github/workflows/ci.yml (7)

360-381: Coverage file handling logic is sound.

The script correctly detects and processes both single .coverage and parallel .coverage.* files, with proper error handling for the no-data case. Bash shopt and array checks are idiomatic.


383-389: LGTM. Path and conditional guard are consistent with the coverage file handling above.


398-404: LGTM. Artifact naming, retention, and conditional guard align with the coverage-combine job expectations.


433-456: Coverage combine logic is robust.

The combine step safely handles missing artifacts (no files found → success=false, exit 0), runs coverage combine to merge per-version files, and generates the XML report. The cascading success check prevents downstream failures if no data exists.


468-474: LGTM. Combined coverage artifact retained for 30 days, sensible for reference and audit.


425-431: The slug parameter in codecov-action v5 is valid and documented as "[Required when using the org token] Set the owner/repo slug used instead of the private repo token. Only applicable to some Enterprise users." Using it explicitly is optional but harmless for standard repositories.

When merge-multiple: true is used with pattern, all artifact contents are extracted into the same directory. This confirms that .coverage.3.9, .coverage.3.10, etc. files from each coverage-* artifact will be properly merged into coverage-data/ where coverage.combine() can locate them.

The workflow structure is sound: the download step with merge-multiple: true and pattern: coverage-* will correctly collect all per-version .coverage.* files into a single directory for the combine step.


458-466: No action needed — slug is optional in codecov-action v5.

The action requires only token (for private repos without OIDC) and optionally use_oidc. The slug parameter is not required; including it is optional but harmless. The code is correct as-is.

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 7, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 7, 2025
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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2f1a731 and d4dedac.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (2 hunks)
⏰ 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). (8)
  • GitHub Check: Build and push artifacts for Python 3.9
  • GitHub Check: Build and push artifacts for Python 3.13
  • GitHub Check: Build and push artifacts for Python 3.10
  • GitHub Check: Build and push artifacts for Python 3.12
  • GitHub Check: Build and push artifacts for Python 3.11
  • GitHub Check: Test - Python 3.9
  • GitHub Check: Test - Python 3.10
  • GitHub Check: Test - Python 3.11
🔇 Additional comments (5)
.github/workflows/ci.yml (5)

353-361: Verify coverage data file checks and outputs are sound.

The logic checks for .coverage existence and sets coverage_generated output; subsequent steps conditionally run based on this. The flow is correct.

Please confirm that when all test jobs fail (no .coverage artifacts generated), the desired behavior is to skip the Codecov upload gracefully without failing the workflow, as the current code at line 426–430 does with exit 0.


366-367: Per-version coverage report generation without explicit data-file reference.

The coverage report --format=markdown command relies on default .coverage file discovery. Given the prior check at line 354 confirms the file exists, this should work correctly. Clean simplification from the prior approach.


384-390: Coverage artifact uploads are well-structured.

Per-version .coverage files are uploaded with unique names (coverage-${{ matrix.python-version }}) and short retention (1 day). The artifact pattern and path structure align with the subsequent download logic in the coverage-combine job. Clean approach.


392-450: Coverage combine job design is sound; artifact aggregation logic verified.

The job correctly:

  • Depends on tests-unit with if: always() to run even on partial failures
  • Downloads all matching artifacts into subdirectories (line 414–415)
  • Searches for .coverage files in the correct nested structure (line 424: coverage-artifacts/*/.coverage)
  • Renames files to .coverage.* format for coverage combine (lines 437–440)
  • Runs combine, generates XML, and reports markdown summary
  • Sets success output to control downstream Codecov upload

The shell script uses shopt -s nullglob to gracefully handle zero matches and exits cleanly if no files are found. This prevents false failures when tests don't produce coverage (e.g., all jobs failed).


451-467: Codecov upload configuration and artifact handling are correct.

  • slug: ${{ github.repository }} is explicit and clear (line 456)
  • files: ./coverage-data/coverage.xml correctly references the combined report from repo root (line 457)
  • flags: combined distinguishes this from per-version reports (line 458)
  • Conditional if: steps.combine.outputs.success == 'true' prevents uploads when no coverage data exists (line 452)
  • Combined report artifact is retained for 30 days, appropriate for reference (line 467)

The upload parameters align with the codecov-action v5 API.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d4dedac and 88a9cc8.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (2 hunks)
⏰ 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). (5)
  • GitHub Check: Build and push artifacts for Python 3.13
  • GitHub Check: Build and push artifacts for Python 3.9
  • GitHub Check: Build and push artifacts for Python 3.11
  • GitHub Check: Build and push artifacts for Python 3.12
  • GitHub Check: Build and push artifacts for Python 3.10
🔇 Additional comments (3)
.github/workflows/ci.yml (3)

376-383: Artifact upload for per-version coverage looks correct.

Using include-hidden-files: true ensures .coverage (dot file) is captured. The 1-day retention for intermediate per-version artifacts is appropriate; they're temporary staging for the combine job.


353-361: Coverage check with explicit error handling is solid.

Exiting with code 1 when .coverage is missing ensures test environments that fail to generate coverage data are caught. Given pytest is invoked with --cov flags, this should only trigger on actual errors, making the error signal clear.


444-452: Codecov integration uses appropriate parameters.

Explicit slug: ${{ github.repository }}, flags: combined, and conditional fail_ci_if_error (base repo / push only) are well-configured. The combined coverage upload replaces per-version uploads, centralizing the report.

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.87%. Comparing base (663dce1) to head (a932eec).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
- Coverage   75.39%   72.87%   -2.52%     
==========================================
  Files          99       93       -6     
  Lines        5625     5140     -485     
  Branches      784      753      -31     
==========================================
- Hits         4241     3746     -495     
+ Misses       1384     1150     -234     
- Partials        0      244     +244     
Flag Coverage Δ
combined 72.87% <ø> (?)

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

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

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 7, 2025
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: 1

♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)

395-411: Missing error handling when no coverage artifacts exist.

If all tests-unit jobs fail and upload no artifacts, the download step finds nothing, the loop at lines 401-404 executes zero times (due to nullglob), and coverage combine coverage-data/ runs on an empty directory at line 406. This will cause coverage xml (line 407) to fail or produce invalid output, breaking the Codecov upload.

Add a check after the loop to handle this case gracefully:

  for file in coverage-artifacts/*/.coverage; do
    cp "$file" "coverage-data/.coverage.$i"
    i=$((i + 1))
  done
  
+ if [ $i -eq 0 ]; then
+   echo "⚠️ No coverage files found; tests may have failed" | tee -a $GITHUB_STEP_SUMMARY
+   echo "Skipping coverage upload"
+   exit 0
+ fi
+
  coverage combine coverage-data/

Note: Past review comments indicate similar error handling was previously addressed, but it's not present in the current code. Verify whether it was removed or the line numbers shifted.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 919d72d and d058de1.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (1 hunks)
  • noxfile.py (1 hunks)
⏰ 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). (5)
  • GitHub Check: Build and push artifacts for Python 3.13
  • GitHub Check: Build and push artifacts for Python 3.9
  • GitHub Check: Build and push artifacts for Python 3.10
  • GitHub Check: Build and push artifacts for Python 3.11
  • GitHub Check: Build and push artifacts for Python 3.12
🔇 Additional comments (3)
.github/workflows/ci.yml (3)

349-352: LGTM: Per-version summary improves workflow visibility.

Markdown format provides clear per-version coverage metrics in the workflow summary.


361-368: LGTM: Artifact upload correctly configured.

The step properly uploads the .coverage file with appropriate settings: short retention (1 day), includes hidden files, and errors if missing. This ensures coverage data flows to the combine job.


413-428: LGTM: Codecov upload properly configured.

The upload correctly specifies the repository slug, points to the combined XML file, sets the combined flag, and disables file search. The artifact upload preserves the report for 30 days. Both steps depend on successful coverage combination (implicit via the combine step not exiting early).

@m1so m1so marked this pull request as ready for review November 7, 2025 15:41
@m1so m1so requested a review from a team as a code owner November 7, 2025 15:41
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