Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job triggered by pull request not compared against correct base #597

Closed
eivindjahren opened this issue Dec 8, 2021 · 3 comments
Closed

Comments

@eivindjahren
Copy link

eivindjahren commented Dec 8, 2021

Akin to #95, when a job is triggered by a pull request, the checkout action may merge. If the PR branch is behind, the resulting comparison is still done against the common base although the coverage report is generated after the merge.

I am using the following workflow file:
https://github.com/equinor/ert/blob/main/.github/workflows/coverage.yml

Log of it running and causing incorrect comparison here: https://github.com/equinor/ert/runs/4459445221

@moribellamy
Copy link

This is affecting me too. Any tips for a workaround?

@moribellamy
Copy link

AFAICT these issues are related:

https://community.codecov.com/t/incorrect-code-coverage-due-to-wrong-base-commit-and-recent-commits-to-main-missing-from-codecov-dashboard/4046

https://community.codecov.com/t/incorrect-coverage-changes-reported-base-commit-not-uploading/3899/11

I have tried to get around this by specifying the following in my workflow.yml:

      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Get SHA ancestor to origin/main
        run: |
          echo "SHA_ANCESTOR=$(git merge-base origin/main HEAD)" >> $GITHUB_ENV

...and later, in the same job

      - name: Codecov
        uses: codecov/codecov-action@v3
        with:
          commit_parent: ${{ env.SHA_ANCESTOR }}

to me, it seems like a promising solution. but it still won't work for me, i suspect because codecov, for some reason, insists that my origin/main is behind where it actually is. (indeed, my dashboard shows an old commit as "newest", similar to one of the users I linked above)

@thomasrockhu-codecov
Copy link
Contributor

@moribellamy can you create a topic in our community boards for this?

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

No branches or pull requests

3 participants