Skip to content

Reenable codecov status#2367

Merged
paul-nechifor merged 4 commits into
mainfrom
codecov-status
Jun 5, 2026
Merged

Reenable codecov status#2367
paul-nechifor merged 4 commits into
mainfrom
codecov-status

Conversation

@Dreamsorcerer

Copy link
Copy Markdown
Collaborator

I think we need these status checks so people are more aware when coverage drops.

This also adds a workflow to add a label to PRs that have all required checks passing, so it's easy to see which PRs are mergeable. This also means it can be used in a custom view to filter out PRs which are not ready.

@greptile-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR re-enables Codecov project and patch status checks (previously set to status: false) and adds an enriched comment layout. It also introduces a new workflow that automatically applies or removes a ready-to-merge label based on whether the ci-complete check passes, using pull_request_target so the workflow has write access even for fork PRs.

  • .codecov.yml: Turns on both project and patch coverage status checks and extends the PR comment with diff, flags, components, and file sections.
  • .github/workflows/pr-label.yml: On every ci-complete check-run completion or new push, the workflow looks up the associated PR and either adds or removes the ready-to-merge label accordingly. Permissions are correctly scoped to pull-requests: write only at the job level with permissions: {} at the workflow level.

Confidence Score: 5/5

Both files are CI/config-only changes with no production code impact; the workflow follows least-privilege principles and handles the label-removal 404 edge case correctly.

The codecov change is a straightforward config toggle. The label workflow correctly gates on ci-complete, scopes permissions tightly, uses pull_request_target safely (no code checkout, no secret exposure), and defensively catches the 404 on label removal. No runtime code is affected.

No files require special attention. Both changed files are CI configuration with limited blast radius.

Important Files Changed

Filename Overview
.codecov.yml Re-enables Codecov project and patch status checks (previously disabled with status: false), and adds a comment layout including diff, flags, components, and files sections.
.github/workflows/pr-label.yml New workflow that adds/removes a ready-to-merge label based on the ci-complete check-run status; uses pull_request_target for write access on fork PRs and properly scopes permissions to pull-requests: write only.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub
    participant CI as CI Workflow
    participant LW as pr-label Workflow
    participant Codecov

    Dev->>GH: Push commit / Open PR
    GH->>LW: pull_request_target (synchronize/opened)
    LW->>GH: checks.listForRef(ci-complete, sha)
    GH-->>LW: [] (not run yet)
    LW->>GH: removeLabel(ready-to-merge) → 404 caught, OK

    GH->>CI: Trigger ci.yml
    CI->>Codecov: Upload coverage report
    Codecov-->>GH: Post project/patch status check
    CI->>GH: ci-complete job finishes

    GH->>LW: check_run completed (ci-complete)
    LW->>GH: listPullRequestsAssociatedWithCommit(sha)
    GH-->>LW: "[PR #N]"
    LW->>GH: checks.listForRef(ci-complete, sha)
    GH-->>LW: "[{conclusion: success}]"
    LW->>GH: addLabels(ready-to-merge)
Loading

Reviews (4): Last reviewed commit: "Comment layout" | Re-trigger Greptile

Comment thread .github/workflows/pr-label.yml Outdated
Comment thread .github/workflows/pr-label.yml
Comment thread .github/workflows/pr-label.yml
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@paul-nechifor paul-nechifor merged commit ea5a450 into main Jun 5, 2026
24 checks passed
@paul-nechifor paul-nechifor deleted the codecov-status branch June 5, 2026 23:00
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