Skip to content

Conversation

@nanotaboada
Copy link
Owner

@nanotaboada nanotaboada commented Oct 24, 2025

External contributors' PRs fail when uploading coverage reports because GitHub Actions doesn't expose secrets to workflows triggered by forks (security measure). This adds a conditional to skip the coverage job for external PRs while still running tests.

Coverage will still run for:

  • Dependabot PRs (same repository)
  • Internal team PRs (same repository)
  • Pushes to master (post-merge)

External contributors will see their tests pass successfully without the coverage upload step.


This change is Reviewable

Summary by CodeRabbit

  • Chores
    • Updated CI workflow: coverage job now runs only for pushes or PRs from the same repository.
    • Reordered job declaration to clarify execution order without changing runtime behavior.
External contributors' PRs fail when uploading coverage reports because GitHub Actions doesn't expose secrets to workflows triggered by forks (security measure). This adds a conditional to skip the coverage job for external PRs while still running tests. Coverage will still run for: - Dependabot PRs (same repository) - Internal team PRs (same repository) - Pushes to master (post-merge) External contributors will see their tests pass successfully without the coverage upload step.
@nanotaboada nanotaboada requested a review from Copilot October 24, 2025 15:02
Copy link

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 adds a conditional check to prevent coverage upload failures for external fork PRs by only running the coverage job when secrets are available (same-repository PRs, Dependabot PRs, or pushes to master).

Key changes:

  • Added conditional logic to skip coverage upload for external fork PRs
  • Reordered job properties for consistency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The GitHub Actions workflow adds an if condition to the coverage job to run only for pushes or PRs from the same repository; the container job's runs-on line is moved after the if condition with no behavioral change.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Modifications
\.github/workflows/python-app.yml
Added if condition to the coverage job to gate execution to pushes or PRs from the same repository. Reordered the container job's runs-on declaration to follow the if condition — no functional change.

Sequence Diagram(s)

sequenceDiagram participant GH as GitHub (event) participant WF as Workflow participant CJ as Coverage Job GH->>WF: push / pull_request event WF->>CJ: evaluate `if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)` alt condition true CJ->>CJ: run coverage job else condition false WF-->>GH: skip coverage job end 
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "chore(ci): skip coverage upload for external fork PRs" accurately and directly summarizes the main change in the changeset. The raw summary confirms that an if condition was added to the coverage job to restrict execution to pushes or PRs from the same repository, and the PR objectives detail that this prevents coverage upload failures for external fork PRs due to missing secrets. The title is concise, uses clear and specific language that communicates the purpose of the change, follows good commit message conventions, and avoids vague terms or noise. A teammate scanning the git history would immediately understand that this PR gates coverage uploads specifically for external fork PRs.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/fork-pr-coverage

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 402d36d and 66cbd4f.

📒 Files selected for processing (1)
  • .github/workflows/python-app.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/python-app.yml
⏰ 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). (1)
  • GitHub Check: Codacy Static Code Analysis

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.

@codacy-production
Copy link

codacy-production bot commented Oct 24, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (b4c1a03) 131 119 90.84%
Head commit (66cbd4f) 131 (+0) 119 (+0) 90.84% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#424) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.65%. Comparing base (b4c1a03) to head (66cbd4f).

Additional details and impacted files
@@ Coverage Diff @@ ## master #424 +/- ## ======================================= Coverage 89.65% 89.65% ======================================= Files 3 3 Lines 116 116 ======================================= Hits 104 104 Misses 12 12 
Components Coverage Δ
Services 79.31% <ø> (ø)
Routes 100.00% <ø> (ø)
🚀 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant