Uploading report fails with CI provider Bitbucket

Description

I am getting repeated 400 errors when trying to upload coverage reports using the bash uploader (version 8a28df4).

The last successful upload did not detect any CI provider (like it always did). However, all our builds are suddenly display that the CI provider Bitbucket was detected.

As a consequence, the uploader fails to validate the commit hash. Previously, a commit hash with a length of 40 was used. Now, a commit hash with a length of 12 is used. Please see the two outputs below.

This results in failed uploads :(.

Repository

Private

Versions

CI Provider: Bitbucket pipelines
Bash uploader: 8a28df4

Additional Information

Example of output that worked correctly (ran on April 11th):

+ bash <(curl -s https://codecov.io/bash)

``

_____ _

/ ____| | |

| | ___ __| | ___ ___ _____ __

| | / _ \ / _ |/ _ / __/ _ \ \ / /`

| |___| (_) | (_| | __/ (_| (_) \ V /

\_____\___/ \__,_|\___|\___\___/ \_/

Bash-8a28df4

``

``

x> No CI provider detected.

Testing inside Docker? http://docs.codecov.io/docs/testing-with-docker

Testing with Tox? https://docs.codecov.io/docs/python#section-testing-with-tox

project root: .

--> token set from env

Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml

==> Running gcov in . (disable via -X gcov)

==> Python coveragepy not found

==> Searching for coverage reports in:

+ .

-> Found 1 reports

==> Detecting git/mercurial file structure

==> Reading reports

+ ./build/test-reports/clover.xml bytes=1604662

==> Appending adjustments

http://docs.codecov.io/docs/fixing-reports

+ Found adjustments

==> Gzipping contents

==> Uploading reports

url: https://codecov.io

query: branch=develop&commit=c4b072b974353c6ae73462938bfdf023a5e4bd19&build=&build_url=&name=&tag=&slug=HIDDEN%2FHIDDEN&service=&flags=&pr=&job=

-> Pinging Codecov

https://codecov.io/upload/v4?package=bash-8a28df4&token=$CODECOV_TOKEN&branch=develop&commit=c4b072b974353c6ae73462938bfdf023a5e4bd19&build=&build_url=&name=&tag=&slug=HIDDEN%2FHIDDEN&service=&flags=&pr=&job=

-> Uploading

-> View reports at https://codecov.io/bitbucket/HIDDEN/HIDDEN/commit/c4b072b974353c6ae73462938bfdf023a5e4bd19

``

Example of output that fails to upload reports:

+ bash <(curl -s https://codecov.io/bash)

``

_____ _

/ ____| | |

| | ___ __| | ___ ___ _____ __

| | / _ \ / _ |/ _ / __/ _ \ \ / /`

| |___| (_) | (_| | __/ (_| (_) \ V /

\_____\___/ \__,_|\___|\___\___/ \_/

Bash-8a28df4

``

``

==> Bitbucket detected.

project root: .

--> token set from env

Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml

==> Running gcov in . (disable via -X gcov)

==> Python coveragepy not found

==> Searching for coverage reports in:

+ .

-> Found 1 reports

==> Detecting git/mercurial file structure

==> Reading reports

+ ./build/test-reports/clover.xml bytes=1604613

==> Appending adjustments

http://docs.codecov.io/docs/fixing-reports

+ Found adjustments

==> Gzipping contents

==> Uploading reports

url: https://codecov.io

query: branch=feature%2FHAPI-267&commit=f23a48d61c07&build=1388&build_url=&name=&tag=&slug=HIDDEN%2FHIDDEN&service=bitbucket&flags=&pr=867&job=1388

-> Pinging Codecov

https://codecov.io/upload/v4?package=bash-8a28df4&token=$CODECOV_TOKEN&branch=feature%2FHAPI-267&commit=f23a48d61c07&build=1388&build_url=&name=&tag=&slug=HIDDEN%2FHIDDEN&service=bitbucket&flags=&pr=867&job=1388

-> Uploading

X> Failed to upload

-> Sleeping for 30s and trying again...

-> Pinging Codecov

https://codecov.io/upload/v4?package=bash-8a28df4&token=$CODECOV_TOKEN&branch=feature%2FHAPI-267&commit=f23a48d61c07&build=1388&build_url=&name=&tag=&slug=HIDDEN%2FHIDDEN&service=bitbucket&flags=&pr=867&job=1388

-> Uploading

X> Failed to upload

-> Sleeping for 30s and trying again...

-> Pinging Codecov

https://codecov.io/upload/v4?package=bash-8a28df4&token=$CODECOV_TOKEN&branch=feature%2FHAPI-267&commit=f23a48d61c07&build=1388&build_url=&name=&tag=&slug=HIDDEN%2FHIDDEN&service=bitbucket&flags=&pr=867&job=1388

-> Uploading

X> Failed to upload

-> Sleeping for 30s and trying again...

-> Pinging Codecov

https://codecov.io/upload/v4?package=bash-8a28df4&token=$CODECOV_TOKEN&branch=feature%2FHAPI-267&commit=f23a48d61c07&build=1388&build_url=&name=&tag=&slug=HIDDEN%2FHIDDEN&service=bitbucket&flags=&pr=867&job=1388

-> Uploading

X> Failed to upload

-> Sleeping for 30s and trying again...

-> Uploading to Codecov

HTTP 400

commit must match pattern ^\d+:\w{12}|\w{40}$

Hi Jeroen, we pushed a fix for this issue recently. Is this still happening for you?

The fix resolves the issue. thanks!