Description
We’ve recently switched from Travis CI to Drone CI with our OSS project PhotoPrism.
The official bash client is used to push new results to Codecov.
Our codecov token is provided as secret, so that it is replaced with “secret” in CI logs and can not be abused:
-> Pinging Codecov 1319 https://codecov.io/upload/v4?package=bash-20200728-9fb7d93&token=secret&branch=develop&commit=06df303f9f7fa32f0f47ff6b9e635d941284e9df&build=6&build_url=&name=&tag=&slug=photoprism%2Fphotoprism&service=drone.io&flags=&pr=&job=&cmd_args=
Fails with:
HTTP 400
Please provide the repository token to upload reports via -t :repository-token
This is confusing since the query parameter is token=...
not -t=...
.
Maybe the way we inject the token via .drone.yml is wrong?
See photoprism/.drone.yml at develop · photoprism/photoprism · GitHub
Looking at our old Travis CI logs, the query is not much different (in fact contains less information):
https://codecov.io/upload/v4?package=bash-20200728-9fb7d93&token=secret&branch=&commit=88fa66886fa6e336d7b8cfe895d0b7e50aa1f8f3&build=&build_url=&name=&tag=&slug=photoprism%2Fphotoprism&service=&flags=&pr=&job=&cmd_args=
See Travis CI - Test and Deploy Your Code with Confidence
However, the docs say Travis CI is trusted and doesn’t need a token. So it may work anyway, even if the token is wrong or was wrongly replaced.
Repository
CI/CD
Drone CI
Uploader
bash <(curl -s https://codecov.io/bash)
Commit SHAs
Codecov YAML
See photoprism/codecov.yml at develop · photoprism/photoprism · GitHub
Codecov Output
See https://drone.photoprism.app/photoprism/photoprism/8/1/3
scripts/codecov.sh
1287
1288 _____ _
1289 / ____
1290 ___ __ ___ ___ _____ __
1291 / _ \ / _` / _ \/ __/ _ \ \ / /
1292 ___ (_) (_ __/ (_ (_) \ V /
1293 \_____\___/ \__,_ \___ \___\___/ \_/
1294 Bash-20200728-9fb7d93
1295
1296
1297
1298 ==> Drone CI detected.
1299 project root: .
1300 Yaml found at: codecov.yml
1301 ==> Running gcov in . (disable via -X gcov)
1302 ==> Python coveragepy not found
1303 ==> Searching for coverage reports in:
1304 + .
1305
1306 -> Found 2 reports
1307 ==> Detecting git/mercurial file structure
1308 ==> Reading reports
1309 + ./coverage.txt bytes=492957
1310 + ./frontend/coverage/lcov.info bytes=34640
1311 ==> Appending adjustments
1312 https://docs.codecov.io/docs/fixing-reports
1313
1314 + Found adjustments
1315 ==> Gzipping contents
1316 ==> Uploading reports
1317 url: https://codecov.io
1318 query: branch=develop&commit=d03cbdedecee06f488b1f0138cbdc0f4eaefb459&build=8&build_url=&name=&tag=&slug=photoprism%2Fphotoprism&service=drone.io&flags=&pr=&job=&cmd_args=
1319
1320 -> Pinging Codecov
1321 https://codecov.io/upload/v4?package=bash-20200728-9fb7d93&token=secret&branch=develop&commit=d03cbdedecee06f488b1f0138cbdc0f4eaefb459&build=8&build_url=&name=&tag=&slug=photoprism%2Fphotoprism&service=drone.io&flags=&pr=&job=&cmd_args=
1322
1323 HTTP 400
1324 Please provide the repository token to upload reports via `-t :repository-token`