question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with userFraction

See original GitHub issue

Fails with userFraction: ‘1.0’ with the error:

Error: A provided userFraction must be between 0.0 and 1.0, inclusive-inclusive

My workflow:

name: My reusable workflow

on:
  workflow_call:
    inputs:
      track:
        description: Release type in Play Console, possible values are production, beta, alpha, internal, internalsharing or a custom track
        type: string
      userFraction:
        description: Percentage of users who should get this release
        type: string
        default: 1.0
      inAppUpdatePriority:
        description: Priority for inApp updates where 0 represents a minimum priority and 5 the higher one
        type: string
        default: 0

jobs:
  deploy-package:
    name: Deploy package
    runs-on: ubuntu-latest
    steps:
      - id: checkout-repository
        name: Checkout repository
        uses: actions/checkout@v3
      - id: setup-java
        name: Setup Java
        if: success()
        uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: '11'
          cache: 'gradle'
      - id: build-artifact
        name: Build artifact
        if: success()
        run: bash ${GITHUB_WORKSPACE}/.github/scripts/compile-package.sh # produces outputs with aab and mapping paths
      - id: publish-in-play-console
        name: Publish in Play Console
        if: |
          success() &&
          steps.build-artifact.outputs.package-file-path != null
        uses: r0adkll/upload-google-play@v1
        with:
          serviceAccountJsonPlainText: ${{secrets.PLAY_CONSOLE_SERVICE_ACCOUNT }}
          packageName: com.myapp
          releaseFiles: ${{ steps.build-artifact.outputs.package-file-path }}
          track: ${{ inputs.track }}
          userFraction: ${{ inputs.userFraction }}
          inAppUpdatePriority: ${{ inputs.inAppUpdatePriority }}
          mappingFile: ${{ steps.build-artifact.outputs.mapping-file-path }}
          whatsNewDirectory: ${GITHUB_WORKSPACE}/assets/whatsnew

I launch this reusable workflow from a dispatcher one:

name: Deploy manually

on:
  workflow_dispatch:
    inputs:
      track:
        description: Type of publish
        type: choice
        required: true
        options:
          - Production
          - Beta
          - Internal
      userFraction:
        description: Percentage of deploy (0.0 to 1.0)
        type: string
        required: true
        default: 1.0
      inAppUpdatePriority:
        description: InApp update priority (0=lower and 5=highest)
        type: string
        required: true
        default: 0

jobs:
  deploy:
    uses: ./.github/workflows/my_reusable_workflow.yaml
    secrets: inherit
    with:
      track: ${{ inputs.track }}
      userFraction: ${{ inputs.userFraction }}
      inAppUpdatePriority: ${{ inputs.inAppUpdatePriority }}

Checking my logs the userFraction that the reusable workflow receive is correct '1.0'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
bosweljacommented, Oct 17, 2022

Hey there! Sorry for the misleading error, having a userFraction of 0 and 1 is not supported by the API, so the value should be exclusive-exclusive. I have a change in review that rectifies this + adds tests to prevent future regressions

It should not.

1reaction
aurotonescommented, Oct 5, 2022

This is what i got

'userFraction' must be between 0 and 1! Got 1

Seems like it’s working fine for you, a user fraction of 1 is not valid. Set your status to completed and remove the userFraction

Now i got:

Error: 'userFraction' must be a number! Got NaN
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't set userFraction to 100% · Issue #927 - GitHub
Setting the userFraction to 1.0 results in error: User fraction must be lower than one , and omitting the field sets it to...
Read more >
Error when uploading Android app: "Rollout user fraction must ...
When use the Archive Manager of VS to upload an Android app. I get the following error: The field does not all "%"...
Read more >
Developers - Can't set userFraction to 100% - - Bountysource
Setting the userFraction to 1.0 results in error: User fraction must be lower than one , and omitting the field sets it to...
Read more >
APKs and Tracks | Google Play Developer API
Increasing the user fraction for a staged rollout; Halting a staged rollout; Completing a staged rollout. Draft releases; Specifying release ...
Read more >
Google Play Deploy v1.6.1 UserFraction Value - Builds
Is 50% the highest option now based on the build error below: Couldn't create config: failed to parse config: - UserFraction: 1.0: value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found