You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[2024-04-08T14:50:48.136Z] ['info'] Using manual override from args.
[2024-04-08T14:50:48.137Z] ['info'] Detected Bitbucket as the CI provider.
[2024-04-08T14:50:48.137Z] ['verbose'] -> Using the following env variables:
[2024-04-08T14:50:48.137Z] ['verbose'] CI: true
[2024-04-08T14:50:48.137Z] ['verbose'] BITBUCKET_BUILD_NUMBER: 13944
[2024-04-08T14:50:48.142Z] ['error'] Error detecting repos setting using git: Error: Error running external program: Error: spawnSync git ENOENT
[2024-04-08T14:50:48.143Z] ['verbose'] Using the following upload parameters:
[2024-04-08T14:50:48.143Z] ['verbose'] commit
[2024-04-08T14:50:48.143Z] ['verbose'] name
[2024-04-08T14:50:48.143Z] ['verbose'] tag
[2024-04-08T14:50:48.143Z] ['verbose'] flags
[2024-04-08T14:50:48.143Z] ['verbose'] parent
[2024-04-08T14:50:48.144Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=uploader-0.7.2&token=*******&commit=d9d3d2a783ff&name=&tag=&flags=&parent=
[2024-04-08T14:50:48.144Z] ['verbose'] Passed token was 36 characters long
[2024-04-08T14:50:48.144Z] ['verbose'] https://codecov.io/upload/v4?package=uploader-0.7.2&commit=d9d3d2a783ff&name=&tag=&flags=&parent=
Content-Type: 'text/plain'
Content-Encoding: 'gzip'
X-Reduced-Redundancy: 'false'
[2024-04-08T14:50:48.293Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io/: Error: There was an error fetching the storage URL during POST: 400 - Invalid request parameters
[2024-04-08T14:50:48.293Z] ['verbose'] The error stack is: Error: Error uploading to https://codecov.io: Error: There was an error fetching the storage URL during POST: 400 - Invalid request parameters
at main (/snapshot/repo/dist/src/index.js)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2024-04-08T14:50:48.294Z] ['verbose'] End of uploader: 863 milliseconds
[2024-04-08T14:50:48.294Z] ['info'] Codecov will exit with status code 0. If you are expecting a non-zero exit code, please pass in the `-Z` flag
Expected behavior
It should accept the passed in commit, or display actual error that commit format is not valid. (if full sha is required?)
These seems to be also a weird problem where Bitbucket on first runs returns short sha (12 characters) on follow up it returns full sha (40 characters) that actually works. See second run screenshot.
+ echo${BITBUCKET_COMMIT}
d9d3d2a783ff
--- second re-run ---
+ echo${BITBUCKET_COMMIT}
d9d3d2a783ff39eff9ab9567cf0b7ca1b877131c
Screenshots
First run:
Second run:
Additional context
If Codecov can only work full sha it return error, saying that sha passed in is not valid. Ideally Codecov should accept both?
Alternatively if someone know why sha change on Bitbucket on second run?
You found the bug I was going to point you to. Codecov can't use the short SHA because only Bitbucket knows what that expends to, meaning we can't get data regarding the commit from the API.
If you add the workaround from that Jira ticket though, I believe it works. Have you had a chance to try that?
Well the solution is the same, enable git by either using different docker image (changed to node:18-buster) or install it manually.
I think the main thing is that _getSHA function will run regardless if valid sha was passed as argument or not, as it purely rely on BITBUCKET_COMMIT variable being set to 12 character length.
So the case of passing valid sha, generated in previous step and stored as pipeline artifacts, it will still fail on follow up step if that step does not have GIT installed and we run it as part of pull-request pipeline.
Describe the bug
The issue is that _getSha function still calls runExternalProgram, even when
args.sha
is passed even if the result is discardedTo Reproduce
Steps to reproduce the behavior:
image: node:18-buster-slim
[2024-04-08T14:50:48.136Z] ['info'] Using manual override from args. [2024-04-08T14:50:48.137Z] ['info'] Detected Bitbucket as the CI provider. [2024-04-08T14:50:48.137Z] ['verbose'] -> Using the following env variables: [2024-04-08T14:50:48.137Z] ['verbose'] CI: true [2024-04-08T14:50:48.137Z] ['verbose'] BITBUCKET_BUILD_NUMBER: 13944 [2024-04-08T14:50:48.142Z] ['error'] Error detecting repos setting using git: Error: Error running external program: Error: spawnSync git ENOENT [2024-04-08T14:50:48.143Z] ['verbose'] Using the following upload parameters: [2024-04-08T14:50:48.143Z] ['verbose'] commit [2024-04-08T14:50:48.143Z] ['verbose'] name [2024-04-08T14:50:48.143Z] ['verbose'] tag [2024-04-08T14:50:48.143Z] ['verbose'] flags [2024-04-08T14:50:48.143Z] ['verbose'] parent [2024-04-08T14:50:48.144Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=uploader-0.7.2&token=*******&commit=d9d3d2a783ff&name=&tag=&flags=&parent= [2024-04-08T14:50:48.144Z] ['verbose'] Passed token was 36 characters long [2024-04-08T14:50:48.144Z] ['verbose'] https://codecov.io/upload/v4?package=uploader-0.7.2&commit=d9d3d2a783ff&name=&tag=&flags=&parent= Content-Type: 'text/plain' Content-Encoding: 'gzip' X-Reduced-Redundancy: 'false' [2024-04-08T14:50:48.293Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io/: Error: There was an error fetching the storage URL during POST: 400 - Invalid request parameters [2024-04-08T14:50:48.293Z] ['verbose'] The error stack is: Error: Error uploading to https://codecov.io: Error: There was an error fetching the storage URL during POST: 400 - Invalid request parameters at main (/snapshot/repo/dist/src/index.js) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [2024-04-08T14:50:48.294Z] ['verbose'] End of uploader: 863 milliseconds [2024-04-08T14:50:48.294Z] ['info'] Codecov will exit with status code 0. If you are expecting a non-zero exit code, please pass in the `-Z` flag
Expected behavior
It should accept the passed in commit, or display actual error that commit format is not valid. (if full sha is required?)
These seems to be also a weird problem where Bitbucket on first runs returns short sha (12 characters) on follow up it returns full sha (40 characters) that actually works. See second run screenshot.
Screenshots
![image](https://private-user-images.githubusercontent.com/3390897/320545098-eb3bb346-614d-4967-b50e-69edd87ed584.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3NjU3MjcsIm5iZiI6MTcyNDc2NTQyNywicGF0aCI6Ii8zMzkwODk3LzMyMDU0NTA5OC1lYjNiYjM0Ni02MTRkLTQ5NjctYjUwZS02OWVkZDg3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ZjcyYzhlNTMyNjllMTU0N2I2YmIyNTI1ZjA0OWE0Y2FlZGYwNTY1MWE4OTI3NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.eWevtu-lQsRd8T9HafOYJ42U0av4pY5lm5XijJQe1mc)
Second run:
![image](https://private-user-images.githubusercontent.com/3390897/320550857-b0efd4a3-03c9-4298-845b-4580f33c8cec.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3NjU3MjcsIm5iZiI6MTcyNDc2NTQyNywicGF0aCI6Ii8zMzkwODk3LzMyMDU1MDg1Ny1iMGVmZDRhMy0wM2M5LTQyOTgtODQ1Yi00NTgwZjMzYzhjZWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjdUMTMzMDI3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjQ3Y2JmNzEyYzg0OWUwZDQxZjIyMjNkMzc2NTZmN2ExZGE2ZGFiN2RhZGFmNmNmMjIzNzlmNDJjY2RmNmY2MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.28gDe6xxpD-p_gDjW1gFHquacq8QS5AzI0hOEZpC0OU)
Additional context
If Codecov can only work full sha it return error, saying that sha passed in is not valid. Ideally Codecov should accept both?
Seems to be different behaviour on pull-request run vs manual run...
https://jira.atlassian.com/browse/BCLOUD-19393
The text was updated successfully, but these errors were encountered: