diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 243b3db..86bb9c1 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: ['3.7', '3.8', '3.9', '3.10'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -20,7 +20,7 @@ jobs: - name: Test with pytest run: | make testsuite.run - - uses: codecov/codecov-action@v2 + - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} flags: Python-v${{ matrix.python-version }} @@ -30,11 +30,11 @@ jobs: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: '3.8' - name: Install Packaging Tools run: | make package.install diff --git a/codecovopentelem/__init__.py b/codecovopentelem/__init__.py index d937aef..ac4437b 100644 --- a/codecovopentelem/__init__.py +++ b/codecovopentelem/__init__.py @@ -121,17 +121,19 @@ def export(self, spans): if not tracked_spans and not untracked_spans: return SpanExportResult.SUCCESS url = urllib.parse.urljoin(self._codecov_endpoint, "/profiling/uploads") + headers = {"Authorization": f"repotoken {self._repository_token}"} + json_data = {"profiling": self._code} try: res = requests.post( url, - headers={"Authorization": f"repotoken {self._repository_token}"}, - json={"profiling": self._code}, + headers=headers, + json=json_data, ) res.raise_for_status() except requests.RequestException: log.warning( "Unable to send profiling data to codecov", - extra=dict(response_data=res.json()) + extra=dict(url=url, json=json_data) ) return SpanExportResult.FAILURE location = res.json()["raw_upload_location"]