Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Unable to read token off Azure pipeline secret variable #203

Closed
pllim opened this issue Jun 6, 2019 · 1 comment
Closed

Unable to read token off Azure pipeline secret variable #203

pllim opened this issue Jun 6, 2019 · 1 comment

Comments

@pllim
Copy link

pllim commented Jun 6, 2019

Hi. I have the following job on Azure but I am having problem getting codecov to upload the result. I have CODECOV_TOKEN defined as secret pipeline variable in the pipeline settings. What I am doing wrong? I am unable to find any good working examples. Thank you!

  jobs:
  - job: 'Coverage'
    pool:
      vmImage: 'Ubuntu-16.04'
    strategy:
      maxParallel: 4

    steps:
    - task: UsePythonVersion@0

    - script: |
        sudo apt-get install libxml2-utils
        python -m pip install --upgrade pip setuptools
        pip install numpy scipy astropy pytest-astropy codecov
        python setup.py test --coverage --open-files --remote-data
      displayName: 'Run tests'

    - script: codecov -t $codecov_token
      env:
        codecov_token: $(CODECOV_TOKEN)
      displayName: 'Calculate coverage'

The error:

Script contents:
codecov -t $codecov_token
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/1f89c35e-940f-46ac-8a25-f5a6788d0909.sh

      _____          _
     / ____|        | |
    | |     ___   __| | ___  ___ _____   __
    | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
    | |___| (_) | (_| |  __/ (_| (_) \ V /
     \_____\___/ \____|\___|\___\___/ \_/
                                    v2.0.15

==>‌ Detecting CI provider‌
  -> Got branch from git/hg
  -> Got sha from git/hg
==>‌ Preparing upload‌
==>‌ Processing gcov (disable by -X gcov)‌
    Executing gcov (find /home/vsts/work/1/s -not -path './bower_components/**' -not -path './node_modules/**' -not -path './vendor/**' -type f -name '*.gcno'  -exec gcov -pb  {} +)
==>‌ Collecting reports‌
    ‌+‌ /home/vsts/work/1/s/synphot/tests/coveragerc bytes=825‌
    Generating coverage xml reports for Python
    ‌+‌ /home/vsts/work/1/s/coverage.xml bytes=64330‌
==>‌ Uploading‌
    .url https://codecov.io
    .query commit=5dd2bcbc2dd5211be036bca1d9a2f6a17c5dd958&branch=HEAD&token=<secret>&package=py2.0.15
    Pinging Codecov...
Error:‌ HTTP 400‌
Provided token is not a UUID.

xref spacetelescope/synphot_refactor#194

p.s. This won't be a problem if #193 is done.

@bstaletic
Copy link

You need to map the secret variable to one that is actually readable.

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops (search for "secret")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants