TestFairy key with secret

We are using TestFairy for deployment to testers. In the workflow whenever we try to use a EnvVar or secret as the input to the step it fails with invalid API key. How should it be done?

We tested with both options enabled: replace variable inputs, expose to pull requests.

The main problem we have is that when someone uses the wrong key by mistake and we have to reset the key, it means we have to touch all the workflows for 35 projects.

Hi @ronan.o.ciosoig,

Can you please link a related build? It definitely should work, we’ll look into the build ASAP if you provide the url! :wink:

Here’s an example build that fails because of the API key.

You copied the build list page’s URL - can you please copy a specific build’s URL? Open the build’s page and copy the url from there :slight_smile:

https://www.bitrise.io/build/6fd2c9560538da2d This is it.

1 Like

Checked the build, did not see any issue with the config. So far it seems that the API Key you specified might be the issue.

Are you sure that you used the right one? Should be an alpha-numerical one like: c2f3972...9635e (40 chars long, unless they changed this in the last year).

I am absolutely sure about the key. If I put the key in directly in the field for TF, it works fine. If I use an environment variable it always fails with an invalid key error. We have since had an issue that this key way invalidated and we are using a new one now so that can break the testing.

Here is a build that fails with invalid key: https://www.bitrise.io/build/fc62225b93cd329a
and the same branch but with a changed key that passes. https://www.bitrise.io/build/0f1b0fde75e62fb6

The Beta_with_key workflow has one change made from Beta - it uses the key directly in the TestFairy upload step instead of used the secret. This clearly illustrates that there seems to be a problem with the step.

@viktorbenei

Hi @viktorbenei this issue still open.

Ahh, thanks for the link, I found the issue now after comparing the configs.

The issue is that you specified the is_expand: true flag at the wrong level, on the step level not on an input level. This is a per-input option and can only be specified there, if you specify it on step level it won’t change the expand options of the inputs.

So, instead of:

    - testfairy-deploy@2.0.1:
        is_expand: true
        inputs:
        - auto_update: 'on'
        - api_key: "$TEST_FAIRY_API_KEY"
        - comment: Beta version of the app

Please use:

    - testfairy-deploy@2.0.1:
        inputs:
        - auto_update: 'on'
        - api_key: "$TEST_FAIRY_API_KEY"
          opts:
            is_expand: true
        - comment: Beta version of the app

You can see on the UI whether the expand option is enabled for a given input, right under the input’s value. With your original config:

with my modified config:

Let me know if this wouldn’t help or if you’d have any questions! :wink:

I suspected it was an issue with that flag but didn’t know the correct place to put it. Thanks.

1 Like

Any time :wink:

This topic was automatically closed after 14 days. New replies are no longer allowed.