Open kYem opened 7 months ago
Seems to be different behaviour on pull-request run vs manual run... https://jira.atlassian.com/browse/BCLOUD-19393
Hi @kYem ,
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
curl -Os https://uploader.codecov.io/latest/linux/codecov curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM sha256sum -c codecov.SHA256SUM
chmod +x codecov ./codecov \ -t ${CODECOV_TOKEN} \ -C ${BITBUCKET_COMMIT} \ --dir coverage \ --rootDir ${BITBUCKET_CLONE_DIR} \ --slug ${BITBUCKET_REPO_FULL_NAME} \ --verbose
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
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?
Seems to be different behaviour on pull-request run vs manual run... https://jira.atlassian.com/browse/BCLOUD-19393