Skip to content

ci: add base_sha to codecov/codecov-action upload step - #1864

Merged
ko3n1g merged 1 commit into
mainfrom
ko3n1g/ci/codecov-base-sha
Apr 23, 2026
Merged

ko3n1g merged 1 commit into
mainfrom
ko3n1g/ci/codecov-base-sha

Conversation

@ko3n1g

@ko3n1g ko3n1g commented Apr 23, 2026

Copy link
Copy Markdown
Contributor
Claude summary

Summary

  • Added a Get PR info step (nv-gha-runners/get-pr-info@main, guarded by startsWith(github.ref, 'refs/heads/pull-request/')) to the Coverage job
  • Passes base_sha to codecov/codecov-action@v5 so Codecov can correctly compute the coverage diff against the PR's base commit

Signed-off-by: oliver könig <okoenig@nvidia.com>
@greptile-apps

greptile-apps Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a Get PR info step to the Coverage job that retrieves the PR's base commit SHA and passes it to codecov/codecov-action@v5 so Codecov can accurately compute coverage diffs. The fromJSON(...|| '{}').base.sha fallback ensures a safe empty string is produced on non-PR runs where the step is skipped.

Confidence Score: 5/5

Safe to merge; the only finding is a P2 style suggestion about pinning the action ref.

The change is small, well-guarded with a condition and a safe fallback expression, and does not affect test execution — only Codecov metadata. The single finding (unpinned @main) is P2 and does not block merge.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/cicd-main.yml Adds a Get PR info step gated on the PR branch naming convention, then passes base_sha (with a safe '{}' fallback for non-PR runs) to the Codecov upload action; the only concern is the unpinned @main reference on the new action.

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant GetPR as nv-gha-runners/get-pr-info@main
    participant Codecov as codecov/codecov-action@v5

    GHA->>GHA: Check if ref starts with 'refs/heads/pull-request/'
    alt is a PR branch
        GHA->>GetPR: Run get-pr-info step
        GetPR-->>GHA: outputs.pr-info (JSON with base.sha)
        GHA->>Codecov: Upload coverage with base_sha = pr-info.base.sha
    else not a PR branch (step skipped)
        GHA->>Codecov: Upload coverage with base_sha = '' (empty fallback)
    end
Loading

Reviews (1): Last reviewed commit: "ci: add base_sha to codecov/codecov-acti..." | Re-trigger Greptile

- name: Get PR info
id: get-pr-info
if: startsWith(github.ref, 'refs/heads/pull-request/')
uses: nv-gha-runners/get-pr-info@main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Unpinned @main reference for third-party action

nv-gha-runners/get-pr-info@main uses a mutable branch ref rather than an immutable commit SHA or version tag. All other actions in this workflow use explicit version tags (e.g. @v5, @v6, @v7). If the upstream action changes, this step will silently pick up those changes on the next run. Consider pinning to either a specific version tag or a full commit SHA for consistency and supply-chain safety.

@ko3n1g
ko3n1g merged commit f70af1f into main Apr 23, 2026
45 of 46 checks passed
shuoyangd pushed a commit to shuoyangd/NeMo-Curator that referenced this pull request Jun 12, 2026
)

Signed-off-by: oliver könig <okoenig@nvidia.com>

This branch was previously deployed

2 inactive deployments
nemo-ci — f07d8129 Deployed Apr 23, 2026 by copy-pr-bot[bot] via L0_Unit_Test_GPU-text #4073
test — f07d8129 Deployed Apr 23, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #4073
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