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

Reporter does not detect build number on Semaphore #55

Closed
jaredmoody opened this issue Apr 10, 2023 · 8 comments
Closed

Reporter does not detect build number on Semaphore #55

jaredmoody opened this issue Apr 10, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@jaredmoody
Copy link
Contributor

Here's my scenario that's not working:

  1. Ran Jest and uploaded successfully with --parallel
./coveralls --parallel
 
⠀⠀⠀⠀⠀⠀�[38;5;196m⣿�[0m
⠀⠀⠀⠀⠀�[38;5;196m⣼⣿⣧�[0m⠀⠀⠀⠀⠀⠀⠀ ⣠⣶⣾⣿⡇⢀⣴⣾⣿⣷⣆ ⣿⣿⠀⣰⣿⡟⢸⣿⣿⣿⡇ ⣿⣿⣿⣷⣦⠀⠀⢠⣿⣿⣿⠀⠀⣿⣿⠁⠀⣼⣿⡇⠀⢀⣴⣾⣿⡷
�[38;5;196m⠶⣶⣶⣶⣾⣿⣿⣿⣷⣶⣶⣶⠶�[0m  ⣸⣿⡟ ⠀⢠⣿⣿⠃⠈⣿⣿⠀⣿⣿⢠⣿⡿⠀⣿⣿⣧⣤⠀⢸⣿⡇⣠⣿⡿⠀⢠⣿⡟⣿⣿⠀⢸⣿⡿⠀⠀⣿⣿⠃⠀⢸⣿⣧⣄
⠀⠀�[38;5;196m⠙⢻⣿⣿⣿⣿⣿⡟⠋⠁�[0m⠀⠀ ⣿⣿⡇⠀ ⢸⣿⣿⠀⣸⣿⡟⠀⣿⣿⣾⡿⠁ ⣿⣿⠛⠛⠀⣿⣿⢿⣿⣏⠀⢀⣿⣿⣁⣿⣿⠀⣾⣿⡇⠀⢸⣿⡿⠀⠀⡀⠙⣿⣿⡆
⠀⠀�[38;5;196m⢠⣿⣿⣿⠿⣿⣿⣿⡄�[0m⠀⠀⠀ ⠙⢿⣿⣿⠇⠈⠿⣿⣿⡿⠋⠀⠀⢿⣿⡿⠁⠀⢸⣿⣿⣿⡇⢸⣿⣿⠀⣿⣿⣄⣾⣿⠛⠛⣿⣿⢠⣿⣿⣿ ⣼⣿⣿⣿ ⣿⣿⡿⠋⠀
⠀�[38;5;196m⢀⣾⠟⠋⠀⠀⠀⠙⠻⣷⡀�[0m⠀⠀
 
  v0.3.3

🔍 Detected coverage file: coverage/lcov.info
⭐️ Running in parallel mode. You must call the webhook after all jobs finish: `coveralls --done`
🚀 Posting coverage data to https://coveralls.io/api/v1/jobs
---
✅ API Response: {"message":"Job ##2198.1","url":"https://coveralls.io/jobs/118530597"}
- 💛, Coveralls
  1. Attempted to call the webhook to finish:
./coveralls --done
 
⠀⠀⠀⠀⠀⠀�[38;5;196m⣿�[0m
⠀⠀⠀⠀⠀�[38;5;196m⣼⣿⣧�[0m⠀⠀⠀⠀⠀⠀⠀ ⣠⣶⣾⣿⡇⢀⣴⣾⣿⣷⣆ ⣿⣿⠀⣰⣿⡟⢸⣿⣿⣿⡇ ⣿⣿⣿⣷⣦⠀⠀⢠⣿⣿⣿⠀⠀⣿⣿⠁⠀⣼⣿⡇⠀⢀⣴⣾⣿⡷
�[38;5;196m⠶⣶⣶⣶⣾⣿⣿⣿⣷⣶⣶⣶⠶�[0m  ⣸⣿⡟ ⠀⢠⣿⣿⠃⠈⣿⣿⠀⣿⣿⢠⣿⡿⠀⣿⣿⣧⣤⠀⢸⣿⡇⣠⣿⡿⠀⢠⣿⡟⣿⣿⠀⢸⣿⡿⠀⠀⣿⣿⠃⠀⢸⣿⣧⣄
⠀⠀�[38;5;196m⠙⢻⣿⣿⣿⣿⣿⡟⠋⠁�[0m⠀⠀ ⣿⣿⡇⠀ ⢸⣿⣿⠀⣸⣿⡟⠀⣿⣿⣾⡿⠁ ⣿⣿⠛⠛⠀⣿⣿⢿⣿⣏⠀⢀⣿⣿⣁⣿⣿⠀⣾⣿⡇⠀⢸⣿⡿⠀⠀⡀⠙⣿⣿⡆
⠀⠀�[38;5;196m⢠⣿⣿⣿⠿⣿⣿⣿⡄�[0m⠀⠀⠀ ⠙⢿⣿⣿⠇⠈⠿⣿⣿⡿⠋⠀⠀⢿⣿⡿⠁⠀⢸⣿⣿⣿⡇⢸⣿⣿⠀⣿⣿⣄⣾⣿⠛⠛⣿⣿⢠⣿⣿⣿ ⣼⣿⣿⣿ ⣿⣿⡿⠋⠀
⠀�[38;5;196m⢀⣾⠟⠋⠀⠀⠀⠙⠻⣷⡀�[0m⠀⠀
 
  v0.3.3

⭐️ Calling parallel done webhook: https://coveralls.io/webhook
---
✅ API Response: {"error":"No build matching CI build number  found"}
- 💛, Coveralls

I attempted to call the webhook directly with curl and received a similar message:

curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$SEMAPHORE_WORKFLOW_ID&payload[status]=done"
{"error":"No build matching CI build number d9334a96-6830-477f-92a2-867c7054a4c1 found"}

Next I changed my first parallel call to directly pass the job id, which did use the $SEMAPHORE_WORKFLOW_ID when reporting with --parallel, but then still did not on the --done step:

./coveralls --parallel --service-job-id=$SEMAPHORE_WORKFLOW_ID
 
⠀⠀⠀⠀⠀⠀�[38;5;196m⣿�[0m
⠀⠀⠀⠀⠀�[38;5;196m⣼⣿⣧�[0m⠀⠀⠀⠀⠀⠀⠀ ⣠⣶⣾⣿⡇⢀⣴⣾⣿⣷⣆ ⣿⣿⠀⣰⣿⡟⢸⣿⣿⣿⡇ ⣿⣿⣿⣷⣦⠀⠀⢠⣿⣿⣿⠀⠀⣿⣿⠁⠀⣼⣿⡇⠀⢀⣴⣾⣿⡷
�[38;5;196m⠶⣶⣶⣶⣾⣿⣿⣿⣷⣶⣶⣶⠶�[0m  ⣸⣿⡟ ⠀⢠⣿⣿⠃⠈⣿⣿⠀⣿⣿⢠⣿⡿⠀⣿⣿⣧⣤⠀⢸⣿⡇⣠⣿⡿⠀⢠⣿⡟⣿⣿⠀⢸⣿⡿⠀⠀⣿⣿⠃⠀⢸⣿⣧⣄
⠀⠀�[38;5;196m⠙⢻⣿⣿⣿⣿⣿⡟⠋⠁�[0m⠀⠀ ⣿⣿⡇⠀ ⢸⣿⣿⠀⣸⣿⡟⠀⣿⣿⣾⡿⠁ ⣿⣿⠛⠛⠀⣿⣿⢿⣿⣏⠀⢀⣿⣿⣁⣿⣿⠀⣾⣿⡇⠀⢸⣿⡿⠀⠀⡀⠙⣿⣿⡆
⠀⠀�[38;5;196m⢠⣿⣿⣿⠿⣿⣿⣿⡄�[0m⠀⠀⠀ ⠙⢿⣿⣿⠇⠈⠿⣿⣿⡿⠋⠀⠀⢿⣿⡿⠁⠀⢸⣿⣿⣿⡇⢸⣿⣿⠀⣿⣿⣄⣾⣿⠛⠛⣿⣿⢠⣿⣿⣿ ⣼⣿⣿⣿ ⣿⣿⡿⠋⠀
⠀�[38;5;196m⢀⣾⠟⠋⠀⠀⠀⠙⠻⣷⡀�[0m⠀⠀
 
  v0.3.3

🔍 Detected coverage file: coverage/lcov.info
⭐️ Running in parallel mode. You must call the webhook after all jobs finish: `coveralls --done`
🚀 Posting coverage data to https://coveralls.io/api/v1/jobs
---
✅ API Response: {"message":"Job #57072beb-0895-44e4-a7fe-ccc892a72d55.1","url":"https://coveralls.io/jobs/118531465"}
- 💛, Coveralls
./coveralls --done --service-job-id=$SEMAPHORE_WORKFLOW_ID
 
⠀⠀⠀⠀⠀⠀�[38;5;196m⣿�[0m
⠀⠀⠀⠀⠀�[38;5;196m⣼⣿⣧�[0m⠀⠀⠀⠀⠀⠀⠀ ⣠⣶⣾⣿⡇⢀⣴⣾⣿⣷⣆ ⣿⣿⠀⣰⣿⡟⢸⣿⣿⣿⡇ ⣿⣿⣿⣷⣦⠀⠀⢠⣿⣿⣿⠀⠀⣿⣿⠁⠀⣼⣿⡇⠀⢀⣴⣾⣿⡷
�[38;5;196m⠶⣶⣶⣶⣾⣿⣿⣿⣷⣶⣶⣶⠶�[0m  ⣸⣿⡟ ⠀⢠⣿⣿⠃⠈⣿⣿⠀⣿⣿⢠⣿⡿⠀⣿⣿⣧⣤⠀⢸⣿⡇⣠⣿⡿⠀⢠⣿⡟⣿⣿⠀⢸⣿⡿⠀⠀⣿⣿⠃⠀⢸⣿⣧⣄
⠀⠀�[38;5;196m⠙⢻⣿⣿⣿⣿⣿⡟⠋⠁�[0m⠀⠀ ⣿⣿⡇⠀ ⢸⣿⣿⠀⣸⣿⡟⠀⣿⣿⣾⡿⠁ ⣿⣿⠛⠛⠀⣿⣿⢿⣿⣏⠀⢀⣿⣿⣁⣿⣿⠀⣾⣿⡇⠀⢸⣿⡿⠀⠀⡀⠙⣿⣿⡆
⠀⠀�[38;5;196m⢠⣿⣿⣿⠿⣿⣿⣿⡄�[0m⠀⠀⠀ ⠙⢿⣿⣿⠇⠈⠿⣿⣿⡿⠋⠀⠀⢿⣿⡿⠁⠀⢸⣿⣿⣿⡇⢸⣿⣿⠀⣿⣿⣄⣾⣿⠛⠛⣿⣿⢠⣿⣿⣿ ⣼⣿⣿⣿ ⣿⣿⡿⠋⠀
⠀�[38;5;196m⢀⣾⠟⠋⠀⠀⠀⠙⠻⣷⡀�[0m⠀⠀
 
  v0.3.3

⭐️ Calling parallel done webhook: https://coveralls.io/webhook
---
✅ API Response: {"error":"No build matching CI build number  found"}
- 💛, Coveralls

Finally, what does work is calling coveralls --parallel --service-job-id=$SEMAPHORE_WORKFLOW_ID followed by manually calling the done webhook with curl.

@jaredmoody jaredmoody added the bug Something isn't working label Apr 10, 2023
@mrexox
Copy link
Contributor

mrexox commented Apr 12, 2023

Hey! I've merged your PR and released it under v0.3.5. Could you please test if it works?

@mrexox mrexox closed this as completed Apr 12, 2023
@jaredmoody
Copy link
Contributor Author

This is looking good to me, build numbers detected, info all flowing into Coveralls! 🍻

@jaredmoody
Copy link
Contributor Author

After some more usage today, I'm still seeing a problem executing coveralls --done - it doesn't seem to be working - I'm not seeing the coverage status reported back to Github. If I use curl, everything is fine.

Seems this issue needs to be re-opened.

Sample failure with binary:

curl -L https://coveralls.io/coveralls-linux.tar.gz | tar -xz && ./coveralls --done
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100 3147k  100 3147k    0     0  5298k      0 --:--:-- --:--:-- --:--:-- 5298k
 
⠀⠀⠀⠀⠀⠀�[38;5;196m⣿�[0m
⠀⠀⠀⠀⠀�[38;5;196m⣼⣿⣧�[0m⠀⠀⠀⠀⠀⠀⠀ ⣠⣶⣾⣿⡇⢀⣴⣾⣿⣷⣆ ⣿⣿⠀⣰⣿⡟⢸⣿⣿⣿⡇ ⣿⣿⣿⣷⣦⠀⠀⢠⣿⣿⣿⠀⠀⣿⣿⠁⠀⣼⣿⡇⠀⢀⣴⣾⣿⡷
�[38;5;196m⠶⣶⣶⣶⣾⣿⣿⣿⣷⣶⣶⣶⠶�[0m  ⣸⣿⡟ ⠀⢠⣿⣿⠃⠈⣿⣿⠀⣿⣿⢠⣿⡿⠀⣿⣿⣧⣤⠀⢸⣿⡇⣠⣿⡿⠀⢠⣿⡟⣿⣿⠀⢸⣿⡿⠀⠀⣿⣿⠃⠀⢸⣿⣧⣄
⠀⠀�[38;5;196m⠙⢻⣿⣿⣿⣿⣿⡟⠋⠁�[0m⠀⠀ ⣿⣿⡇⠀ ⢸⣿⣿⠀⣸⣿⡟⠀⣿⣿⣾⡿⠁ ⣿⣿⠛⠛⠀⣿⣿⢿⣿⣏⠀⢀⣿⣿⣁⣿⣿⠀⣾⣿⡇⠀⢸⣿⡿⠀⠀⡀⠙⣿⣿⡆
⠀⠀�[38;5;196m⢠⣿⣿⣿⠿⣿⣿⣿⡄�[0m⠀⠀⠀ ⠙⢿⣿⣿⠇⠈⠿⣿⣿⡿⠋⠀⠀⢿⣿⡿⠁⠀⢸⣿⣿⣿⡇⢸⣿⣿⠀⣿⣿⣄⣾⣿⠛⠛⣿⣿⢠⣿⣿⣿ ⣼⣿⣿⣿ ⣿⣿⡿⠋⠀
⠀�[38;5;196m⢀⣾⠟⠋⠀⠀⠀⠙⠻⣷⡀�[0m⠀⠀
 
  v0.3.6

⭐️ Calling parallel done webhook: https://coveralls.io/webhook
---
✅ API Response: {"done":true,"url":"https://coveralls.io/builds/58834287","jobs":5}
- 💛, Coveralls

Sample success with curl:

curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$SEMAPHORE_WORKFLOW_ID&payload[status]=done"
{"done":true,"url":"https://coveralls.io/builds/58834287","jobs":5}

Since the API response is the same in both cases, I'm not sure how to debug this.

@mrexox
Copy link
Contributor

mrexox commented Apr 13, 2023

Hey! Could you add a --debug option to coveralls call?

curl -L https://coveralls.io/coveralls-linux.tar.gz | tar -xz && ./coveralls --debug --done

It will print the payload it sends to coveralls.io

Looks like there are some parameters that affect coveralls backend. It can be our bug for Semaphore CI. Your debug output would help to investigate the issue.

@jaredmoody
Copy link
Contributor Author

jaredmoody commented Apr 13, 2023

Sure, here's the output:

$ ./coveralls --debug --done

⠀⠀⠀⠀⠀⠀⣿
⠀⠀⠀⠀⠀⣼⣿⣧⠀⠀⠀⠀⠀⠀⠀ ⣠⣶⣾⣿⡇⢀⣴⣾⣿⣷⣆ ⣿⣿⠀⣰⣿⡟⢸⣿⣿⣿⡇ ⣿⣿⣿⣷⣦⠀⠀⢠⣿⣿⣿⠀⠀⣿⣿⠁⠀⣼⣿⡇⠀⢀⣴⣾⣿⡷
⠶⣶⣶⣶⣾⣿⣿⣿⣷⣶⣶⣶⠶  ⣸⣿⡟ ⠀⢠⣿⣿⠃⠈⣿⣿⠀⣿⣿⢠⣿⡿⠀⣿⣿⣧⣤⠀⢸⣿⡇⣠⣿⡿⠀⢠⣿⡟⣿⣿⠀⢸⣿⡿⠀⠀⣿⣿⠃⠀⢸⣿⣧⣄
⠀⠀⠙⢻⣿⣿⣿⣿⣿⡟⠋⠁⠀⠀ ⣿⣿⡇⠀ ⢸⣿⣿⠀⣸⣿⡟⠀⣿⣿⣾⡿⠁ ⣿⣿⠛⠛⠀⣿⣿⢿⣿⣏⠀⢀⣿⣿⣁⣿⣿⠀⣾⣿⡇⠀⢸⣿⡿⠀⠀⡀⠙⣿⣿⡆
⠀⠀⢠⣿⣿⣿⠿⣿⣿⣿⡄⠀⠀⠀ ⠙⢿⣿⣿⠇⠈⠿⣿⣿⡿⠋⠀⠀⢿⣿⡿⠁⠀⢸⣿⣿⣿⡇⢸⣿⣿⠀⣿⣿⣄⣾⣿⠛⠛⣿⣿⢠⣿⣿⣿ ⣼⣿⣿⣿ ⣿⣿⡿⠋⠀
⠀⢀⣾⠟⠋⠀⠀⠀⠙⠻⣷⡀⠀⠀

  v0.3.6

⭐️ Calling parallel done webhook: https://coveralls.io/webhook
---
⛑ Debug Output:
{
  "service_branch": "dev/coveralls-client",
  "service_build_url": "https://jetbuilt.semaphoreci.com/workflows/c0f285e8-79cd-4105-ab25-62b07b86a666",
  "service_job_id": "8fbc3c57-b316-4439-9911-5f5b4e1db34b",
  "service_job_url": "https://jetbuilt.semaphoreci.com/jobs/8fbc3c57-b316-4439-9911-5f5b4e1db34b",
  "service_name": "semaphore",
  "service_number": "c0f285e8-79cd-4105-ab25-62b07b86a666",
  "service_pull_request": "11320",
  "commit_sha": "89ecb1457410757ef278673f0064339864b80257",
  "repo_token": "YIS4FUu5lyBNdhDqv4tSeSLSB7Aigk3ry",
  "payload": {
    "build_num": "c0f285e8-79cd-4105-ab25-62b07b86a666",
    "status": "done"
  }
}
---
✅ API Response: {"done":true,"url":"https://coveralls.io/builds/58834287","jobs":5}
- 💛, Coveralls

The build_num looks the same as in my curl example that worked:

$ echo $SEMAPHORE_WORKFLOW_ID
c0f285e8-79cd-4105-ab25-62b07b86a666

@mrexox
Copy link
Contributor

mrexox commented Apr 14, 2023

Hey! I've tried to reporoduce this bug but for my repo everything seems to work fine.

2023-04-14_12-08

  • Job coverage (I have 1 job just to implement a parallel flow)
  • Semaphore build stataus
  • Build coverage

Which of these you don't have for your builds?

You can check the PR here: mrexox/sentry-sanitizer#8

@mrexox
Copy link
Contributor

mrexox commented Apr 20, 2023

Hey @jaredmoody, do you still have this issue? Can you please check my recent comment about it?

@jaredmoody
Copy link
Contributor Author

I tried again and I am seeing Coveralls report back to Github - maybe I just didn't wait long enough the first time 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants