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

Branch is only displaying master and badge does not update #1594

Closed
ddold opened this issue Nov 11, 2021 · 4 comments
Closed

Branch is only displaying master and badge does not update #1594

ddold opened this issue Nov 11, 2021 · 4 comments

Comments

@ddold
Copy link

ddold commented Nov 11, 2021

Testing out Coveralls with a private repo I am noticing some inconsistencies.
First off the build number was a uid, but turns out that was the value sent from the CircleCI orb and I have a fix for that.
But on the main build page it states that I am on the master branch, and when I click on the branches dropdown and try to sync, it spins forever. Also the coverage badge shows as unknown!

My repo is private, so wont be able to share that. The language is Node and I am using nyc to get the test coverage in lcov format. The CI tool used is CircleCI and I am using the Coveralls orb to send the data to Coveralls. The code is stored in a Github repository

Screenshot 2021-11-11 at 16 50 58
As you can see it shows the last build branch being test_coverage (which is correct). It is very small and on the top left of the screenshot. Everywhere else there is a mention to a branch and it is referencing master

In my config for CircleCI I have the following bits;

- coveralls/upload:
          parallel: true
          flag_name: Unit Tests
          verbose: true
...
- coveralls/upload:
          parallel: true
          flag_name: Integration Tests
          verbose: true
...
code-coverage-complete:
    docker:
      - image: circleci/node:14.18.1
    steps:
      - coveralls/upload:
          parallel_finished: true

I see there is coveralls-node lib, is that sending the information through the code and not the CI tool. I haven't tried this but think doing it through CI would be better.

@afinetooth
Copy link
Collaborator

afinetooth commented Nov 12, 2021

Hi @ddold.

Strongly agree that CIRCLE_BUILD_NUM works better as build number than CIRCLE_WORKFLOW_ID. To complete your PR we'd need to make an accompanying change to node-coveralls here to make the integration pass CIRCLE_BUILD_NUM for service_number. However, those lines indicate it's currently being used for service_job_number, with which I'm not personally familiar because it's not spec in the Coveralls API Reference. I assume that's an accommodation for some factor related to CircleCI, so best to submit a PR there and let the original developers sort that out.

You sussed that out correctly, though: the Coveralls CircleCI Orb uses node-coveralls under-the-hood. node-coveralls is also the basis of the Coveralls Github Action. I think the goal is to ease maintenance of the particular, official CI tools (Actions, Orbs), those essentially being adapters to a single integration.

Assuming I have the right project (I won't paste the Coveralls URL here since your repo is private, not that anyone but you and your collaborators would be able to see it), the reason your badge reads unknown is because you have no builds on your default branch (master) in your build history:

Screen Shot 2021-11-12 at 3 12 16 PM

Your badge coverage is intended to represent coverage in the "production" instance of your code, so it's tied to your default branch (master in your case).

In addition to that, in order to receive PR comments you'll also need to submit some builds on master because the contents of a PR comment is a comparison between a pull_request commit and its base commit, which lives on a branch to which the PR will be merged, which is typically your default branch.

I'm assuming you've already configured your CI to build both pull_request and push type builds (on master specifically) and that you just haven't merged your setup branch into master yet.

That's very common and in that case, once you proceed to merge your setup branch into master, build the new commit in CI and send its coverage report to coveralls, you'll:

  1. Start seeing coverage % in your badge
  2. Start receiving PR comments in your PRs at Github.

@ddold
Copy link
Author

ddold commented Nov 15, 2021

Hi @afinetooth,

Thanks for your detailed response on this. I opened an issue here in the node-coveralls app to address that issue!

Yes you found the right repo and I just merged my test branch to master and now the badge shows the test percentage, great 👍

The only other issue I am seeing now is the fetching of the branches. This seems to go on forever. I found this past issue and read through it. On my dev console I can see the call to sync_branches.json returns 500. Reading about your comments saying it could be a CI issue, I turned on verbose logging and can see that CircleCI includes the branch name in the requests

Screenshot 2021-11-15 at 16 10 39
Screenshot 2021-11-15 at 16 13 14

With the CI sending the branch name, I am not sure what else is wrong and why the branches don't show up on the account?

@afinetooth
Copy link
Collaborator

Hi @ddold.

Thanks for creating that issue and including a reference to the code.

So I was able to reproduce the issue with the sync branches button. It's a bug. I submitted the issue and will feedback with any updates here.

@stale
Copy link

stale bot commented Mar 18, 2023

This issue has been automatically marked for closure because it has not had recent activity. It will be closed if no further activity occurs. If your issue is still active please add a comment and we’ll review as soon as we can. Thank you for your contributions.

@stale stale bot closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants