From 11140273b285137413a960c180b08f86c03ef195 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Tue, 26 May 2020 09:59:05 -0400
Subject: [PATCH] Switch to the "bash uploader" as recommended by codecov
 support

Currently builds are failing to upload coverage reports because:

```
==> Uploading
    .url https://codecov.io
    .query service=circleci&package=py2.0.15&job=1057.0&yaml=codecov.yml&token=<secret>&build=1057.0&branch=154.save-and-respond.1&commit=714379bfb318ec39566729b2fecce6339ff55daf&slug=PrivateStorageio%2FZKAPAuthorizer
    Pinging Codecov...
    Uploading to S3...
Error: 400 Client Error: Bad Request for url: https://storage.googleapis.com/codecov/v4/raw/2020-05-26/3F10B6B6FEA878CCC9F58EAF87855DA8/714379bfb318ec39566729b2fecce6339ff55daf/17397def-dfec-47bb-b20f-879e223b0e90.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20200526%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20200526T132703Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=86369f603a1c27782899d7df6206b35a4564c70fe4efaea3cb72dd03cfb80b36

Tip: See all example repositories: https://github.com/codecov?query=example
Support channels:
  Email:   hello@codecov.io
  IRC:     #codecov
  Gitter:  https://gitter.im/codecov/support
  Twitter: @codecov
```
---
 .circleci/config.yml         | 10 ----------
 .circleci/report-coverage.sh |  8 +++++---
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index d33849e..f0a4bc1 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -127,16 +127,6 @@ jobs:
             # constraints on CircleCI. :/
             nix-build --cores 1 --max-jobs 1 --argstr hypothesisProfile ci --arg collectCoverage true --attr doc
 
-      - run:
-          name: "Cache codecov"
-          command: |
-            # Build codecov and any dependencies here, before we save the
-            # cache, so that they make it in to the cache too.  Turns out
-            # there is a python-cryptography dependency here that is expensive
-            # to build that doesn't get built earlier.  This saves us a couple
-            # minutes.
-            nix-build --expr '(import <nixpkgs> { }).python.withPackages (ps: [ ps.codecov ])'
-
       - save_cache:
           name: "Cache Nix Store Paths"
           key: zkapauthorizer-nix-store-v4-{{ checksum "nixpkgs.rev" }}
diff --git a/.circleci/report-coverage.sh b/.circleci/report-coverage.sh
index 3f15868..9f6cb79 100755
--- a/.circleci/report-coverage.sh
+++ b/.circleci/report-coverage.sh
@@ -1,9 +1,11 @@
-#! /usr/bin/env nix-shell
-#! nix-shell -i bash -p "python.withPackages (ps: [ ps.codecov ])"
+#! /usr/bin/env bash
 set -x
 find ./result-doc/share/doc
 cp ./result-doc/share/doc/*/.coverage.* ./
 python -m coverage combine
 python -m coverage report
 python -m coverage xml
-codecov --file coverage.xml
+
+# Unfortunately, this is the recommended uploader.
+# https://docs.codecov.io/docs/about-the-codecov-bash-uploader
+bash <(curl -s https://codecov.io/bash)
-- 
GitLab